├── .gitignore ├── .gitmodules ├── .solhint.json ├── .solhintignore ├── .vscode └── settings.json ├── README.md ├── audits ├── oxorio-private-audit.pdf ├── sherlock_audit.pdf ├── sync_vault_bailsec_final_report.pdf └── sync_vault_salus_final_report.pdf ├── broadcast └── goerli_deploy.s.sol │ ├── 1 │ ├── run-1706114402.json │ ├── run-1706114946.json │ └── run-latest.json │ └── 5 │ ├── run-1706115004.json │ ├── run-1706115042.json │ ├── run-1706117389.json │ ├── run-1706117402.json │ ├── run-1706118007.json │ └── run-1706118038.json ├── example.env ├── foundry.toml ├── lib ├── forge-std │ ├── .github │ │ └── workflows │ │ │ ├── ci.yml │ │ │ └── sync.yml │ ├── .gitignore │ ├── .gitmodules │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── foundry.toml │ ├── lib │ │ └── ds-test │ │ │ ├── .github │ │ │ └── workflows │ │ │ │ └── build.yml │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── default.nix │ │ │ ├── demo │ │ │ └── demo.sol │ │ │ ├── package.json │ │ │ └── src │ │ │ ├── test.sol │ │ │ └── test.t.sol │ ├── package.json │ ├── src │ │ ├── Base.sol │ │ ├── Script.sol │ │ ├── StdAssertions.sol │ │ ├── StdChains.sol │ │ ├── StdCheats.sol │ │ ├── StdError.sol │ │ ├── StdInvariant.sol │ │ ├── StdJson.sol │ │ ├── StdMath.sol │ │ ├── StdStorage.sol │ │ ├── StdStyle.sol │ │ ├── StdUtils.sol │ │ ├── Test.sol │ │ ├── Vm.sol │ │ ├── console.sol │ │ ├── console2.sol │ │ ├── interfaces │ │ │ ├── IERC1155.sol │ │ │ ├── IERC165.sol │ │ │ ├── IERC20.sol │ │ │ ├── IERC4626.sol │ │ │ ├── IERC721.sol │ │ │ └── IMulticall3.sol │ │ ├── mocks │ │ │ ├── MockERC20.sol │ │ │ └── MockERC721.sol │ │ └── safeconsole.sol │ └── test │ │ ├── StdAssertions.t.sol │ │ ├── StdChains.t.sol │ │ ├── StdCheats.t.sol │ │ ├── StdError.t.sol │ │ ├── StdMath.t.sol │ │ ├── StdStorage.t.sol │ │ ├── StdStyle.t.sol │ │ ├── StdUtils.t.sol │ │ ├── Vm.t.sol │ │ ├── compilation │ │ ├── CompilationScript.sol │ │ ├── CompilationScriptBase.sol │ │ ├── CompilationTest.sol │ │ └── CompilationTestBase.sol │ │ ├── fixtures │ │ └── broadcast.log.json │ │ └── mocks │ │ ├── MockERC20.t.sol │ │ └── MockERC721.t.sol ├── openzeppelin-contracts │ ├── .changeset │ │ └── config.json │ ├── .codecov.yml │ ├── .editorconfig │ ├── .eslintrc │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ │ ├── bug_report.md │ │ │ ├── config.yml │ │ │ └── feature_request.md │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ ├── actions │ │ │ ├── gas-compare │ │ │ │ └── action.yml │ │ │ ├── setup │ │ │ │ └── action.yml │ │ │ └── storage-layout │ │ │ │ └── action.yml │ │ └── workflows │ │ │ ├── actionlint.yml │ │ │ ├── changeset.yml │ │ │ ├── checks.yml │ │ │ ├── docs.yml │ │ │ ├── formal-verification.yml │ │ │ ├── release-cycle.yml │ │ │ └── upgradeable.yml │ ├── .gitignore │ ├── .gitmodules │ ├── .mocharc.js │ ├── .prettierrc │ ├── .solcover.js │ ├── CHANGELOG.md │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── GUIDELINES.md │ ├── LICENSE │ ├── README.md │ ├── RELEASING.md │ ├── SECURITY.md │ ├── audits │ │ ├── 2017-03.md │ │ ├── 2018-10.pdf │ │ ├── 2022-10-Checkpoints.pdf │ │ ├── 2022-10-ERC4626.pdf │ │ ├── 2023-05-v4.9.pdf │ │ ├── 2023-10-v5.0.pdf │ │ └── README.md │ ├── certora │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── diff │ │ │ └── access_manager_AccessManager.sol.patch │ │ ├── harnesses │ │ │ ├── AccessControlDefaultAdminRulesHarness.sol │ │ │ ├── AccessControlHarness.sol │ │ │ ├── DoubleEndedQueueHarness.sol │ │ │ ├── ERC20FlashMintHarness.sol │ │ │ ├── ERC20PermitHarness.sol │ │ │ ├── ERC20WrapperHarness.sol │ │ │ ├── ERC3156FlashBorrowerHarness.sol │ │ │ ├── ERC721Harness.sol │ │ │ ├── ERC721ReceiverHarness.sol │ │ │ ├── EnumerableMapHarness.sol │ │ │ ├── EnumerableSetHarness.sol │ │ │ ├── InitializableHarness.sol │ │ │ ├── Ownable2StepHarness.sol │ │ │ ├── OwnableHarness.sol │ │ │ ├── PausableHarness.sol │ │ │ └── TimelockControllerHarness.sol │ │ ├── reports │ │ │ ├── 2021-10.pdf │ │ │ ├── 2022-03.pdf │ │ │ └── 2022-05.pdf │ │ ├── run.js │ │ ├── specs.json │ │ └── specs │ │ │ ├── AccessControl.spec │ │ │ ├── AccessControlDefaultAdminRules.spec │ │ │ ├── DoubleEndedQueue.spec │ │ │ ├── ERC20.spec │ │ │ ├── ERC20FlashMint.spec │ │ │ ├── ERC20Wrapper.spec │ │ │ ├── ERC721.spec │ │ │ ├── EnumerableMap.spec │ │ │ ├── EnumerableSet.spec │ │ │ ├── Initializable.spec │ │ │ ├── Ownable.spec │ │ │ ├── Ownable2Step.spec │ │ │ ├── Pausable.spec │ │ │ ├── TimelockController.spec │ │ │ ├── helpers │ │ │ └── helpers.spec │ │ │ └── methods │ │ │ ├── IAccessControl.spec │ │ │ ├── IAccessControlDefaultAdminRules.spec │ │ │ ├── IERC20.spec │ │ │ ├── IERC2612.spec │ │ │ ├── IERC3156FlashBorrower.spec │ │ │ ├── IERC3156FlashLender.spec │ │ │ ├── IERC5313.spec │ │ │ ├── IERC721.spec │ │ │ ├── IERC721Receiver.spec │ │ │ ├── IOwnable.spec │ │ │ └── IOwnable2Step.spec │ ├── contracts │ │ ├── access │ │ │ ├── AccessControl.sol │ │ │ ├── IAccessControl.sol │ │ │ ├── Ownable.sol │ │ │ ├── Ownable2Step.sol │ │ │ ├── README.adoc │ │ │ ├── extensions │ │ │ │ ├── AccessControlDefaultAdminRules.sol │ │ │ │ ├── AccessControlEnumerable.sol │ │ │ │ ├── IAccessControlDefaultAdminRules.sol │ │ │ │ └── IAccessControlEnumerable.sol │ │ │ └── manager │ │ │ │ ├── AccessManaged.sol │ │ │ │ ├── AccessManager.sol │ │ │ │ ├── AuthorityUtils.sol │ │ │ │ ├── IAccessManaged.sol │ │ │ │ ├── IAccessManager.sol │ │ │ │ └── IAuthority.sol │ │ ├── finance │ │ │ ├── README.adoc │ │ │ └── VestingWallet.sol │ │ ├── governance │ │ │ ├── Governor.sol │ │ │ ├── IGovernor.sol │ │ │ ├── README.adoc │ │ │ ├── TimelockController.sol │ │ │ ├── extensions │ │ │ │ ├── GovernorCountingSimple.sol │ │ │ │ ├── GovernorPreventLateQuorum.sol │ │ │ │ ├── GovernorSettings.sol │ │ │ │ ├── GovernorStorage.sol │ │ │ │ ├── GovernorTimelockAccess.sol │ │ │ │ ├── GovernorTimelockCompound.sol │ │ │ │ ├── GovernorTimelockControl.sol │ │ │ │ ├── GovernorVotes.sol │ │ │ │ └── GovernorVotesQuorumFraction.sol │ │ │ └── utils │ │ │ │ ├── IVotes.sol │ │ │ │ └── Votes.sol │ │ ├── interfaces │ │ │ ├── IERC1155.sol │ │ │ ├── IERC1155MetadataURI.sol │ │ │ ├── IERC1155Receiver.sol │ │ │ ├── IERC1271.sol │ │ │ ├── IERC1363.sol │ │ │ ├── IERC1363Receiver.sol │ │ │ ├── IERC1363Spender.sol │ │ │ ├── IERC165.sol │ │ │ ├── IERC1820Implementer.sol │ │ │ ├── IERC1820Registry.sol │ │ │ ├── IERC1967.sol │ │ │ ├── IERC20.sol │ │ │ ├── IERC20Metadata.sol │ │ │ ├── IERC2309.sol │ │ │ ├── IERC2612.sol │ │ │ ├── IERC2981.sol │ │ │ ├── IERC3156.sol │ │ │ ├── IERC3156FlashBorrower.sol │ │ │ ├── IERC3156FlashLender.sol │ │ │ ├── IERC4626.sol │ │ │ ├── IERC4906.sol │ │ │ ├── IERC5267.sol │ │ │ ├── IERC5313.sol │ │ │ ├── IERC5805.sol │ │ │ ├── IERC6372.sol │ │ │ ├── IERC721.sol │ │ │ ├── IERC721Enumerable.sol │ │ │ ├── IERC721Metadata.sol │ │ │ ├── IERC721Receiver.sol │ │ │ ├── IERC777.sol │ │ │ ├── IERC777Recipient.sol │ │ │ ├── IERC777Sender.sol │ │ │ ├── README.adoc │ │ │ ├── draft-IERC1822.sol │ │ │ └── draft-IERC6093.sol │ │ ├── metatx │ │ │ ├── ERC2771Context.sol │ │ │ ├── ERC2771Forwarder.sol │ │ │ └── README.adoc │ │ ├── mocks │ │ │ ├── AccessManagedTarget.sol │ │ │ ├── ArraysMock.sol │ │ │ ├── AuthorityMock.sol │ │ │ ├── CallReceiverMock.sol │ │ │ ├── ContextMock.sol │ │ │ ├── DummyImplementation.sol │ │ │ ├── EIP712Verifier.sol │ │ │ ├── ERC1271WalletMock.sol │ │ │ ├── ERC165 │ │ │ │ ├── ERC165InterfacesSupported.sol │ │ │ │ ├── ERC165MaliciousData.sol │ │ │ │ ├── ERC165MissingData.sol │ │ │ │ ├── ERC165NotSupported.sol │ │ │ │ └── ERC165ReturnBomb.sol │ │ │ ├── ERC2771ContextMock.sol │ │ │ ├── ERC3156FlashBorrowerMock.sol │ │ │ ├── EtherReceiverMock.sol │ │ │ ├── InitializableMock.sol │ │ │ ├── MulticallTest.sol │ │ │ ├── MultipleInheritanceInitializableMocks.sol │ │ │ ├── PausableMock.sol │ │ │ ├── ReentrancyAttack.sol │ │ │ ├── ReentrancyMock.sol │ │ │ ├── RegressionImplementation.sol │ │ │ ├── SingleInheritanceInitializableMocks.sol │ │ │ ├── Stateless.sol │ │ │ ├── StorageSlotMock.sol │ │ │ ├── TimelockReentrant.sol │ │ │ ├── UpgradeableBeaconMock.sol │ │ │ ├── VotesMock.sol │ │ │ ├── compound │ │ │ │ └── CompTimelock.sol │ │ │ ├── governance │ │ │ │ ├── GovernorMock.sol │ │ │ │ ├── GovernorPreventLateQuorumMock.sol │ │ │ │ ├── GovernorStorageMock.sol │ │ │ │ ├── GovernorTimelockAccessMock.sol │ │ │ │ ├── GovernorTimelockCompoundMock.sol │ │ │ │ ├── GovernorTimelockControlMock.sol │ │ │ │ ├── GovernorVoteMock.sol │ │ │ │ └── GovernorWithParamsMock.sol │ │ │ ├── proxy │ │ │ │ ├── BadBeacon.sol │ │ │ │ ├── ClashingImplementation.sol │ │ │ │ └── UUPSUpgradeableMock.sol │ │ │ └── token │ │ │ │ ├── ERC1155ReceiverMock.sol │ │ │ │ ├── ERC20ApprovalMock.sol │ │ │ │ ├── ERC20DecimalsMock.sol │ │ │ │ ├── ERC20ExcessDecimalsMock.sol │ │ │ │ ├── ERC20FlashMintMock.sol │ │ │ │ ├── ERC20ForceApproveMock.sol │ │ │ │ ├── ERC20Mock.sol │ │ │ │ ├── ERC20MulticallMock.sol │ │ │ │ ├── ERC20NoReturnMock.sol │ │ │ │ ├── ERC20Reentrant.sol │ │ │ │ ├── ERC20ReturnFalseMock.sol │ │ │ │ ├── ERC20VotesLegacyMock.sol │ │ │ │ ├── ERC4626LimitsMock.sol │ │ │ │ ├── ERC4626Mock.sol │ │ │ │ ├── ERC4626OffsetMock.sol │ │ │ │ ├── ERC4646FeesMock.sol │ │ │ │ ├── ERC721ConsecutiveEnumerableMock.sol │ │ │ │ ├── ERC721ConsecutiveMock.sol │ │ │ │ ├── ERC721ReceiverMock.sol │ │ │ │ ├── ERC721URIStorageMock.sol │ │ │ │ └── VotesTimestamp.sol │ │ ├── package.json │ │ ├── proxy │ │ │ ├── Clones.sol │ │ │ ├── ERC1967 │ │ │ │ ├── ERC1967Proxy.sol │ │ │ │ └── ERC1967Utils.sol │ │ │ ├── Proxy.sol │ │ │ ├── README.adoc │ │ │ ├── beacon │ │ │ │ ├── BeaconProxy.sol │ │ │ │ ├── IBeacon.sol │ │ │ │ └── UpgradeableBeacon.sol │ │ │ ├── transparent │ │ │ │ ├── ProxyAdmin.sol │ │ │ │ └── TransparentUpgradeableProxy.sol │ │ │ └── utils │ │ │ │ ├── Initializable.sol │ │ │ │ └── UUPSUpgradeable.sol │ │ ├── token │ │ │ ├── ERC1155 │ │ │ │ ├── ERC1155.sol │ │ │ │ ├── IERC1155.sol │ │ │ │ ├── IERC1155Receiver.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC1155Burnable.sol │ │ │ │ │ ├── ERC1155Pausable.sol │ │ │ │ │ ├── ERC1155Supply.sol │ │ │ │ │ ├── ERC1155URIStorage.sol │ │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ │ └── utils │ │ │ │ │ └── ERC1155Holder.sol │ │ │ ├── ERC20 │ │ │ │ ├── ERC20.sol │ │ │ │ ├── IERC20.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC20Burnable.sol │ │ │ │ │ ├── ERC20Capped.sol │ │ │ │ │ ├── ERC20FlashMint.sol │ │ │ │ │ ├── ERC20Pausable.sol │ │ │ │ │ ├── ERC20Permit.sol │ │ │ │ │ ├── ERC20Votes.sol │ │ │ │ │ ├── ERC20Wrapper.sol │ │ │ │ │ ├── ERC4626.sol │ │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ │ └── IERC20Permit.sol │ │ │ │ └── utils │ │ │ │ │ └── SafeERC20.sol │ │ │ ├── ERC721 │ │ │ │ ├── ERC721.sol │ │ │ │ ├── IERC721.sol │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC721Burnable.sol │ │ │ │ │ ├── ERC721Consecutive.sol │ │ │ │ │ ├── ERC721Enumerable.sol │ │ │ │ │ ├── ERC721Pausable.sol │ │ │ │ │ ├── ERC721Royalty.sol │ │ │ │ │ ├── ERC721URIStorage.sol │ │ │ │ │ ├── ERC721Votes.sol │ │ │ │ │ ├── ERC721Wrapper.sol │ │ │ │ │ ├── IERC721Enumerable.sol │ │ │ │ │ └── IERC721Metadata.sol │ │ │ │ └── utils │ │ │ │ │ └── ERC721Holder.sol │ │ │ └── common │ │ │ │ ├── ERC2981.sol │ │ │ │ └── README.adoc │ │ ├── utils │ │ │ ├── Address.sol │ │ │ ├── Arrays.sol │ │ │ ├── Base64.sol │ │ │ ├── Context.sol │ │ │ ├── Create2.sol │ │ │ ├── Multicall.sol │ │ │ ├── Nonces.sol │ │ │ ├── Pausable.sol │ │ │ ├── README.adoc │ │ │ ├── ReentrancyGuard.sol │ │ │ ├── ShortStrings.sol │ │ │ ├── StorageSlot.sol │ │ │ ├── Strings.sol │ │ │ ├── cryptography │ │ │ │ ├── ECDSA.sol │ │ │ │ ├── EIP712.sol │ │ │ │ ├── MerkleProof.sol │ │ │ │ ├── MessageHashUtils.sol │ │ │ │ └── SignatureChecker.sol │ │ │ ├── introspection │ │ │ │ ├── ERC165.sol │ │ │ │ ├── ERC165Checker.sol │ │ │ │ └── IERC165.sol │ │ │ ├── math │ │ │ │ ├── Math.sol │ │ │ │ ├── SafeCast.sol │ │ │ │ └── SignedMath.sol │ │ │ ├── structs │ │ │ │ ├── BitMaps.sol │ │ │ │ ├── Checkpoints.sol │ │ │ │ ├── DoubleEndedQueue.sol │ │ │ │ ├── EnumerableMap.sol │ │ │ │ └── EnumerableSet.sol │ │ │ └── types │ │ │ │ └── Time.sol │ │ └── vendor │ │ │ └── compound │ │ │ ├── ICompoundTimelock.sol │ │ │ └── LICENSE │ ├── foundry.toml │ ├── hardhat.config.js │ ├── hardhat │ │ ├── env-artifacts.js │ │ ├── env-contract.js │ │ ├── ignore-unreachable-warnings.js │ │ ├── skip-foundry-tests.js │ │ └── task-test-get-files.js │ ├── lib │ │ ├── erc4626-tests │ │ │ ├── ERC4626.prop.sol │ │ │ ├── ERC4626.test.sol │ │ │ ├── LICENSE │ │ │ └── README.md │ │ └── forge-std │ │ │ ├── .github │ │ │ └── workflows │ │ │ │ └── ci.yml │ │ │ ├── .gitignore │ │ │ ├── .gitmodules │ │ │ ├── LICENSE-APACHE │ │ │ ├── LICENSE-MIT │ │ │ ├── README.md │ │ │ ├── foundry.toml │ │ │ ├── lib │ │ │ └── ds-test │ │ │ │ ├── .gitignore │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── default.nix │ │ │ │ ├── demo │ │ │ │ └── demo.sol │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ └── test.sol │ │ │ ├── package.json │ │ │ ├── src │ │ │ ├── Base.sol │ │ │ ├── Script.sol │ │ │ ├── StdAssertions.sol │ │ │ ├── StdChains.sol │ │ │ ├── StdCheats.sol │ │ │ ├── StdError.sol │ │ │ ├── StdJson.sol │ │ │ ├── StdMath.sol │ │ │ ├── StdStorage.sol │ │ │ ├── StdUtils.sol │ │ │ ├── Test.sol │ │ │ ├── Vm.sol │ │ │ ├── console.sol │ │ │ ├── console2.sol │ │ │ └── interfaces │ │ │ │ ├── IERC1155.sol │ │ │ │ ├── IERC165.sol │ │ │ │ ├── IERC20.sol │ │ │ │ ├── IERC4626.sol │ │ │ │ └── IERC721.sol │ │ │ └── test │ │ │ ├── StdAssertions.t.sol │ │ │ ├── StdChains.t.sol │ │ │ ├── StdCheats.t.sol │ │ │ ├── StdError.t.sol │ │ │ ├── StdMath.t.sol │ │ │ ├── StdStorage.t.sol │ │ │ ├── StdUtils.t.sol │ │ │ ├── compilation │ │ │ ├── CompilationScript.sol │ │ │ ├── CompilationScriptBase.sol │ │ │ ├── CompilationTest.sol │ │ │ └── CompilationTestBase.sol │ │ │ └── fixtures │ │ │ └── broadcast.log.json │ ├── logo.svg │ ├── netlify.toml │ ├── package-lock.json │ ├── package.json │ ├── remappings.txt │ ├── renovate.json │ ├── requirements.txt │ ├── scripts │ │ ├── checks │ │ │ ├── compare-layout.js │ │ │ ├── compareGasReports.js │ │ │ ├── extract-layout.js │ │ │ ├── generation.sh │ │ │ └── inheritance-ordering.js │ │ ├── gen-nav.js │ │ ├── generate │ │ │ ├── format-lines.js │ │ │ ├── run.js │ │ │ └── templates │ │ │ │ ├── Checkpoints.js │ │ │ │ ├── Checkpoints.opts.js │ │ │ │ ├── Checkpoints.t.js │ │ │ │ ├── EnumerableMap.js │ │ │ │ ├── EnumerableSet.js │ │ │ │ ├── SafeCast.js │ │ │ │ ├── StorageSlot.js │ │ │ │ └── conversion.js │ │ ├── git-user-config.sh │ │ ├── helpers.js │ │ ├── prepack.sh │ │ ├── prepare-docs.sh │ │ ├── release │ │ │ ├── format-changelog.js │ │ │ ├── synchronize-versions.js │ │ │ ├── update-comment.js │ │ │ ├── version.sh │ │ │ └── workflow │ │ │ │ ├── exit-prerelease.sh │ │ │ │ ├── github-release.js │ │ │ │ ├── integrity-check.sh │ │ │ │ ├── pack.sh │ │ │ │ ├── publish.sh │ │ │ │ ├── rerun.js │ │ │ │ ├── set-changesets-pr-title.js │ │ │ │ ├── start.sh │ │ │ │ └── state.js │ │ ├── remove-ignored-artifacts.js │ │ ├── solhint-custom │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── update-docs-branch.js │ │ └── upgradeable │ │ │ ├── README.md │ │ │ ├── patch-apply.sh │ │ │ ├── patch-save.sh │ │ │ ├── transpile-onto.sh │ │ │ ├── transpile.sh │ │ │ └── upgradeable.patch │ ├── slither.config.json │ ├── solhint.config.js │ └── test │ │ ├── TESTING.md │ │ ├── access │ │ ├── AccessControl.behavior.js │ │ ├── AccessControl.test.js │ │ ├── Ownable.test.js │ │ ├── Ownable2Step.test.js │ │ ├── extensions │ │ │ ├── AccessControlDefaultAdminRules.test.js │ │ │ └── AccessControlEnumerable.test.js │ │ └── manager │ │ │ ├── AccessManaged.test.js │ │ │ ├── AccessManager.behavior.js │ │ │ ├── AccessManager.test.js │ │ │ └── AuthorityUtils.test.js │ │ ├── finance │ │ ├── VestingWallet.behavior.js │ │ └── VestingWallet.test.js │ │ ├── governance │ │ ├── Governor.t.sol │ │ ├── Governor.test.js │ │ ├── TimelockController.test.js │ │ ├── extensions │ │ │ ├── GovernorERC721.test.js │ │ │ ├── GovernorPreventLateQuorum.test.js │ │ │ ├── GovernorStorage.test.js │ │ │ ├── GovernorTimelockAccess.test.js │ │ │ ├── GovernorTimelockCompound.test.js │ │ │ ├── GovernorTimelockControl.test.js │ │ │ ├── GovernorVotesQuorumFraction.test.js │ │ │ └── GovernorWithParams.test.js │ │ └── utils │ │ │ ├── EIP6372.behavior.js │ │ │ ├── Votes.behavior.js │ │ │ └── Votes.test.js │ │ ├── helpers │ │ ├── access-manager.js │ │ ├── account.js │ │ ├── chainid.js │ │ ├── constants.js │ │ ├── create.js │ │ ├── customError.js │ │ ├── eip712.js │ │ ├── enums.js │ │ ├── erc1967.js │ │ ├── governance.js │ │ ├── iterate.js │ │ ├── math.js │ │ ├── methods.js │ │ ├── sign.js │ │ ├── time.js │ │ └── txpool.js │ │ ├── metatx │ │ ├── ERC2771Context.test.js │ │ ├── ERC2771Forwarder.t.sol │ │ └── ERC2771Forwarder.test.js │ │ ├── proxy │ │ ├── Clones.behaviour.js │ │ ├── Clones.test.js │ │ ├── ERC1967 │ │ │ ├── ERC1967Proxy.test.js │ │ │ └── ERC1967Utils.test.js │ │ ├── Proxy.behaviour.js │ │ ├── beacon │ │ │ ├── BeaconProxy.test.js │ │ │ └── UpgradeableBeacon.test.js │ │ ├── transparent │ │ │ ├── ProxyAdmin.test.js │ │ │ ├── TransparentUpgradeableProxy.behaviour.js │ │ │ └── TransparentUpgradeableProxy.test.js │ │ └── utils │ │ │ ├── Initializable.test.js │ │ │ └── UUPSUpgradeable.test.js │ │ ├── token │ │ ├── ERC1155 │ │ │ ├── ERC1155.behavior.js │ │ │ ├── ERC1155.test.js │ │ │ ├── extensions │ │ │ │ ├── ERC1155Burnable.test.js │ │ │ │ ├── ERC1155Pausable.test.js │ │ │ │ ├── ERC1155Supply.test.js │ │ │ │ └── ERC1155URIStorage.test.js │ │ │ └── utils │ │ │ │ └── ERC1155Holder.test.js │ │ ├── ERC20 │ │ │ ├── ERC20.behavior.js │ │ │ ├── ERC20.test.js │ │ │ ├── extensions │ │ │ │ ├── ERC20Burnable.behavior.js │ │ │ │ ├── ERC20Burnable.test.js │ │ │ │ ├── ERC20Capped.behavior.js │ │ │ │ ├── ERC20Capped.test.js │ │ │ │ ├── ERC20FlashMint.test.js │ │ │ │ ├── ERC20Pausable.test.js │ │ │ │ ├── ERC20Permit.test.js │ │ │ │ ├── ERC20Votes.test.js │ │ │ │ ├── ERC20Wrapper.test.js │ │ │ │ ├── ERC4626.t.sol │ │ │ │ └── ERC4626.test.js │ │ │ └── utils │ │ │ │ └── SafeERC20.test.js │ │ ├── ERC721 │ │ │ ├── ERC721.behavior.js │ │ │ ├── ERC721.test.js │ │ │ ├── ERC721Enumerable.test.js │ │ │ ├── extensions │ │ │ │ ├── ERC721Burnable.test.js │ │ │ │ ├── ERC721Consecutive.t.sol │ │ │ │ ├── ERC721Consecutive.test.js │ │ │ │ ├── ERC721Pausable.test.js │ │ │ │ ├── ERC721Royalty.test.js │ │ │ │ ├── ERC721URIStorage.test.js │ │ │ │ ├── ERC721Votes.test.js │ │ │ │ └── ERC721Wrapper.test.js │ │ │ └── utils │ │ │ │ └── ERC721Holder.test.js │ │ └── common │ │ │ └── ERC2981.behavior.js │ │ └── utils │ │ ├── Address.test.js │ │ ├── Arrays.test.js │ │ ├── Base64.test.js │ │ ├── Context.behavior.js │ │ ├── Context.test.js │ │ ├── Create2.test.js │ │ ├── Multicall.test.js │ │ ├── Nonces.test.js │ │ ├── Pausable.test.js │ │ ├── ReentrancyGuard.test.js │ │ ├── ShortStrings.t.sol │ │ ├── ShortStrings.test.js │ │ ├── StorageSlot.test.js │ │ ├── Strings.test.js │ │ ├── cryptography │ │ ├── ECDSA.test.js │ │ ├── EIP712.test.js │ │ ├── MerkleProof.test.js │ │ ├── MessageHashUtils.test.js │ │ └── SignatureChecker.test.js │ │ ├── introspection │ │ ├── ERC165.test.js │ │ ├── ERC165Checker.test.js │ │ └── SupportsInterface.behavior.js │ │ ├── math │ │ ├── Math.t.sol │ │ ├── Math.test.js │ │ ├── SafeCast.test.js │ │ └── SignedMath.test.js │ │ ├── structs │ │ ├── BitMap.test.js │ │ ├── Checkpoints.t.sol │ │ ├── Checkpoints.test.js │ │ ├── DoubleEndedQueue.test.js │ │ ├── EnumerableMap.behavior.js │ │ ├── EnumerableMap.test.js │ │ ├── EnumerableSet.behavior.js │ │ └── EnumerableSet.test.js │ │ └── types │ │ └── Time.test.js └── permit2 │ ├── .env.example │ ├── .forge-snapshots │ ├── batchTransferFrom.snap │ ├── batchTransferFromMultiToken.snap │ ├── lockdown.snap │ ├── permit2 + transferFrom2 with WETH9's mainnet address.snap │ ├── permit2 + transferFrom2 with a non EIP-2612 native token with fallback.snap │ ├── permit2 + transferFrom2 with a non EIP-2612 native token.snap │ ├── permit2 + transferFrom2 with an EIP-2612 native token.snap │ ├── permitBatchCleanWrite.snap │ ├── permitBatchDirtyWrite.snap │ ├── permitBatchTransferFromMultipleTokens.snap │ ├── permitBatchTransferFromSingleToken.snap │ ├── permitCleanWrite.snap │ ├── permitCompactSig.snap │ ├── permitDirtyNonce.snap │ ├── permitDirtyWrite.snap │ ├── permitInvalidSigner.snap │ ├── permitSetMaxAllowanceCleanWrite.snap │ ├── permitSetMaxAllowanceDirtyWrite.snap │ ├── permitSignatureExpired.snap │ ├── permitTransferFromBatchTypedWitness.snap │ ├── permitTransferFromCompactSig.snap │ ├── permitTransferFromSingleToken.snap │ ├── permitTransferFromTypedWitness.snap │ ├── safePermit + safeTransferFrom with an EIP-2612 native token.snap │ ├── simplePermit2 + transferFrom2 with a non EIP-2612 native token.snap │ ├── single recipient 2 tokens.snap │ ├── single recipient many tokens.snap │ ├── transferFrom with different owners.snap │ └── transferFrom.snap │ ├── .gas-snapshot │ ├── .gitattributes │ ├── .github │ └── workflows │ │ ├── gas.yml │ │ ├── integration-tests.yml │ │ ├── lint.yml │ │ └── unit-tests.yml │ ├── .gitignore │ ├── .gitmodules │ ├── .vscode │ └── settings.json │ ├── LICENSE │ ├── README.md │ ├── audits │ ├── ABDKAudit.pdf │ └── Chainsecurity Audit.pdf │ ├── foundry.toml │ ├── lib │ ├── forge-gas-snapshot │ │ ├── .forge-snapshots │ │ │ ├── add.snap │ │ │ ├── addFirst.snap │ │ │ ├── addSecond.snap │ │ │ ├── manyAdd.snap │ │ │ ├── manySstore.snap │ │ │ ├── snapmanyAdd.snap │ │ │ └── snapmanySstore.snap │ │ ├── .github │ │ │ └── workflows │ │ │ │ └── test.yml │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── README.md │ │ ├── foundry.toml │ │ ├── src │ │ │ ├── GasSnapshot.sol │ │ │ ├── test │ │ │ │ ├── SimpleOperations.sol │ │ │ │ └── SimpleOperationsGas.sol │ │ │ └── utils │ │ │ │ └── UintString.sol │ │ └── test │ │ │ └── GasSnapshot.t.sol │ ├── forge-std │ │ ├── .github │ │ │ └── workflows │ │ │ │ ├── ci.yml │ │ │ │ └── sync.yml │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── LICENSE-APACHE │ │ ├── LICENSE-MIT │ │ ├── README.md │ │ ├── foundry.toml │ │ ├── lib │ │ │ └── ds-test │ │ │ │ ├── .github │ │ │ │ └── workflows │ │ │ │ │ └── build.yml │ │ │ │ ├── .gitignore │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── default.nix │ │ │ │ ├── demo │ │ │ │ └── demo.sol │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ ├── test.sol │ │ │ │ └── test.t.sol │ │ ├── package.json │ │ ├── src │ │ │ ├── Base.sol │ │ │ ├── Script.sol │ │ │ ├── StdAssertions.sol │ │ │ ├── StdChains.sol │ │ │ ├── StdCheats.sol │ │ │ ├── StdError.sol │ │ │ ├── StdInvariant.sol │ │ │ ├── StdJson.sol │ │ │ ├── StdMath.sol │ │ │ ├── StdStorage.sol │ │ │ ├── StdStyle.sol │ │ │ ├── StdUtils.sol │ │ │ ├── Test.sol │ │ │ ├── Vm.sol │ │ │ ├── console.sol │ │ │ ├── console2.sol │ │ │ ├── interfaces │ │ │ │ ├── IERC1155.sol │ │ │ │ ├── IERC165.sol │ │ │ │ ├── IERC20.sol │ │ │ │ ├── IERC4626.sol │ │ │ │ ├── IERC721.sol │ │ │ │ └── IMulticall3.sol │ │ │ └── safeconsole.sol │ │ └── test │ │ │ ├── StdAssertions.t.sol │ │ │ ├── StdChains.t.sol │ │ │ ├── StdCheats.t.sol │ │ │ ├── StdError.t.sol │ │ │ ├── StdMath.t.sol │ │ │ ├── StdStorage.t.sol │ │ │ ├── StdStyle.t.sol │ │ │ ├── StdUtils.t.sol │ │ │ ├── compilation │ │ │ ├── CompilationScript.sol │ │ │ ├── CompilationScriptBase.sol │ │ │ ├── CompilationTest.sol │ │ │ └── CompilationTestBase.sol │ │ │ └── fixtures │ │ │ └── broadcast.log.json │ ├── openzeppelin-contracts │ │ ├── .codecov.yml │ │ ├── .editorconfig │ │ ├── .eslintrc │ │ ├── .gitattributes │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ ├── bug_report.md │ │ │ │ ├── config.yml │ │ │ │ └── feature_request.md │ │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ │ ├── actions │ │ │ │ ├── gas-compare │ │ │ │ │ └── action.yml │ │ │ │ └── setup │ │ │ │ │ └── action.yml │ │ │ └── workflows │ │ │ │ ├── checks.yml │ │ │ │ ├── docs.yml │ │ │ │ └── upgradeable.yml │ │ ├── .gitignore │ │ ├── .mocharc.js │ │ ├── .prettierrc │ │ ├── .solcover.js │ │ ├── .solhint.json │ │ ├── CHANGELOG.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── DOCUMENTATION.md │ │ ├── GUIDELINES.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── RELEASING.md │ │ ├── SECURITY.md │ │ ├── audit │ │ │ ├── 2017-03.md │ │ │ └── 2018-10.pdf │ │ ├── certora │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── applyHarness.patch │ │ │ ├── harnesses │ │ │ │ ├── ERC20VotesHarness.sol │ │ │ │ ├── WizardControlFirstPriority.sol │ │ │ │ └── WizardFirstTry.sol │ │ │ ├── munged │ │ │ │ └── .gitignore │ │ │ ├── scripts │ │ │ │ ├── Governor.sh │ │ │ │ ├── GovernorCountingSimple-counting.sh │ │ │ │ ├── WizardControlFirstPriority.sh │ │ │ │ ├── WizardFirstTry.sh │ │ │ │ ├── sanity.sh │ │ │ │ └── verifyAll.sh │ │ │ └── specs │ │ │ │ ├── GovernorBase.spec │ │ │ │ ├── GovernorCountingSimple.spec │ │ │ │ ├── RulesInProgress.spec │ │ │ │ └── sanity.spec │ │ ├── contracts │ │ │ ├── access │ │ │ │ ├── AccessControl.sol │ │ │ │ ├── AccessControlCrossChain.sol │ │ │ │ ├── AccessControlEnumerable.sol │ │ │ │ ├── IAccessControl.sol │ │ │ │ ├── IAccessControlEnumerable.sol │ │ │ │ ├── Ownable.sol │ │ │ │ └── README.adoc │ │ │ ├── crosschain │ │ │ │ ├── CrossChainEnabled.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── amb │ │ │ │ │ ├── CrossChainEnabledAMB.sol │ │ │ │ │ └── LibAMB.sol │ │ │ │ ├── arbitrum │ │ │ │ │ ├── CrossChainEnabledArbitrumL1.sol │ │ │ │ │ ├── CrossChainEnabledArbitrumL2.sol │ │ │ │ │ ├── LibArbitrumL1.sol │ │ │ │ │ └── LibArbitrumL2.sol │ │ │ │ ├── errors.sol │ │ │ │ ├── optimism │ │ │ │ │ ├── CrossChainEnabledOptimism.sol │ │ │ │ │ └── LibOptimism.sol │ │ │ │ └── polygon │ │ │ │ │ └── CrossChainEnabledPolygonChild.sol │ │ │ ├── finance │ │ │ │ ├── PaymentSplitter.sol │ │ │ │ ├── README.adoc │ │ │ │ └── VestingWallet.sol │ │ │ ├── governance │ │ │ │ ├── Governor.sol │ │ │ │ ├── IGovernor.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── TimelockController.sol │ │ │ │ ├── compatibility │ │ │ │ │ ├── GovernorCompatibilityBravo.sol │ │ │ │ │ └── IGovernorCompatibilityBravo.sol │ │ │ │ ├── extensions │ │ │ │ │ ├── GovernorCountingSimple.sol │ │ │ │ │ ├── GovernorPreventLateQuorum.sol │ │ │ │ │ ├── GovernorProposalThreshold.sol │ │ │ │ │ ├── GovernorSettings.sol │ │ │ │ │ ├── GovernorTimelockCompound.sol │ │ │ │ │ ├── GovernorTimelockControl.sol │ │ │ │ │ ├── GovernorVotes.sol │ │ │ │ │ ├── GovernorVotesComp.sol │ │ │ │ │ ├── GovernorVotesQuorumFraction.sol │ │ │ │ │ └── IGovernorTimelock.sol │ │ │ │ └── utils │ │ │ │ │ ├── IVotes.sol │ │ │ │ │ └── Votes.sol │ │ │ ├── interfaces │ │ │ │ ├── IERC1155.sol │ │ │ │ ├── IERC1155MetadataURI.sol │ │ │ │ ├── IERC1155Receiver.sol │ │ │ │ ├── IERC1271.sol │ │ │ │ ├── IERC1363.sol │ │ │ │ ├── IERC1363Receiver.sol │ │ │ │ ├── IERC1363Spender.sol │ │ │ │ ├── IERC165.sol │ │ │ │ ├── IERC1820Implementer.sol │ │ │ │ ├── IERC1820Registry.sol │ │ │ │ ├── IERC20.sol │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ ├── IERC2981.sol │ │ │ │ ├── IERC3156.sol │ │ │ │ ├── IERC3156FlashBorrower.sol │ │ │ │ ├── IERC3156FlashLender.sol │ │ │ │ ├── IERC4626.sol │ │ │ │ ├── IERC721.sol │ │ │ │ ├── IERC721Enumerable.sol │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ ├── IERC777.sol │ │ │ │ ├── IERC777Recipient.sol │ │ │ │ ├── IERC777Sender.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── draft-IERC1822.sol │ │ │ │ └── draft-IERC2612.sol │ │ │ ├── metatx │ │ │ │ ├── ERC2771Context.sol │ │ │ │ ├── MinimalForwarder.sol │ │ │ │ └── README.adoc │ │ │ ├── mocks │ │ │ │ ├── AccessControlCrossChainMock.sol │ │ │ │ ├── AccessControlEnumerableMock.sol │ │ │ │ ├── AccessControlMock.sol │ │ │ │ ├── AddressImpl.sol │ │ │ │ ├── ArraysImpl.sol │ │ │ │ ├── BadBeacon.sol │ │ │ │ ├── Base64Mock.sol │ │ │ │ ├── BitmapMock.sol │ │ │ │ ├── CallReceiverMock.sol │ │ │ │ ├── CheckpointsImpl.sol │ │ │ │ ├── ClashingImplementation.sol │ │ │ │ ├── ClonesMock.sol │ │ │ │ ├── ConditionalEscrowMock.sol │ │ │ │ ├── ContextMock.sol │ │ │ │ ├── CountersImpl.sol │ │ │ │ ├── Create2Impl.sol │ │ │ │ ├── DoubleEndedQueueMock.sol │ │ │ │ ├── DummyImplementation.sol │ │ │ │ ├── ECDSAMock.sol │ │ │ │ ├── EIP712External.sol │ │ │ │ ├── ERC1155BurnableMock.sol │ │ │ │ ├── ERC1155Mock.sol │ │ │ │ ├── ERC1155PausableMock.sol │ │ │ │ ├── ERC1155ReceiverMock.sol │ │ │ │ ├── ERC1155SupplyMock.sol │ │ │ │ ├── ERC1155URIStorageMock.sol │ │ │ │ ├── ERC1271WalletMock.sol │ │ │ │ ├── ERC165 │ │ │ │ │ ├── ERC165InterfacesSupported.sol │ │ │ │ │ ├── ERC165MaliciousData.sol │ │ │ │ │ ├── ERC165MissingData.sol │ │ │ │ │ └── ERC165NotSupported.sol │ │ │ │ ├── ERC165CheckerMock.sol │ │ │ │ ├── ERC165Mock.sol │ │ │ │ ├── ERC165StorageMock.sol │ │ │ │ ├── ERC1820ImplementerMock.sol │ │ │ │ ├── ERC20BurnableMock.sol │ │ │ │ ├── ERC20CappedMock.sol │ │ │ │ ├── ERC20DecimalsMock.sol │ │ │ │ ├── ERC20FlashMintMock.sol │ │ │ │ ├── ERC20Mock.sol │ │ │ │ ├── ERC20PausableMock.sol │ │ │ │ ├── ERC20PermitMock.sol │ │ │ │ ├── ERC20SnapshotMock.sol │ │ │ │ ├── ERC20VotesCompMock.sol │ │ │ │ ├── ERC20VotesMock.sol │ │ │ │ ├── ERC20WrapperMock.sol │ │ │ │ ├── ERC2771ContextMock.sol │ │ │ │ ├── ERC3156FlashBorrowerMock.sol │ │ │ │ ├── ERC4626Mock.sol │ │ │ │ ├── ERC721BurnableMock.sol │ │ │ │ ├── ERC721EnumerableMock.sol │ │ │ │ ├── ERC721Mock.sol │ │ │ │ ├── ERC721PausableMock.sol │ │ │ │ ├── ERC721ReceiverMock.sol │ │ │ │ ├── ERC721RoyaltyMock.sol │ │ │ │ ├── ERC721URIStorageMock.sol │ │ │ │ ├── ERC721VotesMock.sol │ │ │ │ ├── ERC777Mock.sol │ │ │ │ ├── ERC777SenderRecipientMock.sol │ │ │ │ ├── EnumerableMapMock.sol │ │ │ │ ├── EnumerableSetMock.sol │ │ │ │ ├── EtherReceiverMock.sol │ │ │ │ ├── GovernorCompMock.sol │ │ │ │ ├── GovernorCompatibilityBravoMock.sol │ │ │ │ ├── GovernorMock.sol │ │ │ │ ├── GovernorPreventLateQuorumMock.sol │ │ │ │ ├── GovernorTimelockCompoundMock.sol │ │ │ │ ├── GovernorTimelockControlMock.sol │ │ │ │ ├── GovernorVoteMock.sol │ │ │ │ ├── GovernorWithParamsMock.sol │ │ │ │ ├── InitializableMock.sol │ │ │ │ ├── MathMock.sol │ │ │ │ ├── MerkleProofWrapper.sol │ │ │ │ ├── MulticallTest.sol │ │ │ │ ├── MulticallTokenMock.sol │ │ │ │ ├── MultipleInheritanceInitializableMocks.sol │ │ │ │ ├── OwnableMock.sol │ │ │ │ ├── PausableMock.sol │ │ │ │ ├── PullPaymentMock.sol │ │ │ │ ├── ReentrancyAttack.sol │ │ │ │ ├── ReentrancyMock.sol │ │ │ │ ├── RegressionImplementation.sol │ │ │ │ ├── SafeCastMock.sol │ │ │ │ ├── SafeERC20Helper.sol │ │ │ │ ├── SafeMathMock.sol │ │ │ │ ├── SignatureCheckerMock.sol │ │ │ │ ├── SignedMathMock.sol │ │ │ │ ├── SignedSafeMathMock.sol │ │ │ │ ├── SingleInheritanceInitializableMocks.sol │ │ │ │ ├── StorageSlotMock.sol │ │ │ │ ├── StringsMock.sol │ │ │ │ ├── TimersBlockNumberImpl.sol │ │ │ │ ├── TimersTimestampImpl.sol │ │ │ │ ├── UUPS │ │ │ │ │ ├── UUPSLegacy.sol │ │ │ │ │ └── UUPSUpgradeableMock.sol │ │ │ │ ├── VotesMock.sol │ │ │ │ ├── compound │ │ │ │ │ └── CompTimelock.sol │ │ │ │ ├── crosschain │ │ │ │ │ ├── bridges.sol │ │ │ │ │ └── receivers.sol │ │ │ │ └── wizard │ │ │ │ │ ├── MyGovernor1.sol │ │ │ │ │ ├── MyGovernor2.sol │ │ │ │ │ └── MyGovernor3.sol │ │ │ ├── package.json │ │ │ ├── proxy │ │ │ │ ├── Clones.sol │ │ │ │ ├── ERC1967 │ │ │ │ │ ├── ERC1967Proxy.sol │ │ │ │ │ └── ERC1967Upgrade.sol │ │ │ │ ├── Proxy.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── beacon │ │ │ │ │ ├── BeaconProxy.sol │ │ │ │ │ ├── IBeacon.sol │ │ │ │ │ └── UpgradeableBeacon.sol │ │ │ │ ├── transparent │ │ │ │ │ ├── ProxyAdmin.sol │ │ │ │ │ └── TransparentUpgradeableProxy.sol │ │ │ │ └── utils │ │ │ │ │ ├── Initializable.sol │ │ │ │ │ └── UUPSUpgradeable.sol │ │ │ ├── security │ │ │ │ ├── Pausable.sol │ │ │ │ ├── PullPayment.sol │ │ │ │ ├── README.adoc │ │ │ │ └── ReentrancyGuard.sol │ │ │ ├── token │ │ │ │ ├── ERC1155 │ │ │ │ │ ├── ERC1155.sol │ │ │ │ │ ├── IERC1155.sol │ │ │ │ │ ├── IERC1155Receiver.sol │ │ │ │ │ ├── README.adoc │ │ │ │ │ ├── extensions │ │ │ │ │ │ ├── ERC1155Burnable.sol │ │ │ │ │ │ ├── ERC1155Pausable.sol │ │ │ │ │ │ ├── ERC1155Supply.sol │ │ │ │ │ │ ├── ERC1155URIStorage.sol │ │ │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ │ │ ├── presets │ │ │ │ │ │ ├── ERC1155PresetMinterPauser.sol │ │ │ │ │ │ └── README.md │ │ │ │ │ └── utils │ │ │ │ │ │ ├── ERC1155Holder.sol │ │ │ │ │ │ └── ERC1155Receiver.sol │ │ │ │ ├── ERC20 │ │ │ │ │ ├── ERC20.sol │ │ │ │ │ ├── IERC20.sol │ │ │ │ │ ├── README.adoc │ │ │ │ │ ├── extensions │ │ │ │ │ │ ├── ERC20Burnable.sol │ │ │ │ │ │ ├── ERC20Capped.sol │ │ │ │ │ │ ├── ERC20FlashMint.sol │ │ │ │ │ │ ├── ERC20Pausable.sol │ │ │ │ │ │ ├── ERC20Snapshot.sol │ │ │ │ │ │ ├── ERC20Votes.sol │ │ │ │ │ │ ├── ERC20VotesComp.sol │ │ │ │ │ │ ├── ERC20Wrapper.sol │ │ │ │ │ │ ├── ERC4626.sol │ │ │ │ │ │ ├── IERC20Metadata.sol │ │ │ │ │ │ ├── draft-ERC20Permit.sol │ │ │ │ │ │ └── draft-IERC20Permit.sol │ │ │ │ │ ├── presets │ │ │ │ │ │ ├── ERC20PresetFixedSupply.sol │ │ │ │ │ │ ├── ERC20PresetMinterPauser.sol │ │ │ │ │ │ └── README.md │ │ │ │ │ └── utils │ │ │ │ │ │ ├── SafeERC20.sol │ │ │ │ │ │ └── TokenTimelock.sol │ │ │ │ ├── ERC721 │ │ │ │ │ ├── ERC721.sol │ │ │ │ │ ├── IERC721.sol │ │ │ │ │ ├── IERC721Receiver.sol │ │ │ │ │ ├── README.adoc │ │ │ │ │ ├── extensions │ │ │ │ │ │ ├── ERC721Burnable.sol │ │ │ │ │ │ ├── ERC721Enumerable.sol │ │ │ │ │ │ ├── ERC721Pausable.sol │ │ │ │ │ │ ├── ERC721Royalty.sol │ │ │ │ │ │ ├── ERC721URIStorage.sol │ │ │ │ │ │ ├── IERC721Enumerable.sol │ │ │ │ │ │ ├── IERC721Metadata.sol │ │ │ │ │ │ └── draft-ERC721Votes.sol │ │ │ │ │ ├── presets │ │ │ │ │ │ ├── ERC721PresetMinterPauserAutoId.sol │ │ │ │ │ │ └── README.md │ │ │ │ │ └── utils │ │ │ │ │ │ └── ERC721Holder.sol │ │ │ │ ├── ERC777 │ │ │ │ │ ├── ERC777.sol │ │ │ │ │ ├── IERC777.sol │ │ │ │ │ ├── IERC777Recipient.sol │ │ │ │ │ ├── IERC777Sender.sol │ │ │ │ │ ├── README.adoc │ │ │ │ │ └── presets │ │ │ │ │ │ └── ERC777PresetFixedSupply.sol │ │ │ │ └── common │ │ │ │ │ ├── ERC2981.sol │ │ │ │ │ └── README.adoc │ │ │ ├── utils │ │ │ │ ├── Address.sol │ │ │ │ ├── Arrays.sol │ │ │ │ ├── Base64.sol │ │ │ │ ├── Checkpoints.sol │ │ │ │ ├── Context.sol │ │ │ │ ├── Counters.sol │ │ │ │ ├── Create2.sol │ │ │ │ ├── Multicall.sol │ │ │ │ ├── README.adoc │ │ │ │ ├── StorageSlot.sol │ │ │ │ ├── Strings.sol │ │ │ │ ├── Timers.sol │ │ │ │ ├── cryptography │ │ │ │ │ ├── ECDSA.sol │ │ │ │ │ ├── MerkleProof.sol │ │ │ │ │ ├── SignatureChecker.sol │ │ │ │ │ └── draft-EIP712.sol │ │ │ │ ├── escrow │ │ │ │ │ ├── ConditionalEscrow.sol │ │ │ │ │ ├── Escrow.sol │ │ │ │ │ └── RefundEscrow.sol │ │ │ │ ├── introspection │ │ │ │ │ ├── ERC165.sol │ │ │ │ │ ├── ERC165Checker.sol │ │ │ │ │ ├── ERC165Storage.sol │ │ │ │ │ ├── ERC1820Implementer.sol │ │ │ │ │ ├── IERC165.sol │ │ │ │ │ ├── IERC1820Implementer.sol │ │ │ │ │ └── IERC1820Registry.sol │ │ │ │ ├── math │ │ │ │ │ ├── Math.sol │ │ │ │ │ ├── SafeCast.sol │ │ │ │ │ ├── SafeMath.sol │ │ │ │ │ ├── SignedMath.sol │ │ │ │ │ └── SignedSafeMath.sol │ │ │ │ └── structs │ │ │ │ │ ├── BitMaps.sol │ │ │ │ │ ├── DoubleEndedQueue.sol │ │ │ │ │ ├── EnumerableMap.sol │ │ │ │ │ └── EnumerableSet.sol │ │ │ └── vendor │ │ │ │ ├── amb │ │ │ │ └── IAMB.sol │ │ │ │ ├── arbitrum │ │ │ │ ├── IArbSys.sol │ │ │ │ ├── IBridge.sol │ │ │ │ ├── IInbox.sol │ │ │ │ ├── IMessageProvider.sol │ │ │ │ └── IOutbox.sol │ │ │ │ ├── compound │ │ │ │ ├── ICompoundTimelock.sol │ │ │ │ └── LICENSE │ │ │ │ ├── optimism │ │ │ │ ├── ICrossDomainMessenger.sol │ │ │ │ └── LICENSE │ │ │ │ └── polygon │ │ │ │ └── IFxMessageProcessor.sol │ │ ├── hardhat.config.js │ │ ├── hardhat │ │ │ └── env-contract.js │ │ ├── logo.svg │ │ ├── migrations │ │ │ └── .gitkeep │ │ ├── netlify.toml │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── renovate.json │ │ ├── scripts │ │ │ ├── checks │ │ │ │ ├── compareGasReports.js │ │ │ │ ├── generation.sh │ │ │ │ └── inheritance-ordering.js │ │ │ ├── gen-nav.js │ │ │ ├── generate │ │ │ │ ├── format-lines.js │ │ │ │ ├── run.js │ │ │ │ └── templates │ │ │ │ │ ├── SafeCast.js │ │ │ │ │ └── SafeCastMock.js │ │ │ ├── git-user-config.sh │ │ │ ├── helpers.js │ │ │ ├── migrate-imports.js │ │ │ ├── prepack.sh │ │ │ ├── prepare-contracts-package.sh │ │ │ ├── prepare-docs-solc.js │ │ │ ├── prepare-docs.sh │ │ │ ├── prepare.sh │ │ │ ├── release │ │ │ │ ├── release.sh │ │ │ │ ├── synchronize-versions.js │ │ │ │ ├── update-changelog-release-date.js │ │ │ │ ├── update-comment.js │ │ │ │ └── version.sh │ │ │ ├── remove-ignored-artifacts.js │ │ │ └── update-docs-branch.js │ │ ├── slither.config.json │ │ └── test │ │ │ ├── TESTING.md │ │ │ ├── access │ │ │ ├── AccessControl.behavior.js │ │ │ ├── AccessControl.test.js │ │ │ ├── AccessControlCrossChain.test.js │ │ │ ├── AccessControlEnumerable.test.js │ │ │ └── Ownable.test.js │ │ │ ├── crosschain │ │ │ └── CrossChainEnabled.test.js │ │ │ ├── finance │ │ │ ├── PaymentSplitter.test.js │ │ │ ├── VestingWallet.behavior.js │ │ │ └── VestingWallet.test.js │ │ │ ├── governance │ │ │ ├── Governor.test.js │ │ │ ├── TimelockController.test.js │ │ │ ├── compatibility │ │ │ │ └── GovernorCompatibilityBravo.test.js │ │ │ ├── extensions │ │ │ │ ├── GovernorComp.test.js │ │ │ │ ├── GovernorERC721.test.js │ │ │ │ ├── GovernorPreventLateQuorum.test.js │ │ │ │ ├── GovernorTimelockCompound.test.js │ │ │ │ ├── GovernorTimelockControl.test.js │ │ │ │ ├── GovernorWeightQuorumFraction.test.js │ │ │ │ └── GovernorWithParams.test.js │ │ │ └── utils │ │ │ │ ├── Votes.behavior.js │ │ │ │ └── Votes.test.js │ │ │ ├── helpers │ │ │ ├── create2.js │ │ │ ├── crosschain.js │ │ │ ├── customError.js │ │ │ ├── eip712.js │ │ │ ├── enums.js │ │ │ ├── erc1967.js │ │ │ ├── governance.js │ │ │ ├── sign.js │ │ │ └── txpool.js │ │ │ ├── metatx │ │ │ ├── ERC2771Context.test.js │ │ │ └── MinimalForwarder.test.js │ │ │ ├── migrate-imports.test.js │ │ │ ├── proxy │ │ │ ├── Clones.behaviour.js │ │ │ ├── Clones.test.js │ │ │ ├── ERC1967 │ │ │ │ └── ERC1967Proxy.test.js │ │ │ ├── Proxy.behaviour.js │ │ │ ├── beacon │ │ │ │ ├── BeaconProxy.test.js │ │ │ │ └── UpgradeableBeacon.test.js │ │ │ ├── transparent │ │ │ │ ├── ProxyAdmin.test.js │ │ │ │ ├── TransparentUpgradeableProxy.behaviour.js │ │ │ │ └── TransparentUpgradeableProxy.test.js │ │ │ └── utils │ │ │ │ ├── Initializable.test.js │ │ │ │ └── UUPSUpgradeable.test.js │ │ │ ├── security │ │ │ ├── Pausable.test.js │ │ │ ├── PullPayment.test.js │ │ │ └── ReentrancyGuard.test.js │ │ │ ├── token │ │ │ ├── ERC1155 │ │ │ │ ├── ERC1155.behavior.js │ │ │ │ ├── ERC1155.test.js │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC1155Burnable.test.js │ │ │ │ │ ├── ERC1155Pausable.test.js │ │ │ │ │ ├── ERC1155Supply.test.js │ │ │ │ │ └── ERC1155URIStorage.test.js │ │ │ │ ├── presets │ │ │ │ │ └── ERC1155PresetMinterPauser.test.js │ │ │ │ └── utils │ │ │ │ │ └── ERC1155Holder.test.js │ │ │ ├── ERC20 │ │ │ │ ├── ERC20.behavior.js │ │ │ │ ├── ERC20.test.js │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC20Burnable.behavior.js │ │ │ │ │ ├── ERC20Burnable.test.js │ │ │ │ │ ├── ERC20Capped.behavior.js │ │ │ │ │ ├── ERC20Capped.test.js │ │ │ │ │ ├── ERC20FlashMint.test.js │ │ │ │ │ ├── ERC20Pausable.test.js │ │ │ │ │ ├── ERC20Snapshot.test.js │ │ │ │ │ ├── ERC20Votes.test.js │ │ │ │ │ ├── ERC20VotesComp.test.js │ │ │ │ │ ├── ERC20Wrapper.test.js │ │ │ │ │ ├── ERC4626.test.js │ │ │ │ │ └── draft-ERC20Permit.test.js │ │ │ │ ├── presets │ │ │ │ │ ├── ERC20PresetFixedSupply.test.js │ │ │ │ │ └── ERC20PresetMinterPauser.test.js │ │ │ │ └── utils │ │ │ │ │ ├── SafeERC20.test.js │ │ │ │ │ └── TokenTimelock.test.js │ │ │ ├── ERC721 │ │ │ │ ├── ERC721.behavior.js │ │ │ │ ├── ERC721.test.js │ │ │ │ ├── ERC721Enumerable.test.js │ │ │ │ ├── extensions │ │ │ │ │ ├── ERC721Burnable.test.js │ │ │ │ │ ├── ERC721Pausable.test.js │ │ │ │ │ ├── ERC721Royalty.test.js │ │ │ │ │ ├── ERC721URIStorage.test.js │ │ │ │ │ └── ERC721Votes.test.js │ │ │ │ ├── presets │ │ │ │ │ └── ERC721PresetMinterPauserAutoId.test.js │ │ │ │ └── utils │ │ │ │ │ └── ERC721Holder.test.js │ │ │ ├── ERC777 │ │ │ │ ├── ERC777.behavior.js │ │ │ │ ├── ERC777.test.js │ │ │ │ └── presets │ │ │ │ │ └── ERC777PresetFixedSupply.test.js │ │ │ └── common │ │ │ │ └── ERC2981.behavior.js │ │ │ └── utils │ │ │ ├── Address.test.js │ │ │ ├── Arrays.test.js │ │ │ ├── Base64.test.js │ │ │ ├── Checkpoints.test.js │ │ │ ├── Context.behavior.js │ │ │ ├── Context.test.js │ │ │ ├── Counters.test.js │ │ │ ├── Create2.test.js │ │ │ ├── Multicall.test.js │ │ │ ├── StorageSlot.test.js │ │ │ ├── Strings.test.js │ │ │ ├── TimersBlockNumberImpl.test.js │ │ │ ├── TimersTimestamp.test.js │ │ │ ├── cryptography │ │ │ ├── ECDSA.test.js │ │ │ ├── MerkleProof.test.js │ │ │ ├── SignatureChecker.test.js │ │ │ └── draft-EIP712.test.js │ │ │ ├── escrow │ │ │ ├── ConditionalEscrow.test.js │ │ │ ├── Escrow.behavior.js │ │ │ ├── Escrow.test.js │ │ │ └── RefundEscrow.test.js │ │ │ ├── introspection │ │ │ ├── ERC165.test.js │ │ │ ├── ERC165Checker.test.js │ │ │ ├── ERC165Storage.test.js │ │ │ ├── ERC1820Implementer.test.js │ │ │ └── SupportsInterface.behavior.js │ │ │ ├── math │ │ │ ├── Math.test.js │ │ │ ├── SafeCast.test.js │ │ │ ├── SafeMath.test.js │ │ │ ├── SignedMath.test.js │ │ │ └── SignedSafeMath.test.js │ │ │ └── structs │ │ │ ├── BitMap.test.js │ │ │ ├── DoubleEndedQueue.test.js │ │ │ ├── EnumerableMap.behavior.js │ │ │ ├── EnumerableMap.test.js │ │ │ ├── EnumerableSet.behavior.js │ │ │ └── EnumerableSet.test.js │ └── solmate │ │ ├── .gas-snapshot │ │ ├── .gitattributes │ │ ├── .github │ │ ├── pull_request_template.md │ │ └── workflows │ │ │ └── tests.yml │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── .prettierignore │ │ ├── .prettierrc │ │ ├── .vscode │ │ └── settings.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── audits │ │ └── v6-Fixed-Point-Solutions.pdf │ │ ├── foundry.toml │ │ ├── lib │ │ └── ds-test │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── default.nix │ │ │ ├── demo │ │ │ └── demo.sol │ │ │ └── src │ │ │ └── test.sol │ │ ├── package-lock.json │ │ ├── package.json │ │ └── src │ │ ├── auth │ │ ├── Auth.sol │ │ ├── Owned.sol │ │ └── authorities │ │ │ ├── MultiRolesAuthority.sol │ │ │ └── RolesAuthority.sol │ │ ├── mixins │ │ └── ERC4626.sol │ │ ├── test │ │ ├── Auth.t.sol │ │ ├── Bytes32AddressLib.t.sol │ │ ├── CREATE3.t.sol │ │ ├── DSTestPlus.t.sol │ │ ├── ERC1155.t.sol │ │ ├── ERC20.t.sol │ │ ├── ERC4626.t.sol │ │ ├── ERC721.t.sol │ │ ├── FixedPointMathLib.t.sol │ │ ├── LibString.t.sol │ │ ├── MerkleProofLib.t.sol │ │ ├── MultiRolesAuthority.t.sol │ │ ├── Owned.t.sol │ │ ├── ReentrancyGuard.t.sol │ │ ├── RolesAuthority.t.sol │ │ ├── SSTORE2.t.sol │ │ ├── SafeCastLib.t.sol │ │ ├── SafeTransferLib.t.sol │ │ ├── SignedWadMath.t.sol │ │ ├── WETH.t.sol │ │ └── utils │ │ │ ├── DSInvariantTest.sol │ │ │ ├── DSTestPlus.sol │ │ │ ├── Hevm.sol │ │ │ ├── mocks │ │ │ ├── MockAuthChild.sol │ │ │ ├── MockAuthority.sol │ │ │ ├── MockERC1155.sol │ │ │ ├── MockERC20.sol │ │ │ ├── MockERC4626.sol │ │ │ ├── MockERC721.sol │ │ │ └── MockOwned.sol │ │ │ └── weird-tokens │ │ │ ├── MissingReturnToken.sol │ │ │ ├── ReturnsFalseToken.sol │ │ │ ├── ReturnsGarbageToken.sol │ │ │ ├── ReturnsTooLittleToken.sol │ │ │ ├── ReturnsTooMuchToken.sol │ │ │ ├── ReturnsTwoToken.sol │ │ │ └── RevertingToken.sol │ │ ├── tokens │ │ ├── ERC1155.sol │ │ ├── ERC20.sol │ │ ├── ERC721.sol │ │ └── WETH.sol │ │ └── utils │ │ ├── Bytes32AddressLib.sol │ │ ├── CREATE3.sol │ │ ├── FixedPointMathLib.sol │ │ ├── LibString.sol │ │ ├── MerkleProofLib.sol │ │ ├── ReentrancyGuard.sol │ │ ├── SSTORE2.sol │ │ ├── SafeCastLib.sol │ │ ├── SafeTransferLib.sol │ │ └── SignedWadMath.sol │ ├── package.json │ ├── remappings.txt │ ├── script │ └── DeployPermit2.s.sol │ ├── src │ ├── AllowanceTransfer.sol │ ├── EIP712.sol │ ├── Permit2.sol │ ├── PermitErrors.sol │ ├── SignatureTransfer.sol │ ├── interfaces │ │ ├── IAllowanceTransfer.sol │ │ ├── IDAIPermit.sol │ │ ├── IEIP712.sol │ │ ├── IERC1271.sol │ │ ├── IPermit2.sol │ │ └── ISignatureTransfer.sol │ └── libraries │ │ ├── Allowance.sol │ │ ├── Permit2Lib.sol │ │ ├── PermitHash.sol │ │ ├── SafeCast160.sol │ │ └── SignatureVerification.sol │ └── test │ ├── AllowanceTransferInvariants.t.sol │ ├── AllowanceTransferTest.t.sol │ ├── AllowanceUnitTest.sol │ ├── CompactSignature.t.sol │ ├── EIP712.t.sol │ ├── NonceBitmap.t.sol │ ├── Permit2Lib.t.sol │ ├── SignatureTransfer.t.sol │ ├── TypehashGeneration.t.sol │ ├── actors │ ├── Permitter.sol │ └── Spender.sol │ ├── integration │ ├── Argent.t.sol │ ├── GnosisSafe.t.sol │ ├── MainnetToken.t.sol │ └── tokens │ │ ├── DAI.t.sol │ │ ├── FeeOnTransferToken.t.sol │ │ ├── RebasingToken.t.sol │ │ ├── TooManyReturnBytesToken.t.sol │ │ ├── UNI.t.sol │ │ ├── USDC.t.sol │ │ ├── USDT.t.sol │ │ ├── WBTC.t.sol │ │ └── ZRX.t.sol │ ├── mocks │ ├── MockERC1155.sol │ ├── MockERC20.sol │ ├── MockERC721.sol │ ├── MockFallbackERC20.sol │ ├── MockHash.sol │ ├── MockNonPermitERC20.sol │ ├── MockNonPermitNonERC20WithDS.sol │ ├── MockPermit2.sol │ ├── MockPermit2Lib.sol │ ├── MockPermitWithDS.sol │ └── MockSignatureVerification.sol │ └── utils │ ├── AddressBuilder.sol │ ├── AmountBuilder.sol │ ├── DeployPermit2.sol │ ├── DeployPermit2.t.sol │ ├── PermitSignature.sol │ ├── StructBuilder.sol │ └── TokenProvider.sol ├── script ├── examples │ └── mainnet_upgrade.s.sol ├── local_deploy.s.sol ├── mainnet_deploy.s.sol └── mainnet_deploy_zapper.s.sol ├── src ├── AsyncVault.sol ├── SyncVault.sol ├── VaultZapper.sol └── interfaces │ ├── ERC7540Receiver.sol │ ├── IERC165.sol │ └── IERC7540.sol ├── test ├── Base.t.sol ├── Zapper │ ├── Global.t.sol │ ├── OffChainCalls.t.sol │ ├── VaultZapperManagementImplementations.t.sol │ ├── ZapperDeposit.t.sol │ ├── ZapperDepositAndRequestDep.t.sol │ ├── ZapperDepositPermit.t.sol │ ├── ZapperManagement.t.sol │ ├── ZapperOnlyAllowedRouter.t.sol │ ├── ZapperOnlyAllowedVault.t.sol │ └── getOneInchQuote.js ├── echidna.config.yaml ├── scripts │ └── getOneInchQuote.js ├── testsRules.md ├── unit │ ├── concrete │ │ ├── sol │ │ │ ├── TestClaimAndRequestDeposit.t.sol │ │ │ ├── TestClaimAndRequestRedeem.t.sol │ │ │ ├── TestClaimDeposit.t.sol │ │ │ ├── TestClaimRedeem.t.sol │ │ │ ├── TestClaimableDepositBalanceInAsset.t.sol │ │ │ ├── TestClaimableDepositRequest.t.sol │ │ │ ├── TestClose.t.sol │ │ │ ├── TestDecreaseDepositRequest.t.sol │ │ │ ├── TestDeposit.t.sol │ │ │ ├── TestEpochId.t.sol │ │ │ ├── TestFees.t.sol │ │ │ ├── TestMaxDepositRequest.t.sol │ │ │ ├── TestMaxRedeemRequest.t.sol │ │ │ ├── TestMint.t.sol │ │ │ ├── TestOpen.t.sol │ │ │ ├── TestPendingDepositRequest.t.sol │ │ │ ├── TestPendingRedeemRequest.t.sol │ │ │ ├── TestPreviewClaimDeposit.t.sol │ │ │ ├── TestPreviewClaimRedeem.t.sol │ │ │ ├── TestRedeem.t.sol │ │ │ ├── TestRequestDeposit.t.sol │ │ │ ├── TestRequestDepositPermit.t.sol │ │ │ ├── TestRequestRedeem.t.sol │ │ │ ├── TestSetMaxDrawdown.t.sol │ │ │ ├── TestSettle.t.sol │ │ │ ├── TestSharesBalanceInAsset.t.sol │ │ │ ├── TestTotalClaimableAssets.t.sol │ │ │ ├── TestTotalClaimableShares.t.sol │ │ │ ├── TestTotalPendingDeposits.t.sol │ │ │ ├── TestTotalPendingRedeems.t.sol │ │ │ └── TestWithdraw.t.sol │ │ └── tree │ │ │ ├── TestClaimAndRequestDeposit.tree │ │ │ ├── TestClaimableDepositRequest.tree │ │ │ ├── TestClose.tree │ │ │ ├── TestDeposit.tree │ │ │ ├── TestIsCurrentEpoch.tree │ │ │ ├── TestMaxDepositRequest.tree │ │ │ ├── TestMaxRedeemRequest.tree │ │ │ ├── TestMint.tree │ │ │ ├── TestMintWithPermit.tree │ │ │ ├── TestMintWithPermit2.tree │ │ │ ├── TestOpen.tree │ │ │ ├── TestPendingDepositRequest.tree │ │ │ ├── TestRedeem.tree │ │ │ ├── TestRequestDeposit.tree │ │ │ ├── TestRequestRedeem.tree │ │ │ ├── TestSettle.tree │ │ │ ├── TestSettle.txt │ │ │ ├── TestSharesBalanceInAsset.tree │ │ │ ├── TestTotalPendingDeposits.tree │ │ │ ├── TestTotalPendingRedeems.tree │ │ │ └── TestWithdraw.tree │ └── fuzz │ │ └── TestSettleFuzzed.t.sol └── utils │ ├── Constants.sol │ ├── Events.sol │ ├── SigUtils.sol │ └── assertions │ ├── Assertions.sol │ ├── AssertionsRequest.sol │ └── EventsAssertions.sol └── workflows └── test.yml /.gitignore: -------------------------------------------------------------------------------- 1 | :wq# Compiler files 2 | cache/ 3 | out/ 4 | 5 | # Ignores development broadcast logs 6 | !/broadcast 7 | /broadcast/*/31337/ 8 | /broadcast/**/dry-run/ 9 | broadcast/* 10 | 11 | # Docs 12 | docs/ 13 | 14 | # Dotenv file 15 | .env 16 | 17 | # Node modules 18 | node_modules/ 19 | node_modules 20 | 21 | report/ 22 | lcov.info 23 | 24 | # Mac files 25 | .DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/openzeppelin-contracts"] 5 | path = lib/openzeppelin-contracts 6 | url = https://github.com/OpenZeppelin/openzeppelin-contracts 7 | [submodule "lib/permit2"] 8 | path = lib/permit2 9 | url = https://github.com/Uniswap/permit2 10 | [submodule "lib/ERC-7540-Reference"] 11 | path = lib/ERC-7540-Reference 12 | url = https://github.com/ERC4626-Alliance/ERC-7540-Reference 13 | [submodule "lib/openzeppelin-foundry-upgrades"] 14 | path = lib/openzeppelin-foundry-upgrades 15 | url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades 16 | [submodule "lib/openzeppelin-contracts-upgradeable"] 17 | path = lib/openzeppelin-contracts-upgradeable 18 | url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable 19 | -------------------------------------------------------------------------------- /.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:recommended", 3 | "rules": { 4 | "code-complexity": ["error", 8], 5 | "compiler-version": ["error", ">=0.8.20"], 6 | "func-name-mixedcase": "off", 7 | "func-visibility": ["error", { "ignoreConstructors": true }], 8 | "max-line-length": ["error", 120], 9 | "named-parameters-mapping": "warn", 10 | "no-console": "off", 11 | "not-rely-on-time": "off", 12 | "one-contract-per-file": "off", 13 | "ordering": "warn" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.solhintignore: -------------------------------------------------------------------------------- 1 | nodes_modules/ 2 | test/* 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[toml]": { 3 | "editor.defaultFormatter": "tamasfe.even-better-toml" 4 | }, 5 | "solidity.formatter": "forge", 6 | "solidity.compileUsingRemoteVersion": "v0.8.21" 7 | } 8 | -------------------------------------------------------------------------------- /audits/oxorio-private-audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/audits/oxorio-private-audit.pdf -------------------------------------------------------------------------------- /audits/sherlock_audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/audits/sherlock_audit.pdf -------------------------------------------------------------------------------- /audits/sync_vault_bailsec_final_report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/audits/sync_vault_bailsec_final_report.pdf -------------------------------------------------------------------------------- /audits/sync_vault_salus_final_report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/audits/sync_vault_salus_final_report.pdf -------------------------------------------------------------------------------- /lib/forge-std/.github/workflows/sync.yml: -------------------------------------------------------------------------------- 1 | name: Sync Release Branch 2 | 3 | on: 4 | release: 5 | types: 6 | - created 7 | 8 | jobs: 9 | sync-release-branch: 10 | runs-on: ubuntu-latest 11 | if: startsWith(github.event.release.tag_name, 'v1') 12 | steps: 13 | - name: Check out the repo 14 | uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 17 | ref: v1 18 | 19 | - name: Configure Git 20 | run: | 21 | git config user.name github-actions[bot] 22 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com 23 | 24 | - name: Sync Release Branch 25 | run: | 26 | git fetch --tags 27 | git checkout v1 28 | git reset --hard ${GITHUB_REF} 29 | git push --force 30 | -------------------------------------------------------------------------------- /lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | .vscode 4 | .idea 5 | -------------------------------------------------------------------------------- /lib/forge-std/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/ds-test"] 2 | path = lib/ds-test 3 | url = https://github.com/dapphub/ds-test 4 | -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | /cache/ 5 | -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/Makefile: -------------------------------------------------------------------------------- 1 | all:; dapp build 2 | 3 | test: 4 | -dapp --use solc:0.4.23 build 5 | -dapp --use solc:0.4.26 build 6 | -dapp --use solc:0.5.17 build 7 | -dapp --use solc:0.6.12 build 8 | -dapp --use solc:0.7.5 build 9 | 10 | demo: 11 | DAPP_SRC=demo dapp --use solc:0.7.5 build 12 | -hevm dapp-test --verbose 3 13 | 14 | .PHONY: test demo 15 | -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/default.nix: -------------------------------------------------------------------------------- 1 | { solidityPackage, dappsys }: solidityPackage { 2 | name = "ds-test"; 3 | src = ./src; 4 | } 5 | -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ds-test", 3 | "version": "1.0.0", 4 | "description": "Assertions, equality checks and other test helpers ", 5 | "bugs": "https://github.com/dapphub/ds-test/issues", 6 | "license": "GPL-3.0", 7 | "author": "Contributors to ds-test", 8 | "files": [ 9 | "src/*" 10 | ], 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/dapphub/ds-test.git" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/forge-std/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "forge-std", 3 | "version": "1.7.3", 4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", 5 | "homepage": "https://book.getfoundry.sh/forge/forge-std", 6 | "bugs": "https://github.com/foundry-rs/forge-std/issues", 7 | "license": "(Apache-2.0 OR MIT)", 8 | "author": "Contributors to Forge Standard Library", 9 | "files": [ 10 | "src/**/*" 11 | ], 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/foundry-rs/forge-std.git" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/forge-std/src/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2; 3 | 4 | interface IERC165 { 5 | /// @notice Query if a contract implements an interface 6 | /// @param interfaceID The interface identifier, as specified in ERC-165 7 | /// @dev Interface identification is specified in ERC-165. This function 8 | /// uses less than 30,000 gas. 9 | /// @return `true` if the contract implements `interfaceID` and 10 | /// `interfaceID` is not 0xffffffff, `false` otherwise 11 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 12 | } 13 | -------------------------------------------------------------------------------- /lib/forge-std/test/Vm.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0 <0.9.0; 3 | 4 | import {Test} from "../src/Test.sol"; 5 | import {Vm, VmSafe} from "../src/Vm.sol"; 6 | 7 | contract VmTest is Test { 8 | // This test ensures that functions are never accidentally removed from a Vm interface, or 9 | // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is 10 | // added to or removed from Vm or VmSafe. 11 | function test_interfaceId() public { 12 | assertEq(type(VmSafe).interfaceId, bytes4(0x5e4a68ae), "VmSafe"); 13 | assertEq(type(Vm).interfaceId, bytes4(0x316cedc3), "Vm"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationScript.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScript is Script {} 11 | -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationScriptBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScriptBase is ScriptBase {} 11 | -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTest is Test {} 11 | -------------------------------------------------------------------------------- /lib/forge-std/test/compilation/CompilationTestBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTestBase is TestBase {} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", 3 | "changelog": [ 4 | "@changesets/changelog-github", 5 | { 6 | "repo": "OpenZeppelin/openzeppelin-contracts" 7 | } 8 | ], 9 | "commit": false, 10 | "access": "public", 11 | "baseBranch": "master" 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.codecov.yml: -------------------------------------------------------------------------------- 1 | comment: off 2 | github_checks: 3 | annotations: false 4 | coverage: 5 | status: 6 | patch: 7 | default: 8 | target: 95% 9 | only_pulls: true 10 | project: 11 | default: 12 | threshold: 1% 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = false 12 | max_line_length = 120 13 | 14 | [*.sol] 15 | indent_size = 4 16 | 17 | [*.js] 18 | indent_size = 2 19 | 20 | [*.{adoc,md}] 21 | max_line_length = 0 22 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends" : [ 4 | "eslint:recommended", 5 | "prettier", 6 | ], 7 | "env": { 8 | "es2022": true, 9 | "browser": true, 10 | "node": true, 11 | "mocha": true, 12 | }, 13 | "globals" : { 14 | "artifacts": "readonly", 15 | "contract": "readonly", 16 | "web3": "readonly", 17 | "extendEnvironment": "readonly", 18 | "expect": "readonly", 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions & Support Requests 3 | url: https://forum.openzeppelin.com/c/support/contracts/18 4 | about: Ask in the OpenZeppelin Forum 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for OpenZeppelin Contracts 4 | 5 | --- 6 | 7 | **🧐 Motivation** 8 | 9 | 10 | **📝 Details** 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Fixes #???? 7 | 8 | 9 | 10 | 11 | 12 | #### PR Checklist 13 | 14 | 15 | 16 | 17 | 18 | - [ ] Tests 19 | - [ ] Documentation 20 | - [ ] Changeset entry (run `npx changeset add`) 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/actions/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: Setup 2 | 3 | runs: 4 | using: composite 5 | steps: 6 | - uses: actions/setup-node@v3 7 | with: 8 | node-version: 16.x 9 | - uses: actions/cache@v3 10 | id: cache 11 | with: 12 | path: '**/node_modules' 13 | key: npm-v3-${{ hashFiles('**/package-lock.json') }} 14 | - name: Install dependencies 15 | run: npm ci 16 | shell: bash 17 | if: steps.cache.outputs.cache-hit != 'true' 18 | - name: Install Foundry 19 | uses: foundry-rs/foundry-toolchain@v1 20 | with: 21 | version: nightly 22 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/workflows/actionlint.yml: -------------------------------------------------------------------------------- 1 | name: lint workflows 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - '.github/**/*.ya?ml' 7 | 8 | jobs: 9 | lint: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Add problem matchers 14 | run: | 15 | # https://github.com/rhysd/actionlint/blob/3a2f2c7/docs/usage.md#problem-matchers 16 | curl -LO https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json 17 | echo "::add-matcher::actionlint-matcher.json" 18 | - uses: docker://rhysd/actionlint:latest 19 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/workflows/changeset.yml: -------------------------------------------------------------------------------- 1 | name: changeset 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | types: 8 | - opened 9 | - synchronize 10 | - labeled 11 | - unlabeled 12 | 13 | concurrency: 14 | group: changeset-${{ github.ref }} 15 | cancel-in-progress: true 16 | 17 | jobs: 18 | check: 19 | runs-on: ubuntu-latest 20 | if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }} 21 | steps: 22 | - uses: actions/checkout@v4 23 | with: 24 | fetch-depth: 0 # Include history so Changesets finds merge-base 25 | - name: Set up environment 26 | uses: ./.github/actions/setup 27 | - name: Check changeset 28 | run: npx changeset status --since=origin/${{ github.base_ref }} 29 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Build Docs 2 | 3 | on: 4 | push: 5 | branches: [release-v*] 6 | 7 | permissions: 8 | contents: write 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: Set up environment 16 | uses: ./.github/actions/setup 17 | - run: bash scripts/git-user-config.sh 18 | - run: node scripts/update-docs-branch.js 19 | - run: git push --all origin 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | branch = v1 3 | path = lib/forge-std 4 | url = https://github.com/foundry-rs/forge-std 5 | [submodule "lib/erc4626-tests"] 6 | path = lib/erc4626-tests 7 | url = https://github.com/a16z/erc4626-tests.git 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.mocharc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | require: 'hardhat/register', 3 | timeout: 4000, 4 | }; 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "singleQuote": true, 4 | "trailingComma": "all", 5 | "arrowParens": "avoid", 6 | "overrides": [ 7 | { 8 | "files": "*.sol", 9 | "options": { 10 | "singleQuote": false 11 | } 12 | } 13 | ], 14 | "plugins": ["prettier-plugin-solidity"] 15 | } 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | norpc: true, 3 | testCommand: 'npm test', 4 | compileCommand: 'npm run compile', 5 | skipFiles: ['mocks'], 6 | providerOptions: { 7 | default_balance_ether: '10000000000000000000000000', 8 | }, 9 | mocha: { 10 | fgrep: '[skip-on-coverage]', 11 | invert: true, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/audits/2018-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/audits/2018-10.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/audits/2022-10-Checkpoints.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/audits/2022-10-Checkpoints.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/audits/2022-10-ERC4626.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/audits/2022-10-ERC4626.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/audits/2023-05-v4.9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/audits/2023-05-v4.9.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/audits/2023-10-v5.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/audits/2023-10-v5.0.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/.gitignore: -------------------------------------------------------------------------------- 1 | patched 2 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/AccessControlHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {AccessControl} from "../patched/access/AccessControl.sol"; 5 | 6 | contract AccessControlHarness is AccessControl {} 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/ERC20PermitHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {ERC20Permit, ERC20} from "../patched/token/ERC20/extensions/ERC20Permit.sol"; 5 | 6 | contract ERC20PermitHarness is ERC20Permit { 7 | constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/ERC3156FlashBorrowerHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | import {IERC3156FlashBorrower} from "../patched/interfaces/IERC3156FlashBorrower.sol"; 4 | 5 | pragma solidity ^0.8.20; 6 | 7 | contract ERC3156FlashBorrowerHarness is IERC3156FlashBorrower { 8 | bytes32 somethingToReturn; 9 | 10 | function onFlashLoan(address, address, uint256, uint256, bytes calldata) external view override returns (bytes32) { 11 | return somethingToReturn; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/ERC721ReceiverHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import "../patched/interfaces/IERC721Receiver.sol"; 6 | 7 | contract ERC721ReceiverHarness is IERC721Receiver { 8 | function onERC721Received(address, address, uint256, bytes calldata) external pure returns (bytes4) { 9 | return this.onERC721Received.selector; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/Ownable2StepHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {Ownable2Step, Ownable} from "../patched/access/Ownable2Step.sol"; 5 | 6 | contract Ownable2StepHarness is Ownable2Step { 7 | constructor(address initialOwner) Ownable(initialOwner) {} 8 | 9 | function restricted() external onlyOwner {} 10 | } 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/OwnableHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {Ownable} from "../patched/access/Ownable.sol"; 5 | 6 | contract OwnableHarness is Ownable { 7 | constructor(address initialOwner) Ownable(initialOwner) {} 8 | 9 | function restricted() external onlyOwner {} 10 | } 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/PausableHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {Pausable} from "../patched/utils/Pausable.sol"; 5 | 6 | contract PausableHarness is Pausable { 7 | function pause() external { 8 | _pause(); 9 | } 10 | 11 | function unpause() external { 12 | _unpause(); 13 | } 14 | 15 | function onlyWhenPaused() external whenPaused {} 16 | 17 | function onlyWhenNotPaused() external whenNotPaused {} 18 | } 19 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/harnesses/TimelockControllerHarness.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {TimelockController} from "../patched/governance/TimelockController.sol"; 5 | 6 | contract TimelockControllerHarness is TimelockController { 7 | constructor( 8 | uint256 minDelay, 9 | address[] memory proposers, 10 | address[] memory executors, 11 | address admin 12 | ) TimelockController(minDelay, proposers, executors, admin) {} 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/reports/2021-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/certora/reports/2021-10.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/reports/2022-03.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/certora/reports/2022-03.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/reports/2022-05.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/openzeppelin-contracts/certora/reports/2022-05.pdf -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/helpers/helpers.spec: -------------------------------------------------------------------------------- 1 | // environment 2 | definition nonpayable(env e) returns bool = e.msg.value == 0; 3 | definition nonzerosender(env e) returns bool = e.msg.sender != 0; 4 | 5 | // math 6 | definition min(mathint a, mathint b) returns mathint = a < b ? a : b; 7 | definition max(mathint a, mathint b) returns mathint = a > b ? a : b; 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IAccessControl.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function DEFAULT_ADMIN_ROLE() external returns (bytes32) envfree; 3 | function hasRole(bytes32, address) external returns(bool) envfree; 4 | function getRoleAdmin(bytes32) external returns(bytes32) envfree; 5 | function grantRole(bytes32, address) external; 6 | function revokeRole(bytes32, address) external; 7 | function renounceRole(bytes32, address) external; 8 | } 9 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IERC20.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function name() external returns (string) envfree; 3 | function symbol() external returns (string) envfree; 4 | function decimals() external returns (uint8) envfree; 5 | function totalSupply() external returns (uint256) envfree; 6 | function balanceOf(address) external returns (uint256) envfree; 7 | function allowance(address,address) external returns (uint256) envfree; 8 | function approve(address,uint256) external returns (bool); 9 | function transfer(address,uint256) external returns (bool); 10 | function transferFrom(address,address,uint256) external returns (bool); 11 | } 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IERC2612.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function permit(address,address,uint256,uint256,uint8,bytes32,bytes32) external; 3 | function nonces(address) external returns (uint256) envfree; 4 | function DOMAIN_SEPARATOR() external returns (bytes32) envfree; 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IERC3156FlashBorrower.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function _.onFlashLoan(address,address,uint256,uint256,bytes) external => DISPATCHER(true); 3 | } 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IERC3156FlashLender.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function maxFlashLoan(address) external returns (uint256) envfree; 3 | function flashFee(address,uint256) external returns (uint256) envfree; 4 | function flashLoan(address,address,uint256,bytes) external returns (bool); 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IERC5313.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function owner() external returns (address) envfree; 3 | } 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IERC721Receiver.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function _.onERC721Received(address,address,uint256,bytes) external => DISPATCHER(true); 3 | } 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IOwnable.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function owner() external returns (address) envfree; 3 | function transferOwnership(address) external; 4 | function renounceOwnership() external; 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/specs/methods/IOwnable2Step.spec: -------------------------------------------------------------------------------- 1 | methods { 2 | function owner() external returns (address) envfree; 3 | function pendingOwner() external returns (address) envfree; 4 | function transferOwnership(address) external; 5 | function acceptOwnership() external; 6 | function renounceOwnership() external; 7 | } 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/access/manager/IAuthority.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | /** 7 | * @dev Standard interface for permissioning originally defined in Dappsys. 8 | */ 9 | interface IAuthority { 10 | /** 11 | * @dev Returns true if the caller can invoke on a target the function identified by a function selector. 12 | */ 13 | function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed); 14 | } 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/finance/README.adoc: -------------------------------------------------------------------------------- 1 | = Finance 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/finance 5 | 6 | This directory includes primitives for financial systems: 7 | 8 | - {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can 9 | be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting 10 | schedule. 11 | 12 | == Contracts 13 | 14 | {{VestingWallet}} 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1155.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC1155} from "../token/ERC1155/IERC1155.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC1155MetadataURI} from "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC1155Receiver} from "../token/ERC1155/IERC1155Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | /** 7 | * @dev Interface of the ERC1271 standard signature validation method for 8 | * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. 9 | */ 10 | interface IERC1271 { 11 | /** 12 | * @dev Should return whether the signature provided is valid for the provided data 13 | * @param hash Hash of the data to be signed 14 | * @param signature Signature byte array associated with _data 15 | */ 16 | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC165} from "../utils/introspection/IERC165.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | /** 7 | * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. 8 | */ 9 | interface IERC1967 { 10 | /** 11 | * @dev Emitted when the implementation is upgraded. 12 | */ 13 | event Upgraded(address indexed implementation); 14 | 15 | /** 16 | * @dev Emitted when the admin account has changed. 17 | */ 18 | event AdminChanged(address previousAdmin, address newAdmin); 19 | 20 | /** 21 | * @dev Emitted when the beacon is changed. 22 | */ 23 | event BeaconUpgraded(address indexed beacon); 24 | } 25 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC20} from "../token/ERC20/IERC20.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC2309.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2309.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | /** 7 | * @dev ERC-2309: ERC-721 Consecutive Transfer Extension. 8 | */ 9 | interface IERC2309 { 10 | /** 11 | * @dev Emitted when the tokens from `fromTokenId` to `toTokenId` are transferred from `fromAddress` to `toAddress`. 12 | */ 13 | event ConsecutiveTransfer( 14 | uint256 indexed fromTokenId, 15 | uint256 toTokenId, 16 | address indexed fromAddress, 17 | address indexed toAddress 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2612.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC20Permit} from "../token/ERC20/extensions/IERC20Permit.sol"; 7 | 8 | interface IERC2612 is IERC20Permit {} 9 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC3156.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol"; 7 | import {IERC3156FlashLender} from "./IERC3156FlashLender.sol"; 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5313.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | /** 7 | * @dev Interface for the Light Contract Ownership Standard. 8 | * 9 | * A standardized minimal interface required to identify an account that controls a contract 10 | */ 11 | interface IERC5313 { 12 | /** 13 | * @dev Gets the address of the owner. 14 | */ 15 | function owner() external view returns (address); 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC5805.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IVotes} from "../governance/utils/IVotes.sol"; 7 | import {IERC6372} from "./IERC6372.sol"; 8 | 9 | interface IERC5805 is IERC6372, IVotes {} 10 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC6372.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | interface IERC6372 { 7 | /** 8 | * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting). 9 | */ 10 | function clock() external view returns (uint48); 11 | 12 | /** 13 | * @dev Description of the clock 14 | */ 15 | // solhint-disable-next-line func-name-mixedcase 16 | function CLOCK_MODE() external view returns (string memory); 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC721} from "../token/ERC721/IERC721.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721Enumerable.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC721Enumerable} from "../token/ERC721/extensions/IERC721Enumerable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC721Metadata} from "../token/ERC721/extensions/IERC721Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721Receiver.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/metatx/README.adoc: -------------------------------------------------------------------------------- 1 | = Meta Transactions 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx 5 | 6 | == Core 7 | 8 | {{ERC2771Context}} 9 | 10 | == Utils 11 | 12 | {{ERC2771Forwarder}} 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/EIP712Verifier.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ECDSA} from "../utils/cryptography/ECDSA.sol"; 6 | import {EIP712} from "../utils/cryptography/EIP712.sol"; 7 | 8 | abstract contract EIP712Verifier is EIP712 { 9 | function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view { 10 | bytes32 digest = _hashTypedDataV4( 11 | keccak256(abi.encode(keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents)))) 12 | ); 13 | address recoveredSigner = ECDSA.recover(digest, signature); 14 | require(recoveredSigner == signer); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MaliciousData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | contract ERC165MaliciousData { 6 | function supportsInterface(bytes4) public pure returns (bool) { 7 | assembly { 8 | mstore(0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) 9 | return(0, 32) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MissingData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | contract ERC165MissingData { 6 | function supportsInterface(bytes4 interfaceId) public view {} // missing return 7 | } 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165NotSupported.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | contract ERC165NotSupported {} 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165ReturnBomb.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {IERC165} from "../../utils/introspection/IERC165.sol"; 6 | 7 | contract ERC165ReturnBombMock is IERC165 { 8 | function supportsInterface(bytes4 interfaceId) public pure override returns (bool) { 9 | if (interfaceId == type(IERC165).interfaceId) { 10 | assembly { 11 | mstore(0, 1) 12 | } 13 | } 14 | assembly { 15 | return(0, 101500) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | contract EtherReceiverMock { 6 | bool private _acceptEther; 7 | 8 | function setAcceptEther(bool acceptEther) public { 9 | _acceptEther = acceptEther; 10 | } 11 | 12 | receive() external payable { 13 | if (!_acceptEther) { 14 | revert(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {Pausable} from "../utils/Pausable.sol"; 6 | 7 | contract PausableMock is Pausable { 8 | bool public drasticMeasureTaken; 9 | uint256 public count; 10 | 11 | constructor() { 12 | drasticMeasureTaken = false; 13 | count = 0; 14 | } 15 | 16 | function normalProcess() external whenNotPaused { 17 | count++; 18 | } 19 | 20 | function drasticMeasure() external whenPaused { 21 | drasticMeasureTaken = true; 22 | } 23 | 24 | function pause() external { 25 | _pause(); 26 | } 27 | 28 | function unpause() external { 29 | _unpause(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {Context} from "../utils/Context.sol"; 6 | 7 | contract ReentrancyAttack is Context { 8 | function callSender(bytes calldata data) public { 9 | (bool success, ) = _msgSender().call(data); 10 | require(success, "ReentrancyAttack: failed call"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {Address} from "../utils/Address.sol"; 5 | 6 | contract TimelockReentrant { 7 | address private _reenterTarget; 8 | bytes private _reenterData; 9 | bool _reentered; 10 | 11 | function disableReentrancy() external { 12 | _reentered = true; 13 | } 14 | 15 | function enableRentrancy(address target, bytes calldata data) external { 16 | _reenterTarget = target; 17 | _reenterData = data; 18 | } 19 | 20 | function reenter() external { 21 | if (!_reentered) { 22 | _reentered = true; 23 | Address.functionCall(_reenterTarget, _reenterData); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/governance/GovernorMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {Governor} from "../../governance/Governor.sol"; 6 | import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol"; 7 | import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol"; 8 | import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol"; 9 | 10 | abstract contract GovernorMock is GovernorSettings, GovernorVotesQuorumFraction, GovernorCountingSimple { 11 | function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) { 12 | return super.proposalThreshold(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVoteMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol"; 6 | import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol"; 7 | 8 | abstract contract GovernorVoteMocks is GovernorVotes, GovernorCountingSimple { 9 | function quorum(uint256) public pure override returns (uint256) { 10 | return 0; 11 | } 12 | 13 | function votingDelay() public pure override returns (uint256) { 14 | return 4; 15 | } 16 | 17 | function votingPeriod() public pure override returns (uint256) { 18 | return 16; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/proxy/BadBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | contract BadBeaconNoImpl {} 6 | 7 | contract BadBeaconNotContract { 8 | function implementation() external pure returns (address) { 9 | return address(0x1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/proxy/ClashingImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | /** 6 | * @dev Implementation contract with a payable changeAdmin(address) function made to clash with 7 | * TransparentUpgradeableProxy's to test correct functioning of the Transparent Proxy feature. 8 | */ 9 | contract ClashingImplementation { 10 | event ClashingImplementationCall(); 11 | 12 | function upgradeToAndCall(address, bytes calldata) external payable { 13 | emit ClashingImplementationCall(); 14 | } 15 | 16 | function delegatedFunction() external pure returns (bool) { 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20ApprovalMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {ERC20} from "../../token/ERC20/ERC20.sol"; 5 | 6 | abstract contract ERC20ApprovalMock is ERC20 { 7 | function _approve(address owner, address spender, uint256 amount, bool) internal virtual override { 8 | super._approve(owner, spender, amount, true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20DecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC20} from "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20DecimalsMock is ERC20 { 8 | uint8 private immutable _decimals; 9 | 10 | constructor(uint8 decimals_) { 11 | _decimals = decimals_; 12 | } 13 | 14 | function decimals() public view override returns (uint8) { 15 | return _decimals; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20ExcessDecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | contract ERC20ExcessDecimalsMock { 6 | function decimals() public pure returns (uint256) { 7 | return type(uint256).max; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20ForceApproveMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC20} from "../../token/ERC20/ERC20.sol"; 6 | 7 | // contract that replicate USDT (0xdac17f958d2ee523a2206206994597c13d831ec7) approval behavior 8 | abstract contract ERC20ForceApproveMock is ERC20 { 9 | function approve(address spender, uint256 amount) public virtual override returns (bool) { 10 | require(amount == 0 || allowance(msg.sender, spender) == 0, "USDT approval failure"); 11 | return super.approve(spender, amount); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {ERC20} from "../../token/ERC20/ERC20.sol"; 5 | 6 | contract ERC20Mock is ERC20 { 7 | constructor() ERC20("ERC20Mock", "E20M") {} 8 | 9 | function mint(address account, uint256 amount) external { 10 | _mint(account, amount); 11 | } 12 | 13 | function burn(address account, uint256 amount) external { 14 | _burn(account, amount); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20MulticallMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC20} from "../../token/ERC20/ERC20.sol"; 6 | import {Multicall} from "../../utils/Multicall.sol"; 7 | 8 | abstract contract ERC20MulticallMock is ERC20, Multicall {} 9 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC20ReturnFalseMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC20} from "../../token/ERC20/ERC20.sol"; 6 | 7 | abstract contract ERC20ReturnFalseMock is ERC20 { 8 | function transfer(address, uint256) public pure override returns (bool) { 9 | return false; 10 | } 11 | 12 | function transferFrom(address, address, uint256) public pure override returns (bool) { 13 | return false; 14 | } 15 | 16 | function approve(address, uint256) public pure override returns (bool) { 17 | return false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC4626LimitsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | abstract contract ERC4626LimitsMock is ERC4626 { 8 | uint256 _maxDeposit; 9 | uint256 _maxMint; 10 | 11 | constructor() { 12 | _maxDeposit = 100 ether; 13 | _maxMint = 100 ether; 14 | } 15 | 16 | function maxDeposit(address) public view override returns (uint256) { 17 | return _maxDeposit; 18 | } 19 | 20 | function maxMint(address) public view override returns (uint256) { 21 | return _maxMint; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC4626Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import {IERC20, ERC20} from "../../token/ERC20/ERC20.sol"; 5 | import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | contract ERC4626Mock is ERC4626 { 8 | constructor(address underlying) ERC20("ERC4626Mock", "E4626M") ERC4626(IERC20(underlying)) {} 9 | 10 | function mint(address account, uint256 amount) external { 11 | _mint(account, amount); 12 | } 13 | 14 | function burn(address account, uint256 amount) external { 15 | _burn(account, amount); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC4626OffsetMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC4626} from "../../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | abstract contract ERC4626OffsetMock is ERC4626 { 8 | uint8 private immutable _offset; 9 | 10 | constructor(uint8 offset_) { 11 | _offset = offset_; 12 | } 13 | 14 | function _decimalsOffset() internal view virtual override returns (uint8) { 15 | return _offset; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/token/ERC721URIStorageMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import {ERC721URIStorage} from "../../token/ERC721/extensions/ERC721URIStorage.sol"; 6 | 7 | abstract contract ERC721URIStorageMock is ERC721URIStorage { 8 | string private _baseTokenURI; 9 | 10 | function _baseURI() internal view virtual override returns (string memory) { 11 | return _baseTokenURI; 12 | } 13 | 14 | function setBaseURI(string calldata newBaseTokenURI) public { 15 | _baseTokenURI = newBaseTokenURI; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | /** 7 | * @dev This is the interface that {BeaconProxy} expects of its beacon. 8 | */ 9 | interface IBeacon { 10 | /** 11 | * @dev Must return an address that can be used as a delegate call target. 12 | * 13 | * {UpgradeableBeacon} will check that this address is a contract. 14 | */ 15 | function implementation() external view returns (address); 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC1155} from "../IERC1155.sol"; 7 | 8 | /** 9 | * @dev Interface of the optional ERC1155MetadataExtension interface, as defined 10 | * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. 11 | */ 12 | interface IERC1155MetadataURI is IERC1155 { 13 | /** 14 | * @dev Returns the URI for token type `id`. 15 | * 16 | * If the `\{id\}` substring is present in the URI, it must be replaced by 17 | * clients with the actual token type ID. 18 | */ 19 | function uri(uint256 id) external view returns (string memory); 20 | } 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.20; 5 | 6 | import {IERC20} from "../IERC20.sol"; 7 | 8 | /** 9 | * @dev Interface for the optional metadata functions from the ERC20 standard. 10 | */ 11 | interface IERC20Metadata is IERC20 { 12 | /** 13 | * @dev Returns the name of the token. 14 | */ 15 | function name() external view returns (string memory); 16 | 17 | /** 18 | * @dev Returns the symbol of the token. 19 | */ 20 | function symbol() external view returns (string memory); 21 | 22 | /** 23 | * @dev Returns the decimals places of the token. 24 | */ 25 | function decimals() external view returns (uint8); 26 | } 27 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/token/common/README.adoc: -------------------------------------------------------------------------------- 1 | = Common (Tokens) 2 | 3 | Functionality that is common to multiple token standards. 4 | 5 | * {ERC2981}: NFT Royalties compatible with both ERC721 and ERC1155. 6 | ** For ERC721 consider {ERC721Royalty} which clears the royalty information from storage on burn. 7 | 8 | == Contracts 9 | 10 | {{ERC2981}} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'out' 4 | libs = ['node_modules', 'lib'] 5 | test = 'test' 6 | cache_path = 'cache_forge' 7 | 8 | [fuzz] 9 | runs = 10000 10 | max_test_rejects = 150000 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/hardhat/skip-foundry-tests.js: -------------------------------------------------------------------------------- 1 | const { subtask } = require('hardhat/config'); 2 | const { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } = require('hardhat/builtin-tasks/task-names'); 3 | 4 | subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => 5 | (await runSuper()).filter(path => !path.endsWith('.t.sol')), 6 | ); 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | .vscode 4 | .idea 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/ds-test"] 2 | path = lib/ds-test 3 | url = https://github.com/dapphub/ds-test 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/Makefile: -------------------------------------------------------------------------------- 1 | all:; dapp build 2 | 3 | test: 4 | -dapp --use solc:0.4.23 build 5 | -dapp --use solc:0.4.26 build 6 | -dapp --use solc:0.5.17 build 7 | -dapp --use solc:0.6.12 build 8 | -dapp --use solc:0.7.5 build 9 | 10 | demo: 11 | DAPP_SRC=demo dapp --use solc:0.7.5 build 12 | -hevm dapp-test --verbose 3 13 | 14 | .PHONY: test demo 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/default.nix: -------------------------------------------------------------------------------- 1 | { solidityPackage, dappsys }: solidityPackage { 2 | name = "ds-test"; 3 | src = ./src; 4 | } 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ds-test", 3 | "version": "1.0.0", 4 | "description": "Assertions, equality checks and other test helpers ", 5 | "bugs": "https://github.com/dapphub/ds-test/issues", 6 | "license": "GPL-3.0", 7 | "author": "Contributors to ds-test", 8 | "files": [ 9 | "src/*" 10 | ], 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/dapphub/ds-test.git" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "forge-std", 3 | "version": "1.2.0", 4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", 5 | "homepage": "https://book.getfoundry.sh/forge/forge-std", 6 | "bugs": "https://github.com/foundry-rs/forge-std/issues", 7 | "license": "(Apache-2.0 OR MIT)", 8 | "author": "Contributors to Forge Standard Library", 9 | "files": [ 10 | "src/*" 11 | ], 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/foundry-rs/forge-std.git" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2; 3 | 4 | interface IERC165 { 5 | /// @notice Query if a contract implements an interface 6 | /// @param interfaceID The interface identifier, as specified in ERC-165 7 | /// @dev Interface identification is specified in ERC-165. This function 8 | /// uses less than 30,000 gas. 9 | /// @return `true` if the contract implements `interfaceID` and 10 | /// `interfaceID` is not 0xffffffff, `false` otherwise 11 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationScript.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScript is Script {} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationScriptBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScriptBase is ScriptBase {} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTest is Test {} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationTestBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTestBase is TestBase {} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run docs" 3 | publish = "build/site" 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/remappings.txt: -------------------------------------------------------------------------------- 1 | @openzeppelin/contracts/=contracts/ 2 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["github>OpenZeppelin/configs"], 3 | "labels": ["ignore-changeset"] 4 | } 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/requirements.txt: -------------------------------------------------------------------------------- 1 | certora-cli==4.8.0 2 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/checks/compare-layout.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const { getStorageUpgradeReport } = require('@openzeppelin/upgrades-core/dist/storage'); 3 | 4 | const { ref, head } = require('yargs').argv; 5 | 6 | const oldLayout = JSON.parse(fs.readFileSync(ref)); 7 | const newLayout = JSON.parse(fs.readFileSync(head)); 8 | 9 | for (const name in oldLayout) { 10 | if (name in newLayout) { 11 | const report = getStorageUpgradeReport(oldLayout[name], newLayout[name], {}); 12 | if (!report.ok) { 13 | console.log(`Storage layout incompatilibity found in ${name}:`); 14 | console.log(report.explain()); 15 | process.exitCode = 1; 16 | } 17 | } else { 18 | console.log(`WARNING: ${name} is missing from the current branch`); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/checks/generation.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | npm run generate 6 | git diff -R --exit-code 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/generate/format-lines.js: -------------------------------------------------------------------------------- 1 | function formatLines(...lines) { 2 | return [...indentEach(0, lines)].join('\n') + '\n'; 3 | } 4 | 5 | function* indentEach(indent, lines) { 6 | for (const line of lines) { 7 | if (Array.isArray(line)) { 8 | yield* indentEach(indent + 1, line); 9 | } else { 10 | const padding = ' '.repeat(indent); 11 | yield* line.split('\n').map(subline => (subline === '' ? '' : padding + subline)); 12 | } 13 | } 14 | } 15 | 16 | module.exports = formatLines; 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.opts.js: -------------------------------------------------------------------------------- 1 | // OPTIONS 2 | const VALUE_SIZES = [224, 208, 160]; 3 | 4 | const defaultOpts = size => ({ 5 | historyTypeName: `Trace${size}`, 6 | checkpointTypeName: `Checkpoint${size}`, 7 | checkpointFieldName: '_checkpoints', 8 | keyTypeName: `uint${256 - size}`, 9 | keyFieldName: '_key', 10 | valueTypeName: `uint${size}`, 11 | valueFieldName: '_value', 12 | }); 13 | 14 | module.exports = { 15 | VALUE_SIZES, 16 | OPTS: VALUE_SIZES.map(size => defaultOpts(size)), 17 | }; 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/git-user-config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail -x 4 | 5 | git config user.name 'github-actions' 6 | git config user.email '41898282+github-actions[bot]@users.noreply.github.com' 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/prepack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | shopt -s globstar 5 | 6 | # cross platform `mkdir -p` 7 | mkdirp() { 8 | node -e "fs.mkdirSync('$1', { recursive: true })" 9 | } 10 | 11 | # cd to the root of the repo 12 | cd "$(git rev-parse --show-toplevel)" 13 | 14 | npm run clean 15 | 16 | env COMPILE_MODE=production npm run compile 17 | 18 | mkdirp contracts/build/contracts 19 | cp artifacts/contracts/**/*.json contracts/build/contracts 20 | rm contracts/build/contracts/*.dbg.json 21 | node scripts/remove-ignored-artifacts.js 22 | 23 | cp README.md contracts/ 24 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/prepare-docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | shopt -s globstar 5 | 6 | OUTDIR="$(node -p 'require("./docs/config.js").outputDir')" 7 | 8 | if [ ! -d node_modules ]; then 9 | npm ci 10 | fi 11 | 12 | rm -rf "$OUTDIR" 13 | 14 | hardhat docgen 15 | 16 | # copy examples and adjust imports 17 | examples_source_dir="contracts/mocks/docs" 18 | examples_target_dir="docs/modules/api/examples" 19 | 20 | for f in "$examples_source_dir"/**/*.sol; do 21 | name="${f/#"$examples_source_dir/"/}" 22 | mkdir -p "$examples_target_dir/$(dirname "$name")" 23 | sed -Ee '/^import/s|"(\.\./)+|"@openzeppelin/contracts/|' "$f" > "$examples_target_dir/$name" 24 | done 25 | 26 | node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc" 27 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/release/synchronize-versions.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Synchronizes the version in contracts/package.json with the one in package.json. 4 | // This is run automatically when npm version is run. 5 | 6 | const fs = require('fs'); 7 | 8 | setVersion('package.json', 'contracts/package.json'); 9 | 10 | function setVersion(from, to) { 11 | const fromJson = JSON.parse(fs.readFileSync(from)); 12 | const toJson = JSON.parse(fs.readFileSync(to)); 13 | toJson.version = fromJson.version; 14 | fs.writeFileSync(to, JSON.stringify(toJson, null, 2) + '\n'); 15 | } 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/release/version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | changeset version 6 | 7 | scripts/release/format-changelog.js 8 | scripts/release/synchronize-versions.js 9 | scripts/release/update-comment.js 10 | 11 | oz-docs update-version 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/release/workflow/exit-prerelease.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | npx changeset pre exit rc 6 | git add . 7 | git commit -m "Exit release candidate" 8 | git push origin 9 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/release/workflow/integrity-check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | CHECKSUMS="$RUNNER_TEMP/checksums.txt" 6 | 7 | # Extract tarball content into a tmp directory 8 | tar xf "$TARBALL" -C "$RUNNER_TEMP" 9 | 10 | # Move to extracted directory 11 | cd "$RUNNER_TEMP/package" 12 | 13 | # Checksum all Solidity files 14 | find . -type f -name "*.sol" | xargs shasum > "$CHECKSUMS" 15 | 16 | # Back to directory with git contents 17 | cd "$GITHUB_WORKSPACE/contracts" 18 | 19 | # Check against tarball contents 20 | shasum -c "$CHECKSUMS" 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/release/workflow/rerun.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ github, context }) => 2 | github.rest.actions.createWorkflowDispatch({ 3 | owner: context.repo.owner, 4 | repo: context.repo.repo, 5 | workflow_id: 'release-cycle.yml', 6 | ref: process.env.REF || process.env.GITHUB_REF_NAME, 7 | }); 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/solhint-custom/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solhint-plugin-openzeppelin", 3 | "version": "0.0.0", 4 | "private": true 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/upgradeable/patch-apply.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | DIRNAME="$(dirname -- "${BASH_SOURCE[0]}")" 6 | PATCH="$DIRNAME/upgradeable.patch" 7 | 8 | error() { 9 | echo Error: "$*" >&2 10 | exit 1 11 | } 12 | 13 | if ! git diff-files --quiet ":!$PATCH" || ! git diff-index --quiet HEAD ":!$PATCH"; then 14 | error "Repository must have no staged or unstaged changes" 15 | fi 16 | 17 | if ! git apply -3 "$PATCH"; then 18 | error "Fix conflicts and run $DIRNAME/patch-save.sh" 19 | fi 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/scripts/upgradeable/patch-save.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | DIRNAME="$(dirname -- "${BASH_SOURCE[0]}")" 6 | PATCH="$DIRNAME/upgradeable.patch" 7 | 8 | error() { 9 | echo Error: "$*" >&2 10 | exit 1 11 | } 12 | 13 | if ! git diff-files --quiet ":!$PATCH"; then 14 | error "Unstaged changes. Stage to include in patch or temporarily stash." 15 | fi 16 | 17 | git diff-index --cached --patch --output="$PATCH" HEAD 18 | git restore --staged --worktree ":!$PATCH" 19 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/solhint.config.js: -------------------------------------------------------------------------------- 1 | const customRules = require('./scripts/solhint-custom'); 2 | 3 | const rules = [ 4 | 'no-unused-vars', 5 | 'const-name-snakecase', 6 | 'contract-name-camelcase', 7 | 'event-name-camelcase', 8 | 'func-name-mixedcase', 9 | 'func-param-name-mixedcase', 10 | 'modifier-name-mixedcase', 11 | 'var-name-mixedcase', 12 | 'imports-on-top', 13 | 'no-global-import', 14 | ...customRules.map(r => `openzeppelin/${r.ruleId}`), 15 | ]; 16 | 17 | module.exports = { 18 | plugins: ['openzeppelin'], 19 | rules: Object.fromEntries(rules.map(r => [r, 'error'])), 20 | }; 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/TESTING.md: -------------------------------------------------------------------------------- 1 | ## Testing 2 | 3 | Unit test are critical to OpenZeppelin Contracts. They help ensure code quality and mitigate against security vulnerabilities. The directory structure within the `/test` directory corresponds to the `/contracts` directory. 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/access/AccessControl.test.js: -------------------------------------------------------------------------------- 1 | const { DEFAULT_ADMIN_ROLE, shouldBehaveLikeAccessControl } = require('./AccessControl.behavior.js'); 2 | 3 | const AccessControl = artifacts.require('$AccessControl'); 4 | 5 | contract('AccessControl', function (accounts) { 6 | beforeEach(async function () { 7 | this.accessControl = await AccessControl.new({ from: accounts[0] }); 8 | await this.accessControl.$_grantRole(DEFAULT_ADMIN_ROLE, accounts[0]); 9 | }); 10 | 11 | shouldBehaveLikeAccessControl(...accounts); 12 | }); 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/access/extensions/AccessControlEnumerable.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | DEFAULT_ADMIN_ROLE, 3 | shouldBehaveLikeAccessControl, 4 | shouldBehaveLikeAccessControlEnumerable, 5 | } = require('../AccessControl.behavior.js'); 6 | 7 | const AccessControlEnumerable = artifacts.require('$AccessControlEnumerable'); 8 | 9 | contract('AccessControlEnumerable', function (accounts) { 10 | beforeEach(async function () { 11 | this.accessControl = await AccessControlEnumerable.new({ from: accounts[0] }); 12 | await this.accessControl.$_grantRole(DEFAULT_ADMIN_ROLE, accounts[0]); 13 | }); 14 | 15 | shouldBehaveLikeAccessControl(...accounts); 16 | shouldBehaveLikeAccessControlEnumerable(...accounts); 17 | }); 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/account.js: -------------------------------------------------------------------------------- 1 | const { web3 } = require('hardhat'); 2 | const { impersonateAccount, setBalance } = require('@nomicfoundation/hardhat-network-helpers'); 3 | 4 | // Hardhat default balance 5 | const DEFAULT_BALANCE = web3.utils.toBN('10000000000000000000000'); 6 | 7 | async function impersonate(account, balance = DEFAULT_BALANCE) { 8 | await impersonateAccount(account); 9 | await setBalance(account, balance); 10 | } 11 | 12 | module.exports = { 13 | impersonate, 14 | }; 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/chainid.js: -------------------------------------------------------------------------------- 1 | const hre = require('hardhat'); 2 | 3 | async function getChainId() { 4 | const chainIdHex = await hre.network.provider.send('eth_chainId', []); 5 | return new hre.web3.utils.BN(chainIdHex, 'hex'); 6 | } 7 | 8 | module.exports = { 9 | getChainId, 10 | }; 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/constants.js: -------------------------------------------------------------------------------- 1 | const MAX_UINT48 = web3.utils.toBN(1).shln(48).subn(1).toString(); 2 | const MAX_UINT64 = web3.utils.toBN(1).shln(64).subn(1).toString(); 3 | 4 | module.exports = { 5 | MAX_UINT48, 6 | MAX_UINT64, 7 | }; 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/create.js: -------------------------------------------------------------------------------- 1 | const RLP = require('rlp'); 2 | 3 | function computeCreateAddress(deployer, nonce) { 4 | return web3.utils.toChecksumAddress(web3.utils.sha3(RLP.encode([deployer.address ?? deployer, nonce])).slice(-40)); 5 | } 6 | 7 | function computeCreate2Address(saltHex, bytecode, deployer) { 8 | return web3.utils.toChecksumAddress( 9 | web3.utils 10 | .sha3( 11 | `0x${['ff', deployer.address ?? deployer, saltHex, web3.utils.soliditySha3(bytecode)] 12 | .map(x => x.replace(/0x/, '')) 13 | .join('')}`, 14 | ) 15 | .slice(-40), 16 | ); 17 | } 18 | 19 | module.exports = { 20 | computeCreateAddress, 21 | computeCreate2Address, 22 | }; 23 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/enums.js: -------------------------------------------------------------------------------- 1 | function Enum(...options) { 2 | return Object.fromEntries(options.map((key, i) => [key, web3.utils.toBN(i)])); 3 | } 4 | 5 | module.exports = { 6 | Enum, 7 | ProposalState: Enum('Pending', 'Active', 'Canceled', 'Defeated', 'Succeeded', 'Queued', 'Expired', 'Executed'), 8 | VoteType: Enum('Against', 'For', 'Abstain'), 9 | Rounding: Enum('Floor', 'Ceil', 'Trunc', 'Expand'), 10 | OperationState: Enum('Unset', 'Waiting', 'Ready', 'Done'), 11 | }; 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/iterate.js: -------------------------------------------------------------------------------- 1 | // Map values in an object 2 | const mapValues = (obj, fn) => Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, fn(v)])); 3 | 4 | // Array of number or bigint 5 | const max = (...values) => values.slice(1).reduce((x, y) => (x > y ? x : y), values[0]); 6 | const min = (...values) => values.slice(1).reduce((x, y) => (x < y ? x : y), values[0]); 7 | 8 | // Cartesian product of a list of arrays 9 | const product = (...arrays) => arrays.reduce((a, b) => a.flatMap(ai => b.map(bi => [...ai, bi])), [[]]); 10 | 11 | module.exports = { 12 | mapValues, 13 | max, 14 | min, 15 | product, 16 | }; 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/math.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // sum of integer / bignumber 3 | sum: (...args) => args.reduce((acc, n) => acc + n, 0), 4 | BNsum: (...args) => args.reduce((acc, n) => acc.add(n), web3.utils.toBN(0)), 5 | // min of integer / bignumber 6 | min: (...args) => args.slice(1).reduce((x, y) => (x < y ? x : y), args[0]), 7 | BNmin: (...args) => args.slice(1).reduce((x, y) => (x.lt(y) ? x : y), args[0]), 8 | // max of integer / bignumber 9 | max: (...args) => args.slice(1).reduce((x, y) => (x > y ? x : y), args[0]), 10 | BNmax: (...args) => args.slice(1).reduce((x, y) => (x.gt(y) ? x : y), args[0]), 11 | }; 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/methods.js: -------------------------------------------------------------------------------- 1 | const { soliditySha3 } = require('web3-utils'); 2 | 3 | module.exports = { 4 | selector: signature => soliditySha3(signature).substring(0, 10), 5 | }; 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/time.js: -------------------------------------------------------------------------------- 1 | const ozHelpers = require('@openzeppelin/test-helpers'); 2 | const helpers = require('@nomicfoundation/hardhat-network-helpers'); 3 | 4 | module.exports = { 5 | clock: { 6 | blocknumber: () => helpers.time.latestBlock(), 7 | timestamp: () => helpers.time.latest(), 8 | }, 9 | clockFromReceipt: { 10 | blocknumber: receipt => Promise.resolve(receipt.blockNumber), 11 | timestamp: receipt => web3.eth.getBlock(receipt.blockNumber).then(block => block.timestamp), 12 | }, 13 | forward: { 14 | blocknumber: ozHelpers.time.advanceBlockTo, 15 | timestamp: helpers.time.increaseTo, 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/proxy/ERC1967/ERC1967Proxy.test.js: -------------------------------------------------------------------------------- 1 | const shouldBehaveLikeProxy = require('../Proxy.behaviour'); 2 | 3 | const ERC1967Proxy = artifacts.require('ERC1967Proxy'); 4 | 5 | contract('ERC1967Proxy', function (accounts) { 6 | // `undefined`, `null` and other false-ish opts will not be forwarded. 7 | const createProxy = async function (implementation, initData, opts) { 8 | return ERC1967Proxy.new(implementation, initData, ...[opts].filter(Boolean)); 9 | }; 10 | 11 | shouldBehaveLikeProxy(createProxy, accounts); 12 | }); 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Burnable.test.js: -------------------------------------------------------------------------------- 1 | const { BN } = require('@openzeppelin/test-helpers'); 2 | 3 | const { shouldBehaveLikeERC20Burnable } = require('./ERC20Burnable.behavior'); 4 | const ERC20Burnable = artifacts.require('$ERC20Burnable'); 5 | 6 | contract('ERC20Burnable', function (accounts) { 7 | const [owner, ...otherAccounts] = accounts; 8 | 9 | const initialBalance = new BN(1000); 10 | 11 | const name = 'My Token'; 12 | const symbol = 'MTKN'; 13 | 14 | beforeEach(async function () { 15 | this.token = await ERC20Burnable.new(name, symbol, { from: owner }); 16 | await this.token.$_mint(owner, initialBalance); 17 | }); 18 | 19 | shouldBehaveLikeERC20Burnable(owner, initialBalance, otherAccounts); 20 | }); 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/token/ERC721/ERC721.test.js: -------------------------------------------------------------------------------- 1 | const { shouldBehaveLikeERC721, shouldBehaveLikeERC721Metadata } = require('./ERC721.behavior'); 2 | 3 | const ERC721 = artifacts.require('$ERC721'); 4 | 5 | contract('ERC721', function (accounts) { 6 | const name = 'Non Fungible Token'; 7 | const symbol = 'NFT'; 8 | 9 | beforeEach(async function () { 10 | this.token = await ERC721.new(name, symbol); 11 | }); 12 | 13 | shouldBehaveLikeERC721(...accounts); 14 | shouldBehaveLikeERC721Metadata(name, symbol, ...accounts); 15 | }); 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/token/ERC721/ERC721Enumerable.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeERC721, 3 | shouldBehaveLikeERC721Metadata, 4 | shouldBehaveLikeERC721Enumerable, 5 | } = require('./ERC721.behavior'); 6 | 7 | const ERC721Enumerable = artifacts.require('$ERC721Enumerable'); 8 | 9 | contract('ERC721Enumerable', function (accounts) { 10 | const name = 'Non Fungible Token'; 11 | const symbol = 'NFT'; 12 | 13 | beforeEach(async function () { 14 | this.token = await ERC721Enumerable.new(name, symbol); 15 | }); 16 | 17 | shouldBehaveLikeERC721(...accounts); 18 | shouldBehaveLikeERC721Metadata(name, symbol, ...accounts); 19 | shouldBehaveLikeERC721Enumerable(...accounts); 20 | }); 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/token/ERC721/utils/ERC721Holder.test.js: -------------------------------------------------------------------------------- 1 | const { expect } = require('chai'); 2 | 3 | const ERC721Holder = artifacts.require('$ERC721Holder'); 4 | const ERC721 = artifacts.require('$ERC721'); 5 | 6 | contract('ERC721Holder', function (accounts) { 7 | const [owner] = accounts; 8 | 9 | const name = 'Non Fungible Token'; 10 | const symbol = 'NFT'; 11 | const tokenId = web3.utils.toBN(1); 12 | 13 | it('receives an ERC721 token', async function () { 14 | const token = await ERC721.new(name, symbol); 15 | await token.$_mint(owner, tokenId); 16 | 17 | const receiver = await ERC721Holder.new(); 18 | await token.safeTransferFrom(owner, receiver.address, tokenId, { from: owner }); 19 | 20 | expect(await token.ownerOf(tokenId)).to.be.equal(receiver.address); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/utils/Context.test.js: -------------------------------------------------------------------------------- 1 | require('@openzeppelin/test-helpers'); 2 | 3 | const ContextMock = artifacts.require('ContextMock'); 4 | const ContextMockCaller = artifacts.require('ContextMockCaller'); 5 | 6 | const { shouldBehaveLikeRegularContext } = require('./Context.behavior'); 7 | 8 | contract('Context', function (accounts) { 9 | const [sender] = accounts; 10 | 11 | beforeEach(async function () { 12 | this.context = await ContextMock.new(); 13 | this.caller = await ContextMockCaller.new(); 14 | }); 15 | 16 | shouldBehaveLikeRegularContext(sender); 17 | }); 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/utils/introspection/ERC165.test.js: -------------------------------------------------------------------------------- 1 | const { shouldSupportInterfaces } = require('./SupportsInterface.behavior'); 2 | 3 | const ERC165 = artifacts.require('$ERC165'); 4 | 5 | contract('ERC165', function () { 6 | beforeEach(async function () { 7 | this.mock = await ERC165.new(); 8 | }); 9 | 10 | shouldSupportInterfaces(['ERC165']); 11 | }); 12 | -------------------------------------------------------------------------------- /lib/permit2/.env.example: -------------------------------------------------------------------------------- 1 | FORK_URL= -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/batchTransferFrom.snap: -------------------------------------------------------------------------------- 1 | 61797 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/batchTransferFromMultiToken.snap: -------------------------------------------------------------------------------- 1 | 81786 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/lockdown.snap: -------------------------------------------------------------------------------- 1 | 28435 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permit2 + transferFrom2 with WETH9's mainnet address.snap: -------------------------------------------------------------------------------- 1 | 60346 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permit2 + transferFrom2 with a non EIP-2612 native token with fallback.snap: -------------------------------------------------------------------------------- 1 | 65533 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permit2 + transferFrom2 with a non EIP-2612 native token.snap: -------------------------------------------------------------------------------- 1 | 60811 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permit2 + transferFrom2 with an EIP-2612 native token.snap: -------------------------------------------------------------------------------- 1 | 46296 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitBatchCleanWrite.snap: -------------------------------------------------------------------------------- 1 | 91924 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitBatchDirtyWrite.snap: -------------------------------------------------------------------------------- 1 | 57724 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitBatchTransferFromMultipleTokens.snap: -------------------------------------------------------------------------------- 1 | 143387 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitBatchTransferFromSingleToken.snap: -------------------------------------------------------------------------------- 1 | 88867 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitCleanWrite.snap: -------------------------------------------------------------------------------- 1 | 63119 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitCompactSig.snap: -------------------------------------------------------------------------------- 1 | 63094 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitDirtyNonce.snap: -------------------------------------------------------------------------------- 1 | 44014 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitDirtyWrite.snap: -------------------------------------------------------------------------------- 1 | 46019 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitInvalidSigner.snap: -------------------------------------------------------------------------------- 1 | 40301 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitSetMaxAllowanceCleanWrite.snap: -------------------------------------------------------------------------------- 1 | 61114 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitSetMaxAllowanceDirtyWrite.snap: -------------------------------------------------------------------------------- 1 | 44014 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitSignatureExpired.snap: -------------------------------------------------------------------------------- 1 | 31700 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitTransferFromBatchTypedWitness.snap: -------------------------------------------------------------------------------- 1 | 120325 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitTransferFromCompactSig.snap: -------------------------------------------------------------------------------- 1 | 86066 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitTransferFromSingleToken.snap: -------------------------------------------------------------------------------- 1 | 86092 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/permitTransferFromTypedWitness.snap: -------------------------------------------------------------------------------- 1 | 87817 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/safePermit + safeTransferFrom with an EIP-2612 native token.snap: -------------------------------------------------------------------------------- 1 | 48268 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/simplePermit2 + transferFrom2 with a non EIP-2612 native token.snap: -------------------------------------------------------------------------------- 1 | 60811 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/single recipient 2 tokens.snap: -------------------------------------------------------------------------------- 1 | 118525 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/single recipient many tokens.snap: -------------------------------------------------------------------------------- 1 | 133544 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/transferFrom with different owners.snap: -------------------------------------------------------------------------------- 1 | 61886 -------------------------------------------------------------------------------- /lib/permit2/.forge-snapshots/transferFrom.snap: -------------------------------------------------------------------------------- 1 | 52197 -------------------------------------------------------------------------------- /lib/permit2/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | .gas-snapshot linguist-language=Julia -------------------------------------------------------------------------------- /lib/permit2/.github/workflows/gas.yml: -------------------------------------------------------------------------------- 1 | name: Gas 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | tests: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: Install Foundry 16 | uses: foundry-rs/foundry-toolchain@v1 17 | with: 18 | version: nightly 19 | 20 | - name: Check gas snapshots 21 | run: forge snapshot --check 22 | -------------------------------------------------------------------------------- /lib/permit2/.github/workflows/integration-tests.yml: -------------------------------------------------------------------------------- 1 | name: Integration Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | tests: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: Install Foundry 16 | uses: foundry-rs/foundry-toolchain@v1 17 | with: 18 | version: nightly 19 | 20 | - name: Install dependencies 21 | run: forge install 22 | 23 | - name: Check contract sizes 24 | run: forge build --sizes 25 | 26 | - name: Run tests 27 | run: forge test 28 | env: 29 | FOUNDRY_PROFILE: integration 30 | FORK_URL: ${{ secrets.FORK_URL }} 31 | -------------------------------------------------------------------------------- /lib/permit2/.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | tests: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: Install Foundry 16 | uses: foundry-rs/foundry-toolchain@v1 17 | with: 18 | version: nightly 19 | 20 | - name: Check formatting 21 | run: forge fmt --check 22 | -------------------------------------------------------------------------------- /lib/permit2/.github/workflows/unit-tests.yml: -------------------------------------------------------------------------------- 1 | name: Unit Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | tests: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | 15 | - name: Install Foundry 16 | uses: foundry-rs/foundry-toolchain@v1 17 | with: 18 | version: nightly 19 | 20 | - name: Install dependencies 21 | run: forge install 22 | 23 | - name: Check contract sizes 24 | run: forge build --sizes 25 | 26 | - name: Run tests 27 | run: forge test 28 | -------------------------------------------------------------------------------- /lib/permit2/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | /cache 3 | /out 4 | broadcast/ 5 | -------------------------------------------------------------------------------- /lib/permit2/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/solmate"] 5 | path = lib/solmate 6 | url = https://github.com/rari-capital/solmate 7 | [submodule "lib/openzeppelin-contracts"] 8 | path = lib/openzeppelin-contracts 9 | url = https://github.com/OpenZeppelin/openzeppelin-contracts 10 | [submodule "lib/forge-gas-snapshot"] 11 | path = lib/forge-gas-snapshot 12 | url = https://github.com/marktoda/forge-gas-snapshot 13 | -------------------------------------------------------------------------------- /lib/permit2/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "solidity.packageDefaultDependenciesContractsDirectory": "src", 3 | "solidity.packageDefaultDependenciesDirectory": "lib", 4 | "solidity.compileUsingRemoteVersion": "v0.8.17", 5 | "solidity.formatter": "forge", 6 | "search.exclude": { "lib": true }, 7 | "files.associations": { 8 | ".gas-snapshot": "julia" 9 | }, 10 | "editor.formatOnSave": true 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/audits/ABDKAudit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/permit2/audits/ABDKAudit.pdf -------------------------------------------------------------------------------- /lib/permit2/audits/Chainsecurity Audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/permit2/audits/Chainsecurity Audit.pdf -------------------------------------------------------------------------------- /lib/permit2/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | solc = "0.8.17" 3 | bytecode_hash = "none" 4 | optimizer = true 5 | via_ir = true 6 | optimizer_runs = 1000000 7 | no_match_path = "*/integration/*" 8 | fuzz_runs = 10000 9 | ffi = true 10 | fs_permissions = [{ access = "read-write", path = ".forge-snapshots/"}] 11 | 12 | [profile.integration] 13 | no_match_path = "" 14 | match_path = "*/integration/*" 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/add.snap: -------------------------------------------------------------------------------- 1 | 134 -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/addFirst.snap: -------------------------------------------------------------------------------- 1 | 134 -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/addSecond.snap: -------------------------------------------------------------------------------- 1 | 134 -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/manyAdd.snap: -------------------------------------------------------------------------------- 1 | 19195 -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/manySstore.snap: -------------------------------------------------------------------------------- 1 | 50990 -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/snapmanyAdd.snap: -------------------------------------------------------------------------------- 1 | 19195 2 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.forge-snapshots/snapmanySstore.snap: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: [push, pull_request] 4 | 5 | env: 6 | FOUNDRY_PROFILE: ci 7 | 8 | jobs: 9 | check: 10 | strategy: 11 | fail-fast: true 12 | 13 | name: Foundry project 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | with: 18 | submodules: recursive 19 | 20 | - name: Install Foundry 21 | uses: foundry-rs/foundry-toolchain@v1 22 | with: 23 | version: nightly 24 | 25 | - name: Run Forge build 26 | run: | 27 | forge --version 28 | forge build --sizes 29 | id: build 30 | 31 | - name: Run Forge tests 32 | run: | 33 | forge test -vvv 34 | id: test 35 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | lib/ 3 | cache/ 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'src' 3 | out = 'out' 4 | libs = ['lib'] 5 | ffi = true 6 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-gas-snapshot/src/test/SimpleOperations.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.15; 3 | 4 | contract SimpleOperations { 5 | uint256 internal test; 6 | 7 | function add() public pure { 8 | uint256 x = 1; 9 | x++; 10 | } 11 | 12 | function manyAdd() public pure { 13 | uint256 x; 14 | for (uint256 i = 0; i < 100; i++) { 15 | x = i + 1; 16 | } 17 | } 18 | 19 | function manySstore() public { 20 | for (uint256 i = 0; i < 100; i++) { 21 | test = i + 2; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/.github/workflows/sync.yml: -------------------------------------------------------------------------------- 1 | name: Sync Release Branch 2 | 3 | on: 4 | release: 5 | types: 6 | - created 7 | 8 | jobs: 9 | sync-release-branch: 10 | runs-on: ubuntu-latest 11 | if: startsWith(github.event.release.tag_name, 'v1') 12 | steps: 13 | - name: Check out the repo 14 | uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 17 | ref: v1 18 | 19 | - name: Configure Git 20 | run: | 21 | git config user.name github-actions[bot] 22 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com 23 | 24 | - name: Sync Release Branch 25 | run: | 26 | git fetch --tags 27 | git checkout v1 28 | git reset --hard ${GITHUB_REF} 29 | git push --force 30 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | .vscode 4 | .idea 5 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/ds-test"] 2 | path = lib/ds-test 3 | url = https://github.com/dapphub/ds-test 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | /cache/ 5 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/lib/ds-test/Makefile: -------------------------------------------------------------------------------- 1 | all:; dapp build 2 | 3 | test: 4 | -dapp --use solc:0.4.23 build 5 | -dapp --use solc:0.4.26 build 6 | -dapp --use solc:0.5.17 build 7 | -dapp --use solc:0.6.12 build 8 | -dapp --use solc:0.7.5 build 9 | 10 | demo: 11 | DAPP_SRC=demo dapp --use solc:0.7.5 build 12 | -hevm dapp-test --verbose 3 13 | 14 | .PHONY: test demo 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/lib/ds-test/default.nix: -------------------------------------------------------------------------------- 1 | { solidityPackage, dappsys }: solidityPackage { 2 | name = "ds-test"; 3 | src = ./src; 4 | } 5 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/lib/ds-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ds-test", 3 | "version": "1.0.0", 4 | "description": "Assertions, equality checks and other test helpers ", 5 | "bugs": "https://github.com/dapphub/ds-test/issues", 6 | "license": "GPL-3.0", 7 | "author": "Contributors to ds-test", 8 | "files": [ 9 | "src/*" 10 | ], 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/dapphub/ds-test.git" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "forge-std", 3 | "version": "1.5.6", 4 | "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", 5 | "homepage": "https://book.getfoundry.sh/forge/forge-std", 6 | "bugs": "https://github.com/foundry-rs/forge-std/issues", 7 | "license": "(Apache-2.0 OR MIT)", 8 | "author": "Contributors to Forge Standard Library", 9 | "files": [ 10 | "src/**/*" 11 | ], 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/foundry-rs/forge-std.git" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/src/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2; 3 | 4 | interface IERC165 { 5 | /// @notice Query if a contract implements an interface 6 | /// @param interfaceID The interface identifier, as specified in ERC-165 7 | /// @dev Interface identification is specified in ERC-165. This function 8 | /// uses less than 30,000 gas. 9 | /// @return `true` if the contract implements `interfaceID` and 10 | /// `interfaceID` is not 0xffffffff, `false` otherwise 11 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/test/compilation/CompilationScript.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScript is Script {} 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/test/compilation/CompilationScriptBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Script.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationScriptBase is ScriptBase {} 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/test/compilation/CompilationTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTest is Test {} 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/forge-std/test/compilation/CompilationTestBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | pragma experimental ABIEncoderV2; 5 | 6 | import "../../src/Test.sol"; 7 | 8 | // The purpose of this contract is to benchmark compilation time to avoid accidentally introducing 9 | // a change that results in very long compilation times with via-ir. See https://github.com/foundry-rs/forge-std/issues/207 10 | contract CompilationTestBase is TestBase {} 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.codecov.yml: -------------------------------------------------------------------------------- 1 | comment: off 2 | github_checks: 3 | annotations: false 4 | coverage: 5 | status: 6 | patch: 7 | default: 8 | target: 95% 9 | project: 10 | default: 11 | threshold: 1% 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = false 12 | max_line_length = 120 13 | 14 | [*.sol] 15 | indent_size = 4 16 | 17 | [*.js] 18 | indent_size = 2 19 | 20 | [*.{adoc,md}] 21 | max_line_length = 0 22 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions & Support Requests 3 | url: https://forum.openzeppelin.com/c/support/contracts/18 4 | about: Ask in the OpenZeppelin Forum 5 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for OpenZeppelin Contracts 4 | 5 | --- 6 | 7 | **🧐 Motivation** 8 | 9 | 10 | **📝 Details** 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Fixes #???? 7 | 8 | 9 | 10 | 11 | 12 | #### PR Checklist 13 | 14 | 15 | 16 | 17 | 18 | - [ ] Tests 19 | - [ ] Documentation 20 | - [ ] Changelog entry 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.github/actions/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: Setup 2 | 3 | runs: 4 | using: composite 5 | steps: 6 | - uses: actions/setup-node@v3 7 | with: 8 | node-version: 14.x 9 | cache: npm 10 | - uses: actions/cache@v3 11 | id: cache 12 | with: 13 | path: '**/node_modules' 14 | key: npm-v3-${{ hashFiles('**/package-lock.json') }} 15 | - name: Install dependencies 16 | run: npm ci --prefer-offline 17 | shell: bash 18 | if: steps.cache.outputs.cache-hit != 'true' 19 | env: 20 | SKIP_COMPILE: true 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Build Docs 2 | 3 | on: 4 | push: 5 | branches: [release-v*] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - name: Set up environment 13 | uses: ./.github/actions/setup 14 | - run: bash scripts/git-user-config.sh 15 | - run: node scripts/update-docs-branch.js 16 | - run: git push --all origin 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.github/workflows/upgradeable.yml: -------------------------------------------------------------------------------- 1 | name: Upgradeable Trigger 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - release-v* 8 | 9 | jobs: 10 | trigger: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - id: app 14 | uses: getsentry/action-github-app-token@v1 15 | with: 16 | app_id: ${{ secrets.UPGRADEABLE_APP_ID }} 17 | private_key: ${{ secrets.UPGRADEABLE_APP_PK }} 18 | - run: | 19 | curl -X POST \ 20 | https://api.github.com/repos/OpenZeppelin/openzeppelin-contracts-upgradeable/dispatches \ 21 | -H 'Accept: application/vnd.github.v3+json' \ 22 | -H 'Authorization: token ${{ steps.app.outputs.token }}' \ 23 | -d '{ "event_type": "Update", "client_payload": { "ref": "${{ github.ref }}" } }' 24 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.mocharc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | require: 'hardhat/register', 3 | timeout: 4000, 4 | }; 5 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "overrides": [ 5 | { 6 | "files": "*.sol", 7 | "options": { 8 | "singleQuote": false, 9 | "printWidth": 120, 10 | "explicitTypes": "always" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | norpc: true, 3 | testCommand: 'npm test', 4 | compileCommand: 'npm run compile', 5 | skipFiles: [ 6 | 'mocks', 7 | ], 8 | providerOptions: { 9 | default_balance_ether: '10000000000000000000000000', 10 | }, 11 | mocha: { 12 | fgrep: '[skip-on-coverage]', 13 | invert: true, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-unused-vars": "error", 4 | "const-name-snakecase": "error", 5 | "contract-name-camelcase": "error", 6 | "event-name-camelcase": "error", 7 | "func-name-mixedcase": "error", 8 | "func-param-name-mixedcase": "error", 9 | "modifier-name-mixedcase": "error", 10 | "private-vars-leading-underscore": "error", 11 | "var-name-mixedcase": "error", 12 | "imports-on-top": "error" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/audit/2018-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/permit2/lib/openzeppelin-contracts/audit/2018-10.pdf -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/Makefile: -------------------------------------------------------------------------------- 1 | default: help 2 | 3 | PATCH = applyHarness.patch 4 | CONTRACTS_DIR = ../contracts 5 | MUNGED_DIR = munged 6 | 7 | help: 8 | @echo "usage:" 9 | @echo " make clean: remove all generated files (those ignored by git)" 10 | @echo " make $(MUNGED_DIR): create $(MUNGED_DIR) directory by applying the patch file to $(CONTRACTS_DIR)" 11 | @echo " make record: record a new patch file capturing the differences between $(CONTRACTS_DIR) and $(MUNGED_DIR)" 12 | 13 | munged: $(wildcard $(CONTRACTS_DIR)/*.sol) $(PATCH) 14 | rm -rf $@ 15 | cp -r $(CONTRACTS_DIR) $@ 16 | patch -p0 -d $@ < $(PATCH) 17 | 18 | record: 19 | diff -ruN $(CONTRACTS_DIR) $(MUNGED_DIR) | sed 's+../contracts/++g' | sed 's+munged/++g' > $(PATCH) 20 | 21 | clean: 22 | git clean -fdX 23 | touch $(PATCH) 24 | 25 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/munged/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/scripts/Governor.sh: -------------------------------------------------------------------------------- 1 | make -C certora munged 2 | 3 | certoraRun certora/harnesses/ERC20VotesHarness.sol certora/harnesses/GovernorHarness.sol \ 4 | --verify GovernorHarness:certora/specs/GovernorBase.spec \ 5 | --solc solc8.0 \ 6 | --staging shelly/forSasha \ 7 | --optimistic_loop \ 8 | --settings -copyLoopUnroll=4 \ 9 | --rule voteStartBeforeVoteEnd \ 10 | --msg "$1" 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/scripts/GovernorCountingSimple-counting.sh: -------------------------------------------------------------------------------- 1 | make -C certora munged 2 | 3 | certoraRun certora/harnesses/ERC20VotesHarness.sol certora/harnesses/GovernorBasicHarness.sol \ 4 | --verify GovernorBasicHarness:certora/specs/GovernorCountingSimple.spec \ 5 | --solc solc8.2 \ 6 | --staging shelly/forSasha \ 7 | --optimistic_loop \ 8 | --settings -copyLoopUnroll=4 \ 9 | --rule hasVotedCorrelation \ 10 | --msg "$1" 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/scripts/WizardControlFirstPriority.sh: -------------------------------------------------------------------------------- 1 | make -C certora munged 2 | 3 | certoraRun certora/harnesses/ERC20VotesHarness.sol certora/harnesses/WizardControlFirstPriority.sol \ 4 | --link WizardControlFirstPriority:token=ERC20VotesHarness \ 5 | --verify WizardControlFirstPriority:certora/specs/GovernorBase.spec \ 6 | --solc solc8.2 \ 7 | --disableLocalTypeChecking \ 8 | --staging shelly/forSasha \ 9 | --optimistic_loop \ 10 | --settings -copyLoopUnroll=4 \ 11 | --rule canVoteDuringVotingPeriod \ 12 | --msg "$1" 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/scripts/WizardFirstTry.sh: -------------------------------------------------------------------------------- 1 | make -C certora munged 2 | 3 | certoraRun certora/harnesses/ERC20VotesHarness.sol certora/harnesses/WizardFirstTry.sol \ 4 | --verify WizardFirstTry:certora/specs/GovernorBase.spec \ 5 | --solc solc8.2 \ 6 | --staging shelly/forSasha \ 7 | --optimistic_loop \ 8 | --disableLocalTypeChecking \ 9 | --settings -copyLoopUnroll=4 \ 10 | --msg "$1" 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/scripts/sanity.sh: -------------------------------------------------------------------------------- 1 | make -C certora munged 2 | 3 | for f in certora/harnesses/Wizard*.sol 4 | do 5 | echo "Processing $f" 6 | file=$(basename $f) 7 | echo ${file%.*} 8 | certoraRun certora/harnesses/$file \ 9 | --verify ${file%.*}:certora/specs/sanity.spec "$@" \ 10 | --solc solc8.2 --staging shelly/forSasha \ 11 | --optimistic_loop \ 12 | --msg "checking sanity on ${file%.*}" 13 | --settings -copyLoopUnroll=4 14 | done 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/certora/specs/sanity.spec: -------------------------------------------------------------------------------- 1 | /* 2 | This rule looks for a non-reverting execution path to each method, including those overridden in the harness. 3 | A method has such an execution path if it violates this rule. 4 | How it works: 5 | - If there is a non-reverting execution path, we reach the false assertion, and the sanity fails. 6 | - If all execution paths are reverting, we never call the assertion, and the method will pass this rule vacuously. 7 | */ 8 | 9 | rule sanity(method f) { 10 | env e; 11 | calldataarg arg; 12 | f(e, arg); 13 | assert false; 14 | } -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/crosschain/errors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.6.0) (crosschain/errors.sol) 3 | 4 | pragma solidity ^0.8.4; 5 | 6 | error NotCrossChainCall(); 7 | error InvalidCrossChainSender(address actual, address expected); 8 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/extensions/IERC1155MetadataURI.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC1155/IERC1155Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC1271 standard signature validation method for 8 | * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. 9 | * 10 | * _Available since v4.1._ 11 | */ 12 | interface IERC1271 { 13 | /** 14 | * @dev Should return whether the signature provided is valid for the provided data 15 | * @param hash Hash of the data to be signed 16 | * @param signature Signature byte array associated with _data 17 | */ 18 | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); 19 | } 20 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC165.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Implementer.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Registry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1820Registry.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC1820Registry.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/IERC20.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/IERC20Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC3156FlashBorrower.sol"; 7 | import "./IERC3156FlashLender.sol"; 8 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Enumerable.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/extensions/IERC721Metadata.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC721/IERC721Receiver.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC777.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC777Recipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Recipient.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Recipient.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/IERC777Sender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC777Sender.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC777/IERC777Sender.sol"; 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC2612.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/draft-IERC2612.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../token/ERC20/extensions/draft-IERC20Permit.sol"; 7 | 8 | interface IERC2612 is IERC20Permit {} 9 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/metatx/README.adoc: -------------------------------------------------------------------------------- 1 | = Meta Transactions 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx 5 | 6 | == Core 7 | 8 | {{ERC2771Context}} 9 | 10 | == Utils 11 | 12 | {{MinimalForwarder}} 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/AccessControlCrossChainMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import "../access/AccessControlCrossChain.sol"; 6 | import "../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol"; 7 | 8 | contract AccessControlCrossChainMock is AccessControlCrossChain, CrossChainEnabledArbitrumL2 { 9 | constructor() { 10 | _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); 11 | } 12 | 13 | function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public { 14 | _setRoleAdmin(roleId, adminRoleId); 15 | } 16 | 17 | function senderProtected(bytes32 roleId) public onlyRole(roleId) {} 18 | 19 | function crossChainRoleAlias(bytes32 role) public pure virtual returns (bytes32) { 20 | return _crossChainRoleAlias(role); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/AccessControlEnumerableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../access/AccessControlEnumerable.sol"; 6 | 7 | contract AccessControlEnumerableMock is AccessControlEnumerable { 8 | constructor() { 9 | _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); 10 | } 11 | 12 | function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public { 13 | _setRoleAdmin(roleId, adminRoleId); 14 | } 15 | 16 | function senderProtected(bytes32 roleId) public onlyRole(roleId) {} 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/AccessControlMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../access/AccessControl.sol"; 6 | 7 | contract AccessControlMock is AccessControl { 8 | constructor() { 9 | _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); 10 | } 11 | 12 | function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public { 13 | _setRoleAdmin(roleId, adminRoleId); 14 | } 15 | 16 | function senderProtected(bytes32 roleId) public onlyRole(roleId) {} 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ArraysImpl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Arrays.sol"; 6 | 7 | contract ArraysImpl { 8 | using Arrays for uint256[]; 9 | 10 | uint256[] private _array; 11 | 12 | constructor(uint256[] memory array) { 13 | _array = array; 14 | } 15 | 16 | function findUpperBound(uint256 element) external view returns (uint256) { 17 | return _array.findUpperBound(element); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/BadBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract BadBeaconNoImpl {} 6 | 7 | contract BadBeaconNotContract { 8 | function implementation() external pure returns (address) { 9 | return address(0x1); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/Base64Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Base64.sol"; 6 | 7 | contract Base64Mock { 8 | function encode(bytes memory value) external pure returns (string memory) { 9 | return Base64.encode(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/BitmapMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/structs/BitMaps.sol"; 6 | 7 | contract BitMapMock { 8 | using BitMaps for BitMaps.BitMap; 9 | 10 | BitMaps.BitMap private _bitmap; 11 | 12 | function get(uint256 index) public view returns (bool) { 13 | return _bitmap.get(index); 14 | } 15 | 16 | function setTo(uint256 index, bool value) public { 17 | _bitmap.setTo(index, value); 18 | } 19 | 20 | function set(uint256 index) public { 21 | _bitmap.set(index); 22 | } 23 | 24 | function unset(uint256 index) public { 25 | _bitmap.unset(index); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ClashingImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev Implementation contract with an admin() function made to clash with 7 | * @dev TransparentUpgradeableProxy's to test correct functioning of the 8 | * @dev Transparent Proxy feature. 9 | */ 10 | contract ClashingImplementation { 11 | function admin() external pure returns (address) { 12 | return 0x0000000000000000000000000000000011111142; 13 | } 14 | 15 | function delegatedFunction() external pure returns (bool) { 16 | return true; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ConditionalEscrowMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/escrow/ConditionalEscrow.sol"; 6 | 7 | // mock class using ConditionalEscrow 8 | contract ConditionalEscrowMock is ConditionalEscrow { 9 | mapping(address => bool) private _allowed; 10 | 11 | function setAllowed(address payee, bool allowed) public { 12 | _allowed[payee] = allowed; 13 | } 14 | 15 | function withdrawalAllowed(address payee) public view override returns (bool) { 16 | return _allowed[payee]; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/CountersImpl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Counters.sol"; 6 | 7 | contract CountersImpl { 8 | using Counters for Counters.Counter; 9 | 10 | Counters.Counter private _counter; 11 | 12 | function current() public view returns (uint256) { 13 | return _counter.current(); 14 | } 15 | 16 | function increment() public { 17 | _counter.increment(); 18 | } 19 | 20 | function decrement() public { 21 | _counter.decrement(); 22 | } 23 | 24 | function reset() public { 25 | _counter.reset(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC1155BurnableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC1155/extensions/ERC1155Burnable.sol"; 6 | 7 | contract ERC1155BurnableMock is ERC1155Burnable { 8 | constructor(string memory uri) ERC1155(uri) {} 9 | 10 | function mint( 11 | address to, 12 | uint256 id, 13 | uint256 value, 14 | bytes memory data 15 | ) public { 16 | _mint(to, id, value, data); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC1155SupplyMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./ERC1155Mock.sol"; 6 | import "../token/ERC1155/extensions/ERC1155Supply.sol"; 7 | 8 | contract ERC1155SupplyMock is ERC1155Mock, ERC1155Supply { 9 | constructor(string memory uri) ERC1155Mock(uri) {} 10 | 11 | function _beforeTokenTransfer( 12 | address operator, 13 | address from, 14 | address to, 15 | uint256[] memory ids, 16 | uint256[] memory amounts, 17 | bytes memory data 18 | ) internal virtual override(ERC1155, ERC1155Supply) { 19 | super._beforeTokenTransfer(operator, from, to, ids, amounts, data); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC1155URIStorageMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./ERC1155Mock.sol"; 6 | import "../token/ERC1155/extensions/ERC1155URIStorage.sol"; 7 | 8 | contract ERC1155URIStorageMock is ERC1155Mock, ERC1155URIStorage { 9 | constructor(string memory _uri) ERC1155Mock(_uri) {} 10 | 11 | function uri(uint256 tokenId) public view virtual override(ERC1155, ERC1155URIStorage) returns (string memory) { 12 | return ERC1155URIStorage.uri(tokenId); 13 | } 14 | 15 | function setURI(uint256 tokenId, string memory _tokenURI) public { 16 | _setURI(tokenId, _tokenURI); 17 | } 18 | 19 | function setBaseURI(string memory baseURI) public { 20 | _setBaseURI(baseURI); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MaliciousData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MaliciousData { 6 | function supportsInterface(bytes4) public view returns (bool) { 7 | assembly { 8 | mstore(0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) 9 | return(0, 32) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MissingData.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165MissingData { 6 | function supportsInterface(bytes4 interfaceId) public view {} // missing return 7 | } 8 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165NotSupported.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract ERC165NotSupported {} 6 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC165Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/introspection/ERC165.sol"; 6 | 7 | contract ERC165Mock is ERC165 {} 8 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC165StorageMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/introspection/ERC165Storage.sol"; 6 | 7 | contract ERC165StorageMock is ERC165Storage { 8 | function registerInterface(bytes4 interfaceId) public { 9 | _registerInterface(interfaceId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC1820ImplementerMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/introspection/ERC1820Implementer.sol"; 6 | 7 | contract ERC1820ImplementerMock is ERC1820Implementer { 8 | function registerInterfaceForAddress(bytes32 interfaceHash, address account) public { 9 | _registerInterfaceForAddress(interfaceHash, account); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20BurnableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Burnable.sol"; 6 | 7 | contract ERC20BurnableMock is ERC20Burnable { 8 | constructor( 9 | string memory name, 10 | string memory symbol, 11 | address initialAccount, 12 | uint256 initialBalance 13 | ) ERC20(name, symbol) { 14 | _mint(initialAccount, initialBalance); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20CappedMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Capped.sol"; 6 | 7 | contract ERC20CappedMock is ERC20Capped { 8 | constructor( 9 | string memory name, 10 | string memory symbol, 11 | uint256 cap 12 | ) ERC20(name, symbol) ERC20Capped(cap) {} 13 | 14 | function mint(address to, uint256 tokenId) public { 15 | _mint(to, tokenId); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20DecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/ERC20.sol"; 6 | 7 | contract ERC20DecimalsMock is ERC20 { 8 | uint8 private immutable _decimals; 9 | 10 | constructor( 11 | string memory name_, 12 | string memory symbol_, 13 | uint8 decimals_ 14 | ) ERC20(name_, symbol_) { 15 | _decimals = decimals_; 16 | } 17 | 18 | function decimals() public view virtual override returns (uint8) { 19 | return _decimals; 20 | } 21 | 22 | function mint(address account, uint256 amount) public { 23 | _mint(account, amount); 24 | } 25 | 26 | function burn(address account, uint256 amount) public { 27 | _burn(account, amount); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20PermitMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/draft-ERC20Permit.sol"; 6 | 7 | contract ERC20PermitMock is ERC20Permit { 8 | constructor( 9 | string memory name, 10 | string memory symbol, 11 | address initialAccount, 12 | uint256 initialBalance 13 | ) payable ERC20(name, symbol) ERC20Permit(name) { 14 | _mint(initialAccount, initialBalance); 15 | } 16 | 17 | function getChainId() external view returns (uint256) { 18 | return block.chainid; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20SnapshotMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Snapshot.sol"; 6 | 7 | contract ERC20SnapshotMock is ERC20Snapshot { 8 | constructor( 9 | string memory name, 10 | string memory symbol, 11 | address initialAccount, 12 | uint256 initialBalance 13 | ) ERC20(name, symbol) { 14 | _mint(initialAccount, initialBalance); 15 | } 16 | 17 | function snapshot() public { 18 | _snapshot(); 19 | } 20 | 21 | function mint(address account, uint256 amount) public { 22 | _mint(account, amount); 23 | } 24 | 25 | function burn(address account, uint256 amount) public { 26 | _burn(account, amount); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20VotesCompMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20VotesComp.sol"; 6 | 7 | contract ERC20VotesCompMock is ERC20VotesComp { 8 | constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {} 9 | 10 | function mint(address account, uint256 amount) public { 11 | _mint(account, amount); 12 | } 13 | 14 | function burn(address account, uint256 amount) public { 15 | _burn(account, amount); 16 | } 17 | 18 | function getChainId() external view returns (uint256) { 19 | return block.chainid; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20VotesMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Votes.sol"; 6 | 7 | contract ERC20VotesMock is ERC20Votes { 8 | constructor(string memory name, string memory symbol) ERC20(name, symbol) ERC20Permit(name) {} 9 | 10 | function mint(address account, uint256 amount) public { 11 | _mint(account, amount); 12 | } 13 | 14 | function burn(address account, uint256 amount) public { 15 | _burn(account, amount); 16 | } 17 | 18 | function getChainId() external view returns (uint256) { 19 | return block.chainid; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC20WrapperMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Wrapper.sol"; 6 | 7 | contract ERC20WrapperMock is ERC20Wrapper { 8 | constructor( 9 | IERC20 _underlyingToken, 10 | string memory name, 11 | string memory symbol 12 | ) ERC20(name, symbol) ERC20Wrapper(_underlyingToken) {} 13 | 14 | function recover(address account) public returns (uint256) { 15 | return _recover(account); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC4626Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC4626.sol"; 6 | 7 | // mock class using ERC20 8 | contract ERC4626Mock is ERC4626 { 9 | constructor( 10 | IERC20Metadata asset, 11 | string memory name, 12 | string memory symbol 13 | ) ERC20(name, symbol) ERC4626(asset) {} 14 | 15 | function mockMint(address account, uint256 amount) public { 16 | _mint(account, amount); 17 | } 18 | 19 | function mockBurn(address account, uint256 amount) public { 20 | _burn(account, amount); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ERC721VotesMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/extensions/draft-ERC721Votes.sol"; 6 | 7 | contract ERC721VotesMock is ERC721Votes { 8 | constructor(string memory name, string memory symbol) ERC721(name, symbol) EIP712(name, "1") {} 9 | 10 | function getTotalSupply() public view returns (uint256) { 11 | return _getTotalSupply(); 12 | } 13 | 14 | function mint(address account, uint256 tokenId) public { 15 | _mint(account, tokenId); 16 | } 17 | 18 | function burn(uint256 tokenId) public { 19 | _burn(tokenId); 20 | } 21 | 22 | function getChainId() external view returns (uint256) { 23 | return block.chainid; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract EtherReceiverMock { 6 | bool private _acceptEther; 7 | 8 | function setAcceptEther(bool acceptEther) public { 9 | _acceptEther = acceptEther; 10 | } 11 | 12 | receive() external payable { 13 | if (!_acceptEther) { 14 | revert(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/MulticallTokenMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Multicall.sol"; 6 | import "./ERC20Mock.sol"; 7 | 8 | contract MulticallTokenMock is ERC20Mock, Multicall { 9 | constructor(uint256 initialBalance) ERC20Mock("MulticallToken", "BCT", msg.sender, initialBalance) {} 10 | } 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/OwnableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../access/Ownable.sol"; 6 | 7 | contract OwnableMock is Ownable {} 8 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/Pausable.sol"; 6 | 7 | contract PausableMock is Pausable { 8 | bool public drasticMeasureTaken; 9 | uint256 public count; 10 | 11 | constructor() { 12 | drasticMeasureTaken = false; 13 | count = 0; 14 | } 15 | 16 | function normalProcess() external whenNotPaused { 17 | count++; 18 | } 19 | 20 | function drasticMeasure() external whenPaused { 21 | drasticMeasureTaken = true; 22 | } 23 | 24 | function pause() external { 25 | _pause(); 26 | } 27 | 28 | function unpause() external { 29 | _unpause(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/PullPaymentMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/PullPayment.sol"; 6 | 7 | // mock class using PullPayment 8 | contract PullPaymentMock is PullPayment { 9 | constructor() payable {} 10 | 11 | // test helper function to call asyncTransfer 12 | function callTransfer(address dest, uint256 amount) public { 13 | _asyncTransfer(dest, amount); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Context.sol"; 6 | 7 | contract ReentrancyAttack is Context { 8 | function callSender(bytes4 data) public { 9 | (bool success, ) = _msgSender().call(abi.encodeWithSelector(data)); 10 | require(success, "ReentrancyAttack: failed call"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/SignatureCheckerMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/SignatureChecker.sol"; 6 | 7 | contract SignatureCheckerMock { 8 | using SignatureChecker for address; 9 | 10 | function isValidSignatureNow( 11 | address signer, 12 | bytes32 hash, 13 | bytes memory signature 14 | ) public view returns (bool) { 15 | return signer.isValidSignatureNow(hash, signature); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/SignedMathMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/math/SignedMath.sol"; 6 | 7 | contract SignedMathMock { 8 | function max(int256 a, int256 b) public pure returns (int256) { 9 | return SignedMath.max(a, b); 10 | } 11 | 12 | function min(int256 a, int256 b) public pure returns (int256) { 13 | return SignedMath.min(a, b); 14 | } 15 | 16 | function average(int256 a, int256 b) public pure returns (int256) { 17 | return SignedMath.average(a, b); 18 | } 19 | 20 | function abs(int256 n) public pure returns (uint256) { 21 | return SignedMath.abs(n); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/SignedSafeMathMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/math/SignedSafeMath.sol"; 6 | 7 | contract SignedSafeMathMock { 8 | function mul(int256 a, int256 b) public pure returns (int256) { 9 | return SignedSafeMath.mul(a, b); 10 | } 11 | 12 | function div(int256 a, int256 b) public pure returns (int256) { 13 | return SignedSafeMath.div(a, b); 14 | } 15 | 16 | function sub(int256 a, int256 b) public pure returns (int256) { 17 | return SignedSafeMath.sub(a, b); 18 | } 19 | 20 | function add(int256 a, int256 b) public pure returns (int256) { 21 | return SignedSafeMath.add(a, b); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/mocks/StringsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Strings.sol"; 6 | 7 | contract StringsMock { 8 | function fromUint256(uint256 value) public pure returns (string memory) { 9 | return Strings.toString(value); 10 | } 11 | 12 | function fromUint256Hex(uint256 value) public pure returns (string memory) { 13 | return Strings.toHexString(value); 14 | } 15 | 16 | function fromUint256HexFixed(uint256 value, uint256 length) public pure returns (string memory) { 17 | return Strings.toHexString(value, length); 18 | } 19 | 20 | function fromAddressHexFixed(address addr) public pure returns (string memory) { 21 | return Strings.toHexString(addr); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev This is the interface that {BeaconProxy} expects of its beacon. 8 | */ 9 | interface IBeacon { 10 | /** 11 | * @dev Must return an address that can be used as a delegate call target. 12 | * 13 | * {BeaconProxy} will check that this address is a contract. 14 | */ 15 | function implementation() external view returns (address); 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/security/README.adoc: -------------------------------------------------------------------------------- 1 | = Security 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/security 5 | 6 | These contracts aim to cover common security practices. 7 | 8 | * {PullPayment}: A pattern that can be used to avoid reentrancy attacks. 9 | * {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions. 10 | * {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending. 11 | 12 | TIP: For an overview on reentrancy and the possible mechanisms to prevent it, read our article https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. 13 | 14 | == Contracts 15 | 16 | {{PullPayment}} 17 | 18 | {{ReentrancyGuard}} 19 | 20 | {{Pausable}} 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155.sol"; 7 | 8 | /** 9 | * @dev Interface of the optional ERC1155MetadataExtension interface, as defined 10 | * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. 11 | * 12 | * _Available since v3.1._ 13 | */ 14 | interface IERC1155MetadataURI is IERC1155 { 15 | /** 16 | * @dev Returns the URI for token type `id`. 17 | * 18 | * If the `\{id\}` substring is present in the URI, it must be replaced by 19 | * clients with the actual token type ID. 20 | */ 21 | function uri(uint256 id) external view returns (string memory); 22 | } 23 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/token/ERC1155/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC1155Receiver.sol"; 7 | import "../../../utils/introspection/ERC165.sol"; 8 | 9 | /** 10 | * @dev _Available since v3.1._ 11 | */ 12 | abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { 13 | /** 14 | * @dev See {IERC165-supportsInterface}. 15 | */ 16 | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { 17 | return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/token/ERC20/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/token/ERC721/presets/README.md: -------------------------------------------------------------------------------- 1 | Contract presets are now deprecated in favor of [Contracts Wizard](https://wizard.openzeppelin.com/) as a more powerful alternative. 2 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/token/common/README.adoc: -------------------------------------------------------------------------------- 1 | = Common (Tokens) 2 | 3 | Functionality that is common to multiple token standards. 4 | 5 | * {ERC2981}: NFT Royalties compatible with both ERC721 and ERC1155. 6 | ** For ERC721 consider {ERC721Royalty} which clears the royalty information from storage on burn. 7 | 8 | == Contracts 9 | 10 | {{ERC2981}} 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/contracts/vendor/polygon/IFxMessageProcessor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.6.0) (vendor/polygon/IFxMessageProcessor.sol) 3 | pragma solidity ^0.8.0; 4 | 5 | interface IFxMessageProcessor { 6 | function processMessageFromRoot( 7 | uint256 stateId, 8 | address rootMessageSender, 9 | bytes calldata data 10 | ) external; 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/hardhat/env-contract.js: -------------------------------------------------------------------------------- 1 | extendEnvironment(env => { 2 | const { contract } = env; 3 | 4 | env.contract = function (name, body) { 5 | // remove the default account from the accounts list used in tests, in order 6 | // to protect tests against accidentally passing due to the contract 7 | // deployer being used subsequently as function caller 8 | contract(name, accounts => body(accounts.slice(1))); 9 | }; 10 | }); 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/permit2/lib/openzeppelin-contracts/migrations/.gitkeep -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run docs" 3 | publish = "build/site" 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "github>OpenZeppelin/code-style" 4 | ], 5 | "packageRules": [ 6 | { 7 | "extends": ["packages:eslint"], 8 | "enabled": false 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/checks/generation.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | npm run generate 6 | git diff -R --exit-code 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/generate/format-lines.js: -------------------------------------------------------------------------------- 1 | function formatLines (...lines) { 2 | return [...indentEach(0, lines)].join('\n') + '\n'; 3 | } 4 | 5 | function *indentEach (indent, lines) { 6 | for (const line of lines) { 7 | if (Array.isArray(line)) { 8 | yield * indentEach(indent + 1, line); 9 | } else { 10 | const padding = ' '.repeat(indent); 11 | yield * line.split('\n').map(subline => subline === '' ? '' : padding + subline); 12 | } 13 | } 14 | } 15 | 16 | module.exports = formatLines; 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/git-user-config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail -x 4 | 5 | git config user.name 'github-actions' 6 | git config user.email '41898282+github-actions[bot]@users.noreply.github.com' 7 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/helpers.js: -------------------------------------------------------------------------------- 1 | function chunk (array, size = 1) { 2 | return Array.range(Math.ceil(array.length / size)).map(i => array.slice(i * size, i * size + size)); 3 | } 4 | 5 | function range (start, stop = undefined, step = 1) { 6 | if (!stop) { stop = start; start = 0; } 7 | return start < stop ? Array(Math.ceil((stop - start) / step)).fill().map((_, i) => start + i * step) : []; 8 | } 9 | 10 | function unique (array, op = x => x) { 11 | return array.filter((obj, i) => array.findIndex(entry => op(obj) === op(entry)) === i); 12 | } 13 | 14 | function zip (...args) { 15 | return Array(Math.max(...args.map(arg => arg.length))).fill(null).map((_, i) => args.map(arg => arg[i])); 16 | } 17 | 18 | module.exports = { 19 | chunk, 20 | range, 21 | unique, 22 | zip, 23 | }; 24 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/prepack.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | shopt -s globstar 5 | 6 | # cross platform `mkdir -p` 7 | node -e 'fs.mkdirSync("build/contracts", { recursive: true })' 8 | 9 | cp artifacts/contracts/**/*.json build/contracts 10 | rm build/contracts/*.dbg.json 11 | 12 | node scripts/remove-ignored-artifacts.js 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/prepare-contracts-package.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # cd to the root of the repo 4 | cd "$(git rev-parse --show-toplevel)" 5 | 6 | # avoids re-compilation during publishing of both packages 7 | if [[ ! -v ALREADY_COMPILED ]]; then 8 | npm run clean 9 | npm run prepare 10 | npm run prepack 11 | fi 12 | 13 | cp README.md contracts/ 14 | mkdir contracts/build contracts/build/contracts 15 | cp -r build/contracts/*.json contracts/build/contracts 16 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/prepare-docs-solc.js: -------------------------------------------------------------------------------- 1 | const hre = require('hardhat'); 2 | 3 | const { getCompilersDir } = require('hardhat/internal/util/global-dir'); 4 | const { CompilerDownloader } = require('hardhat/internal/solidity/compiler/downloader'); 5 | const { Compiler } = require('hardhat/internal/solidity/compiler'); 6 | 7 | const [{ version }] = hre.config.solidity.compilers; 8 | 9 | async function getSolc () { 10 | const downloader = new CompilerDownloader(await getCompilersDir(), { forceSolcJs: true }); 11 | const { compilerPath } = await downloader.getDownloadedCompilerPath(version); 12 | const compiler = new Compiler(compilerPath); 13 | return compiler.getSolc(); 14 | } 15 | 16 | module.exports = Object.assign(getSolc(), { __esModule: true }); 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/prepare-docs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | 5 | OUTDIR=docs/modules/api/pages/ 6 | 7 | if [ ! -d node_modules ]; then 8 | npm ci 9 | fi 10 | 11 | rm -rf "$OUTDIR" 12 | 13 | solidity-docgen \ 14 | -t docs \ 15 | -o "$OUTDIR" \ 16 | -e contracts/mocks,contracts/examples \ 17 | --output-structure readmes \ 18 | --helpers ./docs/helpers.js \ 19 | --solc-module ./scripts/prepare-docs-solc.js 20 | 21 | rm -f "$OUTDIR"/token/*/presets.md 22 | 23 | node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc" 24 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | if [ "${SKIP_COMPILE:-}" == true ]; then 6 | exit 7 | fi 8 | 9 | npm run clean 10 | env COMPILE_MODE=production npm run compile 11 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/release/synchronize-versions.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Synchronizes the version in contracts/package.json with the one in package.json. 4 | // This is run automatically when npm version is run. 5 | 6 | const fs = require('fs'); 7 | const cp = require('child_process'); 8 | 9 | setVersion('contracts/package.json'); 10 | 11 | function setVersion (file) { 12 | const json = JSON.parse(fs.readFileSync(file)); 13 | json.version = process.env.npm_package_version; 14 | fs.writeFileSync(file, JSON.stringify(json, null, 2) + '\n'); 15 | cp.execFileSync('git', ['add', file]); 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/scripts/release/version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | 5 | scripts/release/update-changelog-release-date.js 6 | scripts/release/synchronize-versions.js 7 | scripts/release/update-comment.js 8 | 9 | oz-docs update-version 10 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/slither.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "detectors_to_run": "reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas", 3 | "filter_paths": "contracts/mocks" 4 | } -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/TESTING.md: -------------------------------------------------------------------------------- 1 | ## Testing 2 | 3 | Unit test are critical to OpenZeppelin Contracts. They help ensure code quality and mitigate against security vulnerabilities. The directory structure within the `/test` directory corresponds to the `/contracts` directory. 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/access/AccessControl.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeAccessControl, 3 | } = require('./AccessControl.behavior.js'); 4 | 5 | const AccessControlMock = artifacts.require('AccessControlMock'); 6 | 7 | contract('AccessControl', function (accounts) { 8 | beforeEach(async function () { 9 | this.accessControl = await AccessControlMock.new({ from: accounts[0] }); 10 | }); 11 | 12 | shouldBehaveLikeAccessControl('AccessControl', ...accounts); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/access/AccessControlEnumerable.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeAccessControl, 3 | shouldBehaveLikeAccessControlEnumerable, 4 | } = require('./AccessControl.behavior.js'); 5 | 6 | const AccessControlMock = artifacts.require('AccessControlEnumerableMock'); 7 | 8 | contract('AccessControl', function (accounts) { 9 | beforeEach(async function () { 10 | this.accessControl = await AccessControlMock.new({ from: accounts[0] }); 11 | }); 12 | 13 | shouldBehaveLikeAccessControl('AccessControl', ...accounts); 14 | shouldBehaveLikeAccessControlEnumerable('AccessControl', ...accounts); 15 | }); 16 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/helpers/create2.js: -------------------------------------------------------------------------------- 1 | function computeCreate2Address (saltHex, bytecode, deployer) { 2 | return web3.utils.toChecksumAddress(`0x${web3.utils.sha3(`0x${[ 3 | 'ff', 4 | deployer, 5 | saltHex, 6 | web3.utils.soliditySha3(bytecode), 7 | ].map(x => x.replace(/0x/, '')).join('')}`).slice(-40)}`); 8 | } 9 | 10 | module.exports = { 11 | computeCreate2Address, 12 | }; 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/helpers/enums.js: -------------------------------------------------------------------------------- 1 | const { BN } = require('@openzeppelin/test-helpers'); 2 | 3 | function Enum (...options) { 4 | return Object.fromEntries(options.map((key, i) => [ key, new BN(i) ])); 5 | } 6 | 7 | module.exports = { 8 | Enum, 9 | ProposalState: Enum( 10 | 'Pending', 11 | 'Active', 12 | 'Canceled', 13 | 'Defeated', 14 | 'Succeeded', 15 | 'Queued', 16 | 'Expired', 17 | 'Executed', 18 | ), 19 | VoteType: Enum( 20 | 'Against', 21 | 'For', 22 | 'Abstain', 23 | ), 24 | Rounding: Enum( 25 | 'Down', 26 | 'Up', 27 | 'Zero', 28 | ), 29 | }; 30 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/helpers/erc1967.js: -------------------------------------------------------------------------------- 1 | const ImplementationLabel = 'eip1967.proxy.implementation'; 2 | const AdminLabel = 'eip1967.proxy.admin'; 3 | const BeaconLabel = 'eip1967.proxy.beacon'; 4 | 5 | function labelToSlot (label) { 6 | return '0x' + web3.utils.toBN(web3.utils.keccak256(label)).subn(1).toString(16); 7 | } 8 | 9 | function getSlot (address, slot) { 10 | return web3.eth.getStorageAt( 11 | web3.utils.isAddress(address) ? address : address.address, 12 | web3.utils.isHex(slot) ? slot : labelToSlot(slot), 13 | ); 14 | } 15 | 16 | module.exports = { 17 | ImplementationLabel, 18 | AdminLabel, 19 | BeaconLabel, 20 | ImplementationSlot: labelToSlot(ImplementationLabel), 21 | AdminSlot: labelToSlot(AdminLabel), 22 | BeaconSlot: labelToSlot(BeaconLabel), 23 | getSlot, 24 | }; 25 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/proxy/ERC1967/ERC1967Proxy.test.js: -------------------------------------------------------------------------------- 1 | const shouldBehaveLikeProxy = require('../Proxy.behaviour'); 2 | 3 | const ERC1967Proxy = artifacts.require('ERC1967Proxy'); 4 | 5 | contract('ERC1967Proxy', function (accounts) { 6 | const [proxyAdminOwner] = accounts; 7 | 8 | const createProxy = async function (implementation, _admin, initData, opts) { 9 | return ERC1967Proxy.new(implementation, initData, opts); 10 | }; 11 | 12 | shouldBehaveLikeProxy(createProxy, undefined, proxyAdminOwner); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/proxy/transparent/TransparentUpgradeableProxy.test.js: -------------------------------------------------------------------------------- 1 | const shouldBehaveLikeProxy = require('../Proxy.behaviour'); 2 | const shouldBehaveLikeTransparentUpgradeableProxy = require('./TransparentUpgradeableProxy.behaviour'); 3 | 4 | const TransparentUpgradeableProxy = artifacts.require('TransparentUpgradeableProxy'); 5 | 6 | contract('TransparentUpgradeableProxy', function (accounts) { 7 | const [proxyAdminAddress, proxyAdminOwner] = accounts; 8 | 9 | const createProxy = async function (logic, admin, initData, opts) { 10 | return TransparentUpgradeableProxy.new(logic, admin, initData, opts); 11 | }; 12 | 13 | shouldBehaveLikeProxy(createProxy, proxyAdminAddress, proxyAdminOwner); 14 | shouldBehaveLikeTransparentUpgradeableProxy(createProxy, accounts); 15 | }); 16 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Burnable.test.js: -------------------------------------------------------------------------------- 1 | const { BN } = require('@openzeppelin/test-helpers'); 2 | 3 | const { shouldBehaveLikeERC20Burnable } = require('./ERC20Burnable.behavior'); 4 | const ERC20BurnableMock = artifacts.require('ERC20BurnableMock'); 5 | 6 | contract('ERC20Burnable', function (accounts) { 7 | const [ owner, ...otherAccounts ] = accounts; 8 | 9 | const initialBalance = new BN(1000); 10 | 11 | const name = 'My Token'; 12 | const symbol = 'MTKN'; 13 | 14 | beforeEach(async function () { 15 | this.token = await ERC20BurnableMock.new(name, symbol, owner, initialBalance, { from: owner }); 16 | }); 17 | 18 | shouldBehaveLikeERC20Burnable(owner, initialBalance, otherAccounts); 19 | }); 20 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/token/ERC721/ERC721.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeERC721, 3 | shouldBehaveLikeERC721Metadata, 4 | } = require('./ERC721.behavior'); 5 | 6 | const ERC721Mock = artifacts.require('ERC721Mock'); 7 | 8 | contract('ERC721', function (accounts) { 9 | const name = 'Non Fungible Token'; 10 | const symbol = 'NFT'; 11 | 12 | beforeEach(async function () { 13 | this.token = await ERC721Mock.new(name, symbol); 14 | }); 15 | 16 | shouldBehaveLikeERC721('ERC721', ...accounts); 17 | shouldBehaveLikeERC721Metadata('ERC721', name, symbol, ...accounts); 18 | }); 19 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/token/ERC721/ERC721Enumerable.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeERC721, 3 | shouldBehaveLikeERC721Metadata, 4 | shouldBehaveLikeERC721Enumerable, 5 | } = require('./ERC721.behavior'); 6 | 7 | const ERC721Mock = artifacts.require('ERC721EnumerableMock'); 8 | 9 | contract('ERC721Enumerable', function (accounts) { 10 | const name = 'Non Fungible Token'; 11 | const symbol = 'NFT'; 12 | 13 | beforeEach(async function () { 14 | this.token = await ERC721Mock.new(name, symbol); 15 | }); 16 | 17 | shouldBehaveLikeERC721('ERC721', ...accounts); 18 | shouldBehaveLikeERC721Metadata('ERC721', name, symbol, ...accounts); 19 | shouldBehaveLikeERC721Enumerable('ERC721', ...accounts); 20 | }); 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/utils/Context.test.js: -------------------------------------------------------------------------------- 1 | require('@openzeppelin/test-helpers'); 2 | 3 | const ContextMock = artifacts.require('ContextMock'); 4 | const ContextMockCaller = artifacts.require('ContextMockCaller'); 5 | 6 | const { shouldBehaveLikeRegularContext } = require('./Context.behavior'); 7 | 8 | contract('Context', function (accounts) { 9 | const [ sender ] = accounts; 10 | 11 | beforeEach(async function () { 12 | this.context = await ContextMock.new(); 13 | this.caller = await ContextMockCaller.new(); 14 | }); 15 | 16 | shouldBehaveLikeRegularContext(sender); 17 | }); 18 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/utils/escrow/Escrow.test.js: -------------------------------------------------------------------------------- 1 | require('@openzeppelin/test-helpers'); 2 | const { shouldBehaveLikeEscrow } = require('./Escrow.behavior'); 3 | 4 | const Escrow = artifacts.require('Escrow'); 5 | 6 | contract('Escrow', function (accounts) { 7 | const [ owner, ...otherAccounts ] = accounts; 8 | 9 | beforeEach(async function () { 10 | this.escrow = await Escrow.new({ from: owner }); 11 | }); 12 | 13 | shouldBehaveLikeEscrow(owner, otherAccounts); 14 | }); 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/openzeppelin-contracts/test/utils/introspection/ERC165.test.js: -------------------------------------------------------------------------------- 1 | const { shouldSupportInterfaces } = require('./SupportsInterface.behavior'); 2 | 3 | const ERC165Mock = artifacts.require('ERC165Mock'); 4 | 5 | contract('ERC165', function (accounts) { 6 | beforeEach(async function () { 7 | this.mock = await ERC165Mock.new(); 8 | }); 9 | 10 | shouldSupportInterfaces([ 11 | 'ERC165', 12 | ]); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | .gas-snapshot linguist-language=Julia -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Describe the changes made in your pull request here. 4 | 5 | ## Checklist 6 | 7 | Ensure you completed **all of the steps** below before submitting your pull request: 8 | 9 | - [ ] Ran `forge snapshot`? 10 | - [ ] Ran `npm run lint`? 11 | - [ ] Ran `forge test`? 12 | 13 | _Pull requests with an incomplete checklist will be thrown out._ 14 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.gitignore: -------------------------------------------------------------------------------- 1 | /cache 2 | /node_modules 3 | /out -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/ds-test"] 2 | path = lib/ds-test 3 | url = https://github.com/dapphub/ds-test 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.prettierignore: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "printWidth": 100, 4 | 5 | "overrides": [ 6 | { 7 | "files": "*.sol", 8 | "options": { 9 | "tabWidth": 4, 10 | "printWidth": 120 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "solidity.packageDefaultDependenciesContractsDirectory": "src", 3 | "solidity.packageDefaultDependenciesDirectory": "lib", 4 | "solidity.compileUsingRemoteVersion": "v0.8.15", 5 | "search.exclude": { "lib": true }, 6 | "files.associations": { 7 | ".gas-snapshot": "julia" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/audits/v6-Fixed-Point-Solutions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmphorProtocol/asynchronous-vault/3a3b17fe28b864af7904e39e044db0df418728fa/lib/permit2/lib/solmate/audits/v6-Fixed-Point-Solutions.pdf -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | solc = "0.8.15" 3 | bytecode_hash = "none" 4 | optimizer_runs = 1000000 5 | 6 | [profile.intense.fuzz] 7 | runs = 10000 8 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/lib/ds-test/Makefile: -------------------------------------------------------------------------------- 1 | all:; dapp build 2 | 3 | test: 4 | -dapp --use solc:0.4.23 build 5 | -dapp --use solc:0.4.26 build 6 | -dapp --use solc:0.5.17 build 7 | -dapp --use solc:0.6.12 build 8 | -dapp --use solc:0.7.5 build 9 | 10 | demo: 11 | DAPP_SRC=demo dapp --use solc:0.7.5 build 12 | -hevm dapp-test --verbose 3 13 | 14 | .PHONY: test demo 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/lib/ds-test/default.nix: -------------------------------------------------------------------------------- 1 | { solidityPackage, dappsys }: solidityPackage { 2 | name = "ds-test"; 3 | src = ./src; 4 | } 5 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solmate", 3 | "license": "AGPL-3.0-only", 4 | "version": "6.6.2", 5 | "description": "Modern, opinionated and gas optimized building blocks for smart contract development.", 6 | "files": [ 7 | "src/**/*.sol" 8 | ], 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/transmissions11/solmate.git" 12 | }, 13 | "devDependencies": { 14 | "prettier": "^2.3.1", 15 | "prettier-plugin-solidity": "^1.0.0-beta.13" 16 | }, 17 | "scripts": { 18 | "lint": "prettier --write **.sol" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/test/utils/DSInvariantTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | contract DSInvariantTest { 5 | address[] private targets; 6 | 7 | function targetContracts() public view virtual returns (address[] memory) { 8 | require(targets.length > 0, "NO_TARGET_CONTRACTS"); 9 | 10 | return targets; 11 | } 12 | 13 | function addTargetContract(address newTargetContract) internal virtual { 14 | targets.push(newTargetContract); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/test/utils/mocks/MockAuthChild.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | import {Auth, Authority} from "../../../auth/Auth.sol"; 5 | 6 | contract MockAuthChild is Auth(msg.sender, Authority(address(0))) { 7 | bool public flag; 8 | 9 | function updateFlag() public virtual requiresAuth { 10 | flag = true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/test/utils/mocks/MockAuthority.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | import {Authority} from "../../../auth/Auth.sol"; 5 | 6 | contract MockAuthority is Authority { 7 | bool immutable allowCalls; 8 | 9 | constructor(bool _allowCalls) { 10 | allowCalls = _allowCalls; 11 | } 12 | 13 | function canCall( 14 | address, 15 | address, 16 | bytes4 17 | ) public view override returns (bool) { 18 | return allowCalls; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/test/utils/mocks/MockERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | import {ERC20} from "../../../tokens/ERC20.sol"; 5 | 6 | contract MockERC20 is ERC20 { 7 | constructor( 8 | string memory _name, 9 | string memory _symbol, 10 | uint8 _decimals 11 | ) ERC20(_name, _symbol, _decimals) {} 12 | 13 | function mint(address to, uint256 value) public virtual { 14 | _mint(to, value); 15 | } 16 | 17 | function burn(address from, uint256 value) public virtual { 18 | _burn(from, value); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/test/utils/mocks/MockOwned.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | import {Owned} from "../../../auth/Owned.sol"; 5 | 6 | contract MockOwned is Owned(msg.sender) { 7 | bool public flag; 8 | 9 | function updateFlag() public virtual onlyOwner { 10 | flag = true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/utils/Bytes32AddressLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | /// @notice Library for converting between addresses and bytes32 values. 5 | /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Bytes32AddressLib.sol) 6 | library Bytes32AddressLib { 7 | function fromLast20Bytes(bytes32 bytesValue) internal pure returns (address) { 8 | return address(uint160(uint256(bytesValue))); 9 | } 10 | 11 | function fillLast12Bytes(address addressValue) internal pure returns (bytes32) { 12 | return bytes32(bytes20(addressValue)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/permit2/lib/solmate/src/utils/ReentrancyGuard.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.8.0; 3 | 4 | /// @notice Gas optimized reentrancy protection for smart contracts. 5 | /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol) 6 | /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol) 7 | abstract contract ReentrancyGuard { 8 | uint256 private locked = 1; 9 | 10 | modifier nonReentrant() virtual { 11 | require(locked == 1, "REENTRANCY"); 12 | 13 | locked = 2; 14 | 15 | _; 16 | 17 | locked = 1; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/permit2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@uniswap/permit2", 3 | "description": "Low-overhead, next generation token approval/meta-tx system to make token approvals easier, more secure, and more consistent across applications", 4 | "version": "1.0.0", 5 | "bugs": "https://github.com/Uniswap/permit2/issues", 6 | "keywords": [ 7 | "ethereum", 8 | "permit2", 9 | "uniswap" 10 | ], 11 | "license": "MIT", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/Uniswap/permit2.git" 15 | } 16 | } -------------------------------------------------------------------------------- /lib/permit2/remappings.txt: -------------------------------------------------------------------------------- 1 | solmate/=lib/solmate 2 | -------------------------------------------------------------------------------- /lib/permit2/script/DeployPermit2.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.15; 3 | 4 | import "forge-std/console2.sol"; 5 | import "forge-std/Script.sol"; 6 | import {Permit2} from "src/Permit2.sol"; 7 | 8 | bytes32 constant SALT = bytes32(uint256(0x0000000000000000000000000000000000000000d3af2663da51c10215000000)); 9 | 10 | contract DeployPermit2 is Script { 11 | function setUp() public {} 12 | 13 | function run() public returns (Permit2 permit2) { 14 | vm.startBroadcast(); 15 | 16 | permit2 = new Permit2{salt: SALT}(); 17 | console2.log("Permit2 Deployed:", address(permit2)); 18 | 19 | vm.stopBroadcast(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/permit2/src/Permit2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.17; 3 | 4 | import {SignatureTransfer} from "./SignatureTransfer.sol"; 5 | import {AllowanceTransfer} from "./AllowanceTransfer.sol"; 6 | 7 | /// @notice Permit2 handles signature-based transfers in SignatureTransfer and allowance-based transfers in AllowanceTransfer. 8 | /// @dev Users must approve Permit2 before calling any of the transfer functions. 9 | contract Permit2 is SignatureTransfer, AllowanceTransfer { 10 | // Permit2 unifies the two contracts so users have maximal flexibility with their approval. 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/src/PermitErrors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.17; 3 | 4 | /// @notice Shared errors between signature based transfers and allowance based transfers. 5 | 6 | /// @notice Thrown when validating an inputted signature that is stale 7 | /// @param signatureDeadline The timestamp at which a signature is no longer valid 8 | error SignatureExpired(uint256 signatureDeadline); 9 | 10 | /// @notice Thrown when validating that the inputted nonce has not been used 11 | error InvalidNonce(); 12 | -------------------------------------------------------------------------------- /lib/permit2/src/interfaces/IEIP712.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IEIP712 { 5 | function DOMAIN_SEPARATOR() external view returns (bytes32); 6 | } 7 | -------------------------------------------------------------------------------- /lib/permit2/src/interfaces/IERC1271.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IERC1271 { 5 | /// @dev Should return whether the signature provided is valid for the provided data 6 | /// @param hash Hash of the data to be signed 7 | /// @param signature Signature byte array associated with _data 8 | /// @return magicValue The bytes4 magic value 0x1626ba7e 9 | function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); 10 | } 11 | -------------------------------------------------------------------------------- /lib/permit2/src/interfaces/IPermit2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import {ISignatureTransfer} from "./ISignatureTransfer.sol"; 5 | import {IAllowanceTransfer} from "./IAllowanceTransfer.sol"; 6 | 7 | /// @notice Permit2 handles signature-based transfers in SignatureTransfer and allowance-based transfers in AllowanceTransfer. 8 | /// @dev Users must approve Permit2 before calling any of the transfer functions. 9 | interface IPermit2 is ISignatureTransfer, IAllowanceTransfer { 10 | // IPermit2 unifies the two interfaces so users have maximal flexibility with their approval. 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/src/libraries/SafeCast160.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | library SafeCast160 { 5 | /// @notice Thrown when a valude greater than type(uint160).max is cast to uint160 6 | error UnsafeCast(); 7 | 8 | /// @notice Safely casts uint256 to uint160 9 | /// @param value The uint256 to be cast 10 | function toUint160(uint256 value) internal pure returns (uint160) { 11 | if (value > type(uint160).max) revert UnsafeCast(); 12 | return uint160(value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/permit2/test/actors/Spender.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.8.17; 2 | 3 | import {Test} from "forge-std/Test.sol"; 4 | import {Permit2} from "../../src/Permit2.sol"; 5 | import {MockERC20} from "../mocks/MockERC20.sol"; 6 | 7 | contract Spender is Test { 8 | Permit2 private immutable permit2; 9 | MockERC20 private immutable token; 10 | 11 | uint256 public amountSpent; 12 | 13 | constructor(Permit2 _permit2, MockERC20 _token) { 14 | permit2 = _permit2; 15 | token = _token; 16 | } 17 | 18 | function spendPermit(uint160 amount, address from) public { 19 | permit2.transferFrom(from, address(this), amount, address(token)); 20 | amountSpent += amount; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/DAI.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract DAITest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/FeeOnTransferToken.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract FeeOnTransferTokenTest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0xF5238462E7235c7B62811567E63Dd17d12C2EAA0); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/RebasingToken.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract RebasingTokenTest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0xD46bA6D942050d489DBd938a2C909A5d5039A161); 10 | } 11 | 12 | function dealTokens(address to, uint256 amount) internal override { 13 | // large holder 14 | vm.prank(0xc3a947372191453Dd9dB02B0852d378dCCBDf271); 15 | token().transfer(to, amount); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/UNI.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract UNITest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/USDC.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract USDCTest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/USDT.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {SafeTransferLib} from "solmate/src/utils/SafeTransferLib.sol"; 5 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 6 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 7 | 8 | contract USDTTest is MainnetTokenTest { 9 | using SafeTransferLib for ERC20; 10 | 11 | function token() internal pure override returns (ERC20) { 12 | return ERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/WBTC.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract WBTCTest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/test/integration/tokens/ZRX.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | import {MainnetTokenTest} from "../MainnetToken.t.sol"; 6 | 7 | contract ZRXTest is MainnetTokenTest { 8 | function token() internal pure override returns (ERC20) { 9 | return ERC20(0xE41d2489571d322189246DaFA5ebDe1F4699F498); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/permit2/test/mocks/MockERC1155.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC1155} from "solmate/src/tokens/ERC1155.sol"; 5 | 6 | contract MockERC1155 is ERC1155 { 7 | constructor() ERC1155() {} 8 | 9 | function mint(address to, uint256 id, uint256 amount) public { 10 | _mint(to, id, amount, ""); 11 | } 12 | 13 | function uri(uint256) public view virtual override returns (string memory) { 14 | return ""; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/test/mocks/MockERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC20} from "solmate/src/tokens/ERC20.sol"; 5 | 6 | contract MockERC20 is ERC20 { 7 | constructor(string memory name, string memory symbol, uint8 decimals) ERC20(name, symbol, decimals) {} 8 | 9 | function mint(address _to, uint256 _amount) public { 10 | _mint(_to, _amount); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/test/mocks/MockERC721.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {ERC721} from "solmate/src/tokens/ERC721.sol"; 5 | 6 | contract MockERC721 is ERC721 { 7 | constructor(string memory name, string memory symbol) ERC721(name, symbol) {} 8 | 9 | function mint(address to, uint256 id) public { 10 | _mint(to, id); 11 | } 12 | 13 | function tokenURI(uint256) public view virtual override returns (string memory) { 14 | return ""; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/permit2/test/mocks/MockNonPermitERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol"; 5 | 6 | contract MockNonPermitERC20 is MockERC20 { 7 | constructor(string memory _name, string memory _symbol, uint8 _decimals) MockERC20(_name, _symbol, _decimals) {} 8 | 9 | function DOMAIN_SEPARATOR() public pure override returns (bytes32) { 10 | return 0; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/permit2/test/mocks/MockNonPermitNonERC20WithDS.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | contract MockNonPermitNonERC20WithDS { 5 | function DOMAIN_SEPARATOR() external pure returns (bytes memory) { 6 | bytes memory returnData = "123456789012345678901234567890123"; 7 | require(returnData.length == 33); 8 | return returnData; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/permit2/test/mocks/MockSignatureVerification.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | import {SignatureVerification} from "../../src/libraries/SignatureVerification.sol"; 5 | 6 | contract MockSignatureVerification { 7 | function verify(bytes calldata sig, bytes32 hashed, address signer) public view { 8 | SignatureVerification.verify(sig, hashed, signer); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/permit2/test/utils/AddressBuilder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.17; 3 | 4 | library AddressBuilder { 5 | function fill(uint256 length, address a) external pure returns (address[] memory addresses) { 6 | addresses = new address[](length); 7 | for (uint256 i = 0; i < length; ++i) { 8 | addresses[i] = a; 9 | } 10 | } 11 | 12 | function push(address[] calldata a, address b) external pure returns (address[] memory addresses) { 13 | addresses = new address[](a.length + 1); 14 | for (uint256 i = 0; i < a.length; ++i) { 15 | addresses[i] = a[i]; 16 | } 17 | addresses[a.length] = b; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/interfaces/ERC7540Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity 0.8.21; 3 | 4 | interface ERC7540Receiver { 5 | function onERC7540DepositReceived( 6 | address operator, 7 | address owner, 8 | uint256 requestId, 9 | uint256 assets, 10 | bytes memory data 11 | ) 12 | external 13 | returns (bytes4); 14 | 15 | function onERC7540RedeemReceived( 16 | address operator, 17 | address owner, 18 | uint256 requestId, 19 | uint256 shares, 20 | bytes memory data 21 | ) 22 | external 23 | returns (bytes4); 24 | } 25 | -------------------------------------------------------------------------------- /src/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | interface IERC165 { 5 | /// @notice Checks if a contract implements an interface. 6 | /// @param interfaceId The interface identifier, as specified in ERC-165. 7 | /// @return supported True if the contract implements `interfaceId` and 8 | /// `interfaceId` is not 0xffffffff, false otherwise. 9 | function supportsInterface(bytes4 interfaceId) 10 | external 11 | view 12 | returns (bool supported); 13 | } 14 | -------------------------------------------------------------------------------- /test/Zapper/VaultZapperManagementImplementations.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity 0.8.21; 3 | 4 | import "./ZapperManagement.t.sol"; 5 | 6 | contract VaultZapperManagementWSTETH is VaultZapperManagement { 7 | constructor() VaultZapperManagement(_WSTETH) { } 8 | } 9 | 10 | contract VaultZapperManagementWBTC is VaultZapperManagement { 11 | constructor() VaultZapperManagement(_WBTC) { } 12 | } 13 | 14 | contract VaultZapperManagementUSDC is VaultZapperManagement { 15 | constructor() VaultZapperManagement(_USDC) { } 16 | } 17 | -------------------------------------------------------------------------------- /test/echidna.config.yaml: -------------------------------------------------------------------------------- 1 | corpusDir: "tests/echidna-corpus" 2 | testMode: assertion 3 | testLimit: 10000 4 | deployer: "0x10000" 5 | sender: ["0x10000"] 6 | -------------------------------------------------------------------------------- /test/testsRules.md: -------------------------------------------------------------------------------- 1 | # This file contains the tests rules. 2 | You can add new rules below. 3 | 4 | - Global vault values and specific vault global values should be in separate 5 | contracts. 6 | - Global `ERC20` assets should be as much as possible casted as `ERC20` (instead 7 | of `address` or `IERC20`) in order to simplify the business logic and contain 8 | some `IERC20` code extension like `IERC20Metadata`. 9 | - Tests should contains a specific tests contract for each production contract, 10 | specific(s) contract(s) for properties, and specific(s) contract(s) for basics 11 | scenarios. 12 | -------------------------------------------------------------------------------- /test/unit/concrete/sol/TestEpochId.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity 0.8.21; 3 | 4 | import { TestBase } from "../../../Base.t.sol"; 5 | 6 | contract TestEpochId is TestBase { 7 | function test_GivenEpochIdEquals10GivenRequestIdEquals10WhenIsCurrentEpoch() 8 | external 9 | { 10 | // it should not revert 11 | // it should returns true 12 | usersDealApproveAndDeposit(vaultTested, 1); 13 | for (uint256 i = 1; i < 11; i++) { 14 | close(vaultTested); 15 | uint256 epochId = vaultTested.epochId(); 16 | assertEq(epochId, i, "isCurrentEpoch"); 17 | assertOpen(vaultTested, 0); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/unit/concrete/sol/TestFees.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity 0.8.21; 3 | 4 | import { TestBase, SyncVault, IERC20 } from "../../../Base.t.sol"; 5 | import { PausableUpgradeable } from 6 | "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; 7 | 8 | contract TestClaimAndRequestDeposit is TestBase { 9 | function test_perfFeesOver30() public { 10 | vm.startPrank(amphorLabs); 11 | vm.expectRevert(SyncVault.FeesTooHigh.selector); 12 | vaultTested.setFee(31 * 100); 13 | vm.stopPrank(); 14 | } 15 | 16 | function test_perfFeesUnder30() public { 17 | vm.startPrank(amphorLabs); 18 | vaultTested.setFee(30 * 100); 19 | assertEq(vaultTested.feesInBps(), 30 * 100); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestClaimableDepositRequest.tree: -------------------------------------------------------------------------------- 1 | TestClaimableDepositRequest 2 | ├── given an owner who has not interacted with the vault when claimableDepositRequest 3 | │ └── it should return 0 4 | ├── given an owner with a pending request when claimableDepositRequest 5 | │ └── it should return 0 6 | └── given an owner with a claimable request when claimableDepositRequest 7 | ├── it should return the amount of the claimable request 8 | └── it should not revert 9 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestClose.tree: -------------------------------------------------------------------------------- 1 | TestClose 2 | ├── given vault is closed when close 3 | │ └── it should revert with VaultIsClosed 4 | ├── given msgSender is not owner when close 5 | │ └── it should revert with OwnableUnauthorizedAccount(msg.sender) 6 | ├── given totalsAssets is x when open 7 | │ └── it should increase owner's underlying balance by x 8 | └── when close succeed 9 | ├── it should set isOpen to false 10 | ├── it should emit EpochStart(block.timestamp, _totalAssets, totalSupply()) 11 | ├── it should verify totalAssets == totalsAssetsBefore 12 | └── it should verify totalSupply == totalSupplyBefore 13 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestIsCurrentEpoch.tree: -------------------------------------------------------------------------------- 1 | TestIsCurrentEpoch 2 | ├── given epochId equals 10 given requestId equals 10 when isCurrentEpoch 3 | │ └── it should not revert 4 | │ └── it should returns true 5 | ├── given epochId equals 10 given requestId equals 9 when isCurrentEpoch 6 | │ ├── it should not revert 7 | │ └── it should returns false 8 | └── given epochId equals 9 given requestId equals 10 when isCurrentEpoch 9 | ├── it should not revert 10 | └── it should returns false 11 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestMaxDepositRequest.tree: -------------------------------------------------------------------------------- 1 | TestMaxDepositRequest 2 | ├── given vault open when maxDepositRequest 3 | │ └── it should return 0 4 | ├── given vault paused when maxDepositRequest 5 | │ └── it should return 0 6 | ├── given vault closed and paused when maxDepositRequest 7 | │ └── it should return 0 8 | └── given vault closed and not paused when maxDepositRequest 9 | └── it should return maxUint256 10 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestMaxRedeemRequest.tree: -------------------------------------------------------------------------------- 1 | TestMaxRedeemRequest 2 | ├── given vault open when maxRedeemRequest 3 | │ └── it should return 0 4 | ├── given vault paused when maxRedeemRequest 5 | │ └── it should return 0 6 | ├── given vault closed and paused when maxRedeemRequest 7 | │ └── it should return 0 8 | └── given vault closed and not paused when maxRedeemRequest 9 | └── it should return the owner shares balance 10 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestPendingDepositRequest.tree: -------------------------------------------------------------------------------- 1 | TestPendingDepositRequest 2 | ├── given an owner who has not interacted with the vault when pendingDepositRequest 3 | │ └── it should return 0 4 | └── given an owner who has interacted with the vault 5 | └── it should return the amount of pending deposit for his last deposit request when pendingDepositRequest -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestSharesBalanceInAsset.tree: -------------------------------------------------------------------------------- 1 | TestSharesBalanceInAsset 2 | ├── given user Has 0 shares 3 | │ └── it should return 0 4 | ├── given user has 10 shares and PPS is p 5 | │ └── it should return 10 * p 6 | └── given user has 10 shares and and convert to assets of 10 is n 7 | └── it should return n 8 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestTotalPendingDeposits.tree: -------------------------------------------------------------------------------- 1 | TestTotalPendingDeposits 2 | ├── given vault open when totalPendingDeposits 3 | │ └── it should return 0 4 | └── given vault closed when totalPendingDeposits 5 | └── it should return underlying balance of vault 6 | -------------------------------------------------------------------------------- /test/unit/concrete/tree/TestTotalPendingRedeems.tree: -------------------------------------------------------------------------------- 1 | TestTotalPendingRedeems 2 | ├── given vault open when totalPendingRedeems 3 | │ └── it should return 0 4 | └── given vault closed when totalPendingRedeems 5 | └── it should return shares balance of vault 6 | -------------------------------------------------------------------------------- /workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: workflow_dispatch 4 | 5 | env: 6 | FOUNDRY_PROFILE: ci 7 | 8 | jobs: 9 | check: 10 | strategy: 11 | fail-fast: true 12 | 13 | name: Foundry project 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | with: 18 | submodules: recursive 19 | 20 | - name: Install Foundry 21 | uses: foundry-rs/foundry-toolchain@v1 22 | with: 23 | version: nightly 24 | 25 | - name: Run Forge build 26 | run: | 27 | forge --version 28 | forge build --sizes 29 | id: build 30 | 31 | - name: Run Forge tests 32 | run: | 33 | forge test -vvv 34 | id: test 35 | --------------------------------------------------------------------------------