├── .env.example ├── .eslintignore ├── .eslintrc.js ├── .github ├── dependabot.yml └── workflows │ ├── combine-prs.yml │ └── tests.yml ├── .gitignore ├── .husky └── pre-commit ├── .prettierignore ├── .prettierrc ├── .solhint.json ├── .solhintignore ├── LICENSE ├── README.md ├── contracts ├── DemoContract.sol ├── interfaces │ └── IAccount.sol └── lib │ └── AccountStorage.sol ├── foundry.toml ├── hardhat.config.ts ├── lib ├── forge-std │ ├── .github │ │ └── workflows │ │ │ └── tests.yml │ ├── .gitignore │ ├── .gitmodules │ ├── LICENSE-APACHE │ ├── LICENSE-MIT │ ├── README.md │ ├── lib │ │ └── ds-test │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── default.nix │ │ │ ├── demo │ │ │ └── demo.sol │ │ │ └── src │ │ │ └── test.sol │ └── src │ │ ├── Script.sol │ │ ├── Test.sol │ │ ├── Vm.sol │ │ ├── console.sol │ │ ├── console2.sol │ │ └── test │ │ ├── Script.t.sol │ │ ├── StdAssertions.t.sol │ │ ├── StdCheats.t.sol │ │ ├── StdError.t.sol │ │ ├── StdMath.t.sol │ │ └── StdStorage.t.sol └── murky │ ├── .dockerignore │ ├── .gas-snapshot │ ├── .github │ └── workflows │ │ ├── run_tests.yml │ │ └── slither.yml │ ├── .gitignore │ ├── .gitmodules │ ├── Dockerfile.deploy │ ├── README.md │ ├── differential_testing │ ├── README.md │ ├── scripts │ │ ├── generate_root.ts │ │ ├── generate_root_cli.ts │ │ ├── merkle-tree.ts │ │ ├── package-lock.json │ │ └── package.json │ └── test │ │ ├── DifferentialTests.t.sol │ │ └── utils │ │ └── Strings2.sol │ ├── foundry.toml │ ├── lib │ ├── forge-std │ │ ├── .github │ │ │ └── workflows │ │ │ │ └── tests.yml │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── LICENSE-APACHE │ │ ├── LICENSE-MIT │ │ ├── README.md │ │ ├── lib │ │ │ └── ds-test │ │ │ │ ├── .gitignore │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── default.nix │ │ │ │ ├── demo │ │ │ │ └── demo.sol │ │ │ │ └── src │ │ │ │ └── test.sol │ │ └── src │ │ │ ├── Test.sol │ │ │ ├── Vm.sol │ │ │ ├── console.sol │ │ │ └── test │ │ │ ├── StdCheats.t.sol │ │ │ ├── StdError.t.sol │ │ │ └── StdStorage.t.sol │ └── openzeppelin-contracts │ │ ├── .codecov.yml │ │ ├── .editorconfig │ │ ├── .eslintrc │ │ ├── .gitattributes │ │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ │ ├── bug_report.md │ │ │ ├── config.yml │ │ │ └── feature_request.md │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ └── workflows │ │ │ ├── docs.yml │ │ │ ├── slither.yml │ │ │ ├── test.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 │ │ │ ├── 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 │ │ │ │ ├── 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 │ │ │ ├── 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 │ │ │ │ │ ├── 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 │ │ ├── docs │ │ ├── antora.yml │ │ ├── contract.hbs │ │ ├── helpers.js │ │ ├── modules │ │ │ └── ROOT │ │ │ │ ├── images │ │ │ │ ├── tally-admin.png │ │ │ │ └── tally-vote.png │ │ │ │ ├── nav.adoc │ │ │ │ └── pages │ │ │ │ ├── access-control.adoc │ │ │ │ ├── crowdsales.adoc │ │ │ │ ├── drafts.adoc │ │ │ │ ├── erc1155.adoc │ │ │ │ ├── erc20-supply.adoc │ │ │ │ ├── erc20.adoc │ │ │ │ ├── erc721.adoc │ │ │ │ ├── erc777.adoc │ │ │ │ ├── extending-contracts.adoc │ │ │ │ ├── governance.adoc │ │ │ │ ├── index.adoc │ │ │ │ ├── releases-stability.adoc │ │ │ │ ├── tokens.adoc │ │ │ │ ├── upgradeable.adoc │ │ │ │ ├── utilities.adoc │ │ │ │ └── wizard.adoc │ │ └── prelude.hbs │ │ ├── hardhat.config.js │ │ ├── hardhat │ │ └── env-contract.js │ │ ├── logo.svg │ │ ├── migrations │ │ └── .gitkeep │ │ ├── netlify.toml │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── renovate.json │ │ ├── scripts │ │ ├── gen-nav.js │ │ ├── git-user-config.sh │ │ ├── inheritanceOrdering.js │ │ ├── migrate-imports.js │ │ ├── prepack.sh │ │ ├── prepare-contracts-package.sh │ │ ├── prepare-docs-solc.js │ │ ├── prepare-docs.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 │ │ ├── crosschain.js │ │ ├── customError.js │ │ ├── eip712.js │ │ ├── enums.js │ │ ├── erc1967.js │ │ ├── governance.js │ │ └── sign.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 │ │ │ │ └── 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 │ ├── reports │ └── murky_gas_report.png │ └── src │ ├── Merkle.sol │ ├── Xorkle.sol │ ├── common │ └── MurkyBase.sol │ └── test │ ├── Merkle.t.sol │ ├── MurkyBase.t.sol │ ├── StandardInput.t.sol │ ├── Xorkle.t.sol │ └── standard_data │ └── README.md ├── package-lock.json ├── package.json ├── scripts └── deploy.ts ├── test ├── DemoContract.spec.ts └── foundry │ ├── AccountStorage.t.sol │ └── TestPlus.sol └── tsconfig.json /.env.example: -------------------------------------------------------------------------------- 1 | ENV= 2 | MNEMONIC= 3 | MNEMONIC_DEV= 4 | INFURA_TOKEN= 5 | ETHERSCAN_TOKEN= 6 | REPORT_GAS=true -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | artifacts 3 | cache 4 | coverage 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: false, 4 | es2021: true, 5 | mocha: true, 6 | node: true, 7 | }, 8 | plugins: ['@typescript-eslint'], 9 | extends: ['standard', 'plugin:prettier/recommended', 'plugin:node/recommended'], 10 | parser: '@typescript-eslint/parser', 11 | parserOptions: { 12 | ecmaVersion: 12, 13 | }, 14 | rules: { 15 | 'node/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }], 16 | 'node/no-unpublished-import': ['error', { devDependencies: true }], 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'npm' 4 | directory: '/' 5 | schedule: 6 | interval: 'daily' 7 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions 3 | 4 | name: Tests 5 | 6 | on: 7 | push: 8 | branches: [main, dev, feature/**, combine-prs-branch] 9 | pull_request: 10 | branches: [main, dev, feature/**, combine-prs-branch] 11 | 12 | jobs: 13 | tests: 14 | runs-on: ubuntu-latest 15 | strategy: 16 | matrix: 17 | node-version: [14.x] 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Get node.js 21 | uses: actions/setup-node@v1 22 | with: 23 | node-version: '16.x' 24 | - run: npm ci 25 | - run: npm run compile 26 | - run: TS_NODE_TRANSPILE_ONLY=1 npm test 27 | 28 | forge_tests: 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: actions/checkout@v3 32 | with: 33 | submodules: recursive 34 | - name: Install Foundry 35 | uses: foundry-rs/foundry-toolchain@v1 36 | with: 37 | version: nightly 38 | - name: Install Node modules 39 | uses: actions/setup-node@v2 40 | with: 41 | node-version: '16.x' 42 | cache: 'npm' 43 | - run: npm ci 44 | - name: Run tests 45 | run: forge test 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain-types 6 | 7 | #Hardhat files 8 | cache 9 | artifacts 10 | 11 | #openzeppelin 12 | .openzeppelin/* 13 | !.openzeppelin/unknown-137.json 14 | !.openzeppelin/mainnet.json 15 | 16 | .DS_Store 17 | 18 | # Foundry 19 | forge-cache/ 20 | out/ 21 | forge-coverage/ 22 | lcov.info 23 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npm run husky:pre-commit 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | artifacts 3 | cache 4 | coverage* 5 | gasReporterOutput.json 6 | typechain 7 | typechain-types 8 | .husky 9 | .prettierignore 10 | foundry.toml 11 | lib 12 | forge-cache 13 | out 14 | !/broadcast 15 | /broadcast/* 16 | /broadcast/*/31337/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "singleQuote": true, 6 | "bracketSpacing": true, 7 | "overrides": [ 8 | { 9 | "files": "*.sol", 10 | "options": { 11 | "printWidth": 120, 12 | "tabWidth": 4, 13 | "useTabs": false, 14 | "singleQuote": false, 15 | "bracketSpacing": false 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "solhint:recommended", 3 | "rules": { 4 | "compiler-version": ["error", "^0.8.0"], 5 | "func-visibility": ["warn", { "ignoreConstructors": true }] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.solhintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Polygon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /contracts/interfaces/IAccount.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.17; 3 | 4 | /** 5 | * @title IAccount 6 | * @author Polygon Technology (Daniel Gretzke @gretzke) 7 | */ 8 | 9 | /** 10 | * @notice data type representing an account, more variables can be added here 11 | * @param balance that is used for maintaining an order 12 | */ 13 | struct Account { 14 | uint256 balance; 15 | bool isActive; 16 | } 17 | 18 | /** 19 | * @notice data type for nodes in the red-black account tree 20 | * @param parent address of the parent of this node 21 | * @param left the node in the tree to the left of this one 22 | * @param right the node in the tree to the right of this one 23 | * @param red bool denoting color of node for balancing 24 | */ 25 | struct Node { 26 | address parent; 27 | address left; 28 | address right; 29 | bool red; 30 | Account account; 31 | } 32 | 33 | /** 34 | * @notice data type for the red-black account tree 35 | * @param root 36 | * @param count amount of nodes in the tree 37 | * @param totalBalance total amount of balances by nodes of the tree 38 | * @param nodes address to node mapping 39 | */ 40 | struct AccountTree { 41 | address root; 42 | uint256 count; 43 | uint256 totalBalance; 44 | mapping(address => Node) nodes; 45 | } 46 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | test = 'test/foundry' 4 | libs = ['node_modules', 'lib'] 5 | out = 'out' 6 | cache_path = 'forge-cache' 7 | verbosity = 2 8 | # comment out if you notice any weird behavior 9 | # sparse_mode = true 10 | 11 | # do not use for computationally expensive tests 12 | [profile.intense.fuzz] 13 | runs = 10000 14 | 15 | # See more config options https://book.getfoundry.sh/reference/config.html -------------------------------------------------------------------------------- /lib/forge-std/.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | check: 6 | name: Foundry project 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | with: 11 | submodules: recursive 12 | 13 | - name: Install Foundry 14 | uses: onbjerg/foundry-toolchain@v1 15 | with: 16 | version: nightly 17 | 18 | - name: Install dependencies 19 | run: forge install 20 | - name: Run tests 21 | run: forge test -vvv 22 | - name: Build Test with older solc versions 23 | run: | 24 | forge build --contracts src/Test.sol --use solc:0.8.0 25 | forge build --contracts src/Test.sol --use solc:0.7.0 26 | forge build --contracts src/Test.sol --use solc:0.6.0 27 | -------------------------------------------------------------------------------- /lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | .vscode 4 | .idea -------------------------------------------------------------------------------- /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/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Brock Elmore 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE O THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE.R 26 | -------------------------------------------------------------------------------- /lib/forge-std/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | -------------------------------------------------------------------------------- /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/src/test/Script.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.7.0 <0.9.0; 3 | 4 | import "../Test.sol"; 5 | 6 | contract ScriptTest is Test { 7 | function testGenerateCorrectAddress() external { 8 | address creation = computeCreateAddress(0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9, 14); 9 | assertEq(creation, 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/murky/.dockerignore: -------------------------------------------------------------------------------- 1 | out 2 | cache 3 | *.txt -------------------------------------------------------------------------------- /lib/murky/.gas-snapshot: -------------------------------------------------------------------------------- 1 | StandardizedInputTest:testMerkleGenerateProofStandard() (gas: 751849) 2 | StandardizedInputTest:testMerkleVerifyProofStandard() (gas: 846894) 3 | StandardizedInputTest:testXorkleGenerateProofStandard() (gas: 695233) 4 | StandardizedInputTest:testXorkleVerifyProofStandard() (gas: 779721) 5 | -------------------------------------------------------------------------------- /lib/murky/.github/workflows/run_tests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | 7 | name: tests 8 | 9 | jobs: 10 | check: 11 | name: Run All Tests 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | with: 16 | submodules: recursive 17 | - uses: actions/setup-node@v3 18 | with: 19 | node-version: 16.15.1 20 | 21 | - name: Install Foundry 22 | uses: foundry-rs/foundry-toolchain@v1 23 | with: 24 | version: nightly 25 | 26 | - name: Run Fuzzed Unit Tests 27 | run: forge test --no-match-path src/test/StandardInput.t.sol 28 | 29 | - name: Run Differential Tests 30 | run: | 31 | npm --prefix differential_testing/scripts/ install 32 | npm --prefix differential_testing/scripts/ run compile 33 | FOUNDRY_FUZZ_RUNS=512 forge test --ffi -c differential_testing/test/DifferentialTests.t.sol 34 | 35 | - name: Run Standard Gas Snapshotting 36 | run: forge snapshot --gas-report --ffi --match-path src/test/StandardInput.t.sol 37 | -------------------------------------------------------------------------------- /lib/murky/.github/workflows/slither.yml: -------------------------------------------------------------------------------- 1 | name: Slither Analysis 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | jobs: 8 | analyze: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - uses: crytic/slither-action@v0.1.1 13 | with: 14 | target: 'src/' 15 | slither-args: '--exclude-informational --checklist' 16 | -------------------------------------------------------------------------------- /lib/murky/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | *.txt 4 | differential_testing/**/node_modules 5 | differential_testing/**/*.js 6 | differential_testing/data/input -------------------------------------------------------------------------------- /lib/murky/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/openzeppelin-contracts"] 2 | path = lib/openzeppelin-contracts 3 | url = https://github.com/openzeppelin/openzeppelin-contracts 4 | [submodule "lib/forge-std"] 5 | path = lib/forge-std 6 | url = https://github.com/foundry-rs/forge-std 7 | -------------------------------------------------------------------------------- /lib/murky/Dockerfile.deploy: -------------------------------------------------------------------------------- 1 | from ghcr.io/gakonst/foundry:nightly 2 | 3 | WORKDIR /murky 4 | COPY . . 5 | RUN forge build 6 | RUN forge test 7 | ENTRYPOINT ["forge", "create"] -------------------------------------------------------------------------------- /lib/murky/differential_testing/README.md: -------------------------------------------------------------------------------- 1 | ## Differential Testing 2 | 3 | Differential testing is used to compare Murky's solidity implementation to reference implementations in other languages. This directory contains the scripts needed to support this testing, as well as the differential tests themselves. 4 | 5 | Currently, the only reference implementation is adapted from the [Uniswap/merkle-distributor](https://github.com/uniswap/merkle-distributor) implementation. It is written in javascript. 6 | 7 | ### Setup 8 | 9 | From the [scripts directory](./scripts/), run 10 | 11 | ```sh 12 | npm install 13 | npm run compile 14 | ``` 15 | 16 | ### Test the javascript implementation 17 | 18 | From the scripts directory: 19 | 20 | ```sh 21 | npm run generate-root 22 | ``` 23 | 24 | ### Run the differential test using foundry 25 | 26 | Now you can run the tests. 27 | From the root of the Murky repo, run: 28 | 29 | ```sh 30 | forge test --ffi -c differential_testing/test/DifferentialTests.t.sol 31 | ``` 32 | -------------------------------------------------------------------------------- /lib/murky/differential_testing/scripts/generate_root.ts: -------------------------------------------------------------------------------- 1 | import MerkleTree from './merkle-tree'; 2 | import * as fs from 'fs'; 3 | import { ethers } from 'ethers'; 4 | import { toBuffer } from 'ethereumjs-util'; 5 | import crypto from 'crypto'; 6 | 7 | var data = []; 8 | for (var i = 0; i < 129; ++i) { 9 | data.push('0x' + crypto.randomBytes(32).toString('hex')); 10 | } 11 | var dataAsBuffer = data.map((b) => toBuffer(b)); 12 | 13 | const tree = new MerkleTree(dataAsBuffer); 14 | process.stdout.write(ethers.utils.defaultAbiCoder.encode(['bytes32'], [tree.getRoot()])); 15 | const encodedData = ethers.utils.defaultAbiCoder.encode(['bytes32[129]'], [data]); 16 | if (!fs.existsSync('../data/')) { 17 | fs.mkdirSync('../data/'); 18 | } 19 | fs.writeFileSync('../data/input', encodedData); 20 | -------------------------------------------------------------------------------- /lib/murky/differential_testing/scripts/generate_root_cli.ts: -------------------------------------------------------------------------------- 1 | import MerkleTree from './merkle-tree'; 2 | import { ethers } from 'ethers'; 3 | import { toBuffer } from 'ethereumjs-util'; 4 | 5 | const encoder = ethers.utils.defaultAbiCoder; 6 | const num_leaves = process.argv[2]; 7 | const encoded_leaves = process.argv[3]; 8 | const decoded_data = encoder.decode([`bytes32[${num_leaves}]`], encoded_leaves)[0]; 9 | var dataAsBuffer = decoded_data.map((b) => toBuffer(b)); 10 | 11 | const tree = new MerkleTree(dataAsBuffer); 12 | process.stdout.write(ethers.utils.defaultAbiCoder.encode(['bytes32'], [tree.getRoot()])); 13 | -------------------------------------------------------------------------------- /lib/murky/differential_testing/scripts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "murky-differential", 3 | "version": "1.0.0", 4 | "description": "Scripts to perform solidity/js merkle tree testing", 5 | "main": "generate.js", 6 | "author": "", 7 | "license": "MIT", 8 | "dependencies": { 9 | "ethereumjs-util": "^7.1.4", 10 | "ethers": "^5.6.4", 11 | "rlp": "^3.0.0" 12 | }, 13 | "devDependencies": { 14 | "typescript": "^4.6.3" 15 | }, 16 | "scripts": { 17 | "compile": "npx tsc --esModuleInterop ./*.ts", 18 | "generate-root": "node generate_root.js", 19 | "generate-root-129": "node generate_root.js", 20 | "generate-root-cli": "node generate_root_cli.js" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/murky/differential_testing/test/utils/Strings2.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | library Strings2 { 4 | ///@dev converts bytes array to its ASCII hex string representation 5 | /// TODO: Definitely more efficient way to do this by processing multiple (16?) bytes at once 6 | /// but really a helper function for the tests, efficiency not key. 7 | function toHexString(bytes memory input) public pure returns (string memory) { 8 | require(input.length < type(uint256).max / 2 - 1); 9 | bytes16 symbols = "0123456789abcdef"; 10 | bytes memory hex_buffer = new bytes(2 * input.length + 2); 11 | hex_buffer[0] = "0"; 12 | hex_buffer[1] = "x"; 13 | 14 | uint pos = 2; 15 | uint256 length = input.length; 16 | for (uint i = 0; i < length; ++i) { 17 | uint _byte = uint8(input[i]); 18 | hex_buffer[pos++] = symbols[_byte >> 4]; 19 | hex_buffer[pos++] = symbols[_byte & 0xf]; 20 | } 21 | return string(hex_buffer); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/murky/foundry.toml: -------------------------------------------------------------------------------- 1 | [default] 2 | src = 'src' 3 | out = 'out' 4 | libs = ['lib'] 5 | fuzz_runs=5000 6 | # See more config options https://github.com/gakonst/foundry/tree/master/config -------------------------------------------------------------------------------- /lib/murky/lib/forge-std/.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | check: 6 | name: Foundry project 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | with: 11 | submodules: recursive 12 | 13 | - name: Install Foundry 14 | uses: onbjerg/foundry-toolchain@v1 15 | with: 16 | version: nightly 17 | 18 | - name: Install dependencies 19 | run: forge install 20 | - name: Run tests 21 | run: forge test -vvv 22 | -------------------------------------------------------------------------------- /lib/murky/lib/forge-std/.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | -------------------------------------------------------------------------------- /lib/murky/lib/forge-std/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/ds-test"] 2 | path = lib/ds-test 3 | url = https://github.com/dapphub/ds-test 4 | -------------------------------------------------------------------------------- /lib/murky/lib/forge-std/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Brock Elmore 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE O THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE.R 26 | -------------------------------------------------------------------------------- /lib/murky/lib/forge-std/lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/forge-std/lib/ds-test/default.nix: -------------------------------------------------------------------------------- 1 | { solidityPackage, dappsys }: solidityPackage { 2 | name = "ds-test"; 3 | src = ./src; 4 | } 5 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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] 21 | max_line_length = 0 22 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug in OpenZeppelin Contracts 4 | --- 5 | 6 | 7 | 8 | 9 | 10 | **💻 Environment** 11 | 12 | 13 | 14 | **📝 Details** 15 | 16 | 17 | 18 | **🔢 Code to reproduce bug** 19 | 20 | 21 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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 | **🧐 Motivation** 7 | 8 | 9 | 10 | **📝 Details** 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Fixes #???? 7 | 8 | 9 | 10 | 11 | #### PR Checklist 12 | 13 | 14 | 15 | 16 | 17 | - [ ] Tests 18 | - [ ] Documentation 19 | - [ ] Changelog entry 20 | -------------------------------------------------------------------------------- /lib/murky/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 | - uses: actions/setup-node@v3 13 | with: 14 | node-version: 12.x 15 | - uses: actions/cache@v3 16 | id: cache 17 | with: 18 | path: '**/node_modules' 19 | key: npm-v2-${{ hashFiles('**/package-lock.json') }} 20 | restore-keys: npm-v2- 21 | - run: npm ci 22 | if: steps.cache.outputs.cache-hit != 'true' 23 | - run: bash scripts/git-user-config.sh 24 | - run: node scripts/update-docs-branch.js 25 | - run: git push --all origin 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/.github/workflows/slither.yml: -------------------------------------------------------------------------------- 1 | name: Slither Analysis 2 | on: 3 | push: 4 | branches: 5 | - master 6 | - release-v* 7 | pull_request: {} 8 | workflow_dispatch: {} 9 | 10 | jobs: 11 | analyze: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - uses: actions/setup-node@v3 16 | with: 17 | node-version: 12.x 18 | - uses: actions/cache@v3 19 | id: cache 20 | with: 21 | path: '**/node_modules' 22 | key: npm-v2-${{ hashFiles('**/package-lock.json') }} 23 | restore-keys: npm-v2- 24 | - run: npm ci 25 | if: steps.cache.outputs.cache-hit != 'true' 26 | - name: Clean project 27 | run: npm run clean 28 | - uses: crytic/slither-action@v0.1.1 29 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | 4 | # Logs 5 | logs 6 | *.log 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | allFiredEvents 13 | scTopics 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | coverage.json 18 | coverageEnv 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Dependency directory 24 | node_modules 25 | 26 | # Debug log from npm 27 | npm-debug.log 28 | 29 | # local env variables 30 | .env 31 | 32 | # truffle build directory 33 | build/ 34 | 35 | # macOS 36 | .DS_Store 37 | 38 | # truffle 39 | .node-xmlhttprequest-* 40 | 41 | # IntelliJ IDE 42 | .idea 43 | 44 | # docs artifacts 45 | docs/modules/api 46 | 47 | # only used to package @openzeppelin/contracts 48 | contracts/build/ 49 | contracts/README.md 50 | 51 | # temporary artifact from solidity-coverage 52 | allFiredEvents 53 | .coverage_artifacts 54 | .coverage_cache 55 | .coverage_contracts 56 | 57 | # hardhat 58 | cache 59 | artifacts 60 | 61 | # Certora 62 | .certora* 63 | .last_confs 64 | certora_* 65 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/.mocharc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | require: 'hardhat/register', 3 | timeout: 4000, 4 | }; 5 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/DOCUMENTATION.md: -------------------------------------------------------------------------------- 1 | Documentation is hosted at https://docs.openzeppelin.com/contracts. 2 | 3 | All of the content for the site is in this repository. The guides are in the 4 | [docs](/docs) directory, and the API Reference is extracted from comments in 5 | the source code. If you want to help improve the content, this is the 6 | repository you should be contributing to. 7 | 8 | [`solidity-docgen`](https://github.com/OpenZeppelin/solidity-docgen) is the 9 | program that extracts the API Reference from source code. 10 | 11 | The [`docs.openzeppelin.com`](https://github.com/OpenZeppelin/docs.openzeppelin.com) 12 | repository hosts the configuration for the entire site, which includes 13 | documentation for all of the OpenZeppelin projects. 14 | 15 | To run the docs locally you should run `npm run docs:watch` on this 16 | repository. 17 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2022 zOS Global Limited and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/RELEASING.md: -------------------------------------------------------------------------------- 1 | # Releasing 2 | 3 | > Visit the documentation for [details about release schedule]. 4 | 5 | Start on an up-to-date `master` branch. 6 | 7 | Create the release branch with `npm run release start minor`. 8 | 9 | Publish a release candidate with `npm run release rc`. 10 | 11 | Publish the final release with `npm run release final`. 12 | 13 | Follow the general [OpenZeppelin Contracts release checklist]. 14 | 15 | [details about release schedule]: https://docs.openzeppelin.com/contracts/releases-stability 16 | [openzeppelin contracts release checklist]: https://github.com/OpenZeppelin/code-style/blob/master/RELEASE_CHECKLIST.md 17 | 18 | ## Merging the release branch 19 | 20 | After the final release, the release branch should be merged back into `master`. This merge must not be squashed because it would lose the tagged release commit. Since the GitHub repo is set up to only allow squashed merges, the merge should be done locally and pushed. 21 | 22 | Make sure to have the latest changes from `upstream` in your local release branch. 23 | 24 | ``` 25 | git checkout release-vX.Y.Z 26 | git pull upstream 27 | ``` 28 | 29 | ``` 30 | git checkout master 31 | git merge --no-ff release-vX.Y.Z 32 | git push upstream master 33 | ``` 34 | 35 | The release branch can then be deleted on GitHub. 36 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Bug Bounty 4 | 5 | We have a [**bug bounty program** on Immunefi](https://www.immunefi.com/bounty/openzeppelin). Please report any security issues you find through the Immunefi dashboard, or reach out to security@openzeppelin.com. 6 | 7 | Critical bug fixes will be backported to past major releases. 8 | 9 | ## Supported Versions 10 | 11 | The recommendation is to use the latest version available. 12 | 13 | | Version | Supported | 14 | | ------- | ------------------------------------ | 15 | | 4.x | :white_check_mark::white_check_mark: | 16 | | 3.4 | :white_check_mark: | 17 | | 2.5 | :white_check_mark: | 18 | | < 2.0 | :x: | 19 | 20 | Note that the Solidity language itself only guarantees security updates for the latest release. 21 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/audit/2018-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPolygon/account-binary-search-tree/cd9b4b1d733a72ec641941d9e81d90922881f395/lib/murky/lib/openzeppelin-contracts/audit/2018-10.pdf -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/certora/harnesses/ERC20VotesHarness.sol: -------------------------------------------------------------------------------- 1 | import "../munged/token/ERC20/extensions/ERC20Votes.sol"; 2 | 3 | contract ERC20VotesHarness is ERC20Votes { 4 | constructor(string memory name, string memory symbol) ERC20Permit(name) ERC20(name, symbol) {} 5 | 6 | mapping(address => mapping(uint256 => uint256)) public _getPastVotes; 7 | 8 | function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual override { 9 | super._afterTokenTransfer(from, to, amount); 10 | _getPastVotes[from][block.number] -= amount; 11 | _getPastVotes[to][block.number] += amount; 12 | } 13 | 14 | /** 15 | * @dev Change delegation for `delegator` to `delegatee`. 16 | * 17 | * Emits events {DelegateChanged} and {DelegateVotesChanged}. 18 | */ 19 | function _delegate(address delegator, address delegatee) internal virtual override { 20 | super._delegate(delegator, delegatee); 21 | _getPastVotes[delegator][block.number] -= balanceOf(delegator); 22 | _getPastVotes[delegatee][block.number] += balanceOf(delegator); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/certora/munged/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IAccessControl.sol"; 7 | 8 | /** 9 | * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. 10 | */ 11 | interface IAccessControlEnumerable is IAccessControl { 12 | /** 13 | * @dev Returns one of the accounts that have `role`. `index` must be a 14 | * value between 0 and {getRoleMemberCount}, non-inclusive. 15 | * 16 | * Role bearers are not sorted in any particular way, and their ordering may 17 | * change at any point. 18 | * 19 | * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure 20 | * you perform all queries on the same block. See the following 21 | * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] 22 | * for more information. 23 | */ 24 | function getRoleMember(bytes32 role, uint256 index) external view returns (address); 25 | 26 | /** 27 | * @dev Returns the number of accounts that have `role`. Can be used 28 | * together with {getRoleMember} to enumerate all bearers of a role. 29 | */ 30 | function getRoleMemberCount(bytes32 role) external view returns (uint256); 31 | } 32 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/access/README.adoc: -------------------------------------------------------------------------------- 1 | = Access Control 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/access 5 | 6 | This directory provides ways to restrict who can access the functions of a contract or when they can do it. 7 | 8 | - {AccessControl} provides a general role based access control mechanism. Multiple hierarchical roles can be created and assigned each to multiple accounts. 9 | - {Ownable} is a simpler mechanism with a single owner "role" that can be assigned to a single account. This simpler mechanism can be useful for quick tests but projects with production concerns are likely to outgrow it. 10 | 11 | == Authorization 12 | 13 | {{Ownable}} 14 | 15 | {{IAccessControl}} 16 | 17 | {{AccessControl}} 18 | 19 | {{AccessControlCrossChain}} 20 | 21 | {{IAccessControlEnumerable}} 22 | 23 | {{AccessControlEnumerable}} 24 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/crosschain/README.adoc: -------------------------------------------------------------------------------- 1 | = Cross Chain Awareness 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/crosschain 5 | 6 | This directory provides building blocks to improve cross-chain awareness of smart contracts. 7 | 8 | - {CrossChainEnabled} is an abstraction that contains accessors and modifiers to control the execution flow when receiving cross-chain messages. 9 | 10 | == CrossChainEnabled specializations 11 | 12 | The following specializations of {CrossChainEnabled} provide implementations of the {CrossChainEnabled} abstraction for specific bridges. This can be used to complexe cross-chain aware components such as {AccessControlCrossChain}. 13 | 14 | {{CrossChainEnabledAMB}} 15 | 16 | {{CrossChainEnabledArbitrumL1}} 17 | 18 | {{CrossChainEnabledArbitrumL2}} 19 | 20 | {{CrossChainEnabledOptimism}} 21 | 22 | {{CrossChainEnabledPolygonChild}} 23 | 24 | == Libraries for cross-chain 25 | 26 | In addition to the {CrossChainEnable} abstraction, cross-chain awareness is also available through libraries. These libraries can be used to build complex designs such as contracts with the ability to interact with multiple bridges. 27 | 28 | {{LibAMB}} 29 | 30 | {{LibArbitrumL1}} 31 | 32 | {{LibArbitrumL2}} 33 | 34 | {{LibOptimism}} 35 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/crosschain/amb/LibAMB.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import {IAMB as AMB_Bridge} from "../../vendor/amb/IAMB.sol"; 6 | import "../errors.sol"; 7 | 8 | /** 9 | * @dev Primitives for cross-chain aware contracts using the 10 | * [AMB](https://docs.tokenbridge.net/amb-bridge/about-amb-bridge) 11 | * family of bridges. 12 | */ 13 | library LibAMB { 14 | /** 15 | * @dev Returns whether the current function call is the result of a 16 | * cross-chain message relayed by `bridge`. 17 | */ 18 | function isCrossChain(address bridge) internal view returns (bool) { 19 | return msg.sender == bridge; 20 | } 21 | 22 | /** 23 | * @dev Returns the address of the sender that triggered the current 24 | * cross-chain message through `bridge`. 25 | * 26 | * NOTE: {isCrossChain} should be checked before trying to recover the 27 | * sender, as it will revert with `NotCrossChainCall` if the current 28 | * function call is not the result of a cross-chain message. 29 | */ 30 | function crossChainSender(address bridge) internal view returns (address) { 31 | if (!isCrossChain(bridge)) revert NotCrossChainCall(); 32 | return AMB_Bridge(bridge).messageSender(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import "../CrossChainEnabled.sol"; 6 | import "./LibArbitrumL2.sol"; 7 | 8 | /** 9 | * @dev [Arbitrum](https://arbitrum.io/) specialization or the 10 | * {CrossChainEnabled} abstraction the L2 side (arbitrum). 11 | * 12 | * This version should only be deployed on L2 to process cross-chain messages 13 | * originating from L1. For the other side, use {CrossChainEnabledArbitrumL1}. 14 | * 15 | * Arbitrum L2 includes the `ArbSys` contract at a fixed address. Therefore, 16 | * this specialization of {CrossChainEnabled} does not include a constructor. 17 | * 18 | * _Available since v4.6._ 19 | */ 20 | abstract contract CrossChainEnabledArbitrumL2 is CrossChainEnabled { 21 | /** 22 | * @dev see {CrossChainEnabled-_isCrossChain} 23 | */ 24 | function _isCrossChain() internal view virtual override returns (bool) { 25 | return LibArbitrumL2.isCrossChain(LibArbitrumL2.ARBSYS); 26 | } 27 | 28 | /** 29 | * @dev see {CrossChainEnabled-_crossChainSender} 30 | */ 31 | function _crossChainSender() internal view virtual override onlyCrossChain returns (address) { 32 | return LibArbitrumL2.crossChainSender(LibArbitrumL2.ARBSYS); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/crosschain/errors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | error NotCrossChainCall(); 6 | error InvalidCrossChainSender(address actual, address expected); 7 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/crosschain/optimism/LibOptimism.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.4; 4 | 5 | import {ICrossDomainMessenger as Optimism_Bridge} from "../../vendor/optimism/ICrossDomainMessenger.sol"; 6 | import "../errors.sol"; 7 | 8 | /** 9 | * @dev Primitives for cross-chain aware contracts for [Optimism](https://www.optimism.io/). 10 | * See the [documentation](https://community.optimism.io/docs/developers/bridge/messaging/#accessing-msg-sender) 11 | * for the functionality used here. 12 | */ 13 | library LibOptimism { 14 | /** 15 | * @dev Returns whether the current function call is the result of a 16 | * cross-chain message relayed by `messenger`. 17 | */ 18 | function isCrossChain(address messenger) internal view returns (bool) { 19 | return msg.sender == messenger; 20 | } 21 | 22 | /** 23 | * @dev Returns the address of the sender that triggered the current 24 | * cross-chain message through `messenger`. 25 | * 26 | * NOTE: {isCrossChain} should be checked before trying to recover the 27 | * sender, as it will revert with `NotCrossChainCall` if the current 28 | * function call is not the result of a cross-chain message. 29 | */ 30 | function crossChainSender(address messenger) internal view returns (address) { 31 | if (!isCrossChain(messenger)) revert NotCrossChainCall(); 32 | 33 | return Optimism_Bridge(messenger).xDomainMessageSender(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/murky/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 | - {PaymentSplitter} allows to split Ether and ERC20 payments among a group of accounts. The sender does not need to be 9 | aware that the assets will be split in this way, since it is handled transparently by the contract. The split can be 10 | in equal parts or in any other arbitrary proportion. 11 | 12 | - {VestingWallet} handles the vesting of Ether and ERC20 tokens for a given beneficiary. Custody of multiple tokens can 13 | be given to this contract, which will release the token to the beneficiary following a given, customizable, vesting 14 | schedule. 15 | 16 | == Contracts 17 | 18 | {{PaymentSplitter}} 19 | 20 | {{VestingWallet}} 21 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorProposalThreshold.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorProposalThreshold.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../Governor.sol"; 7 | 8 | /** 9 | * @dev Extension of {Governor} for proposal restriction to token holders with a minimum balance. 10 | * 11 | * _Available since v4.3._ 12 | * _Deprecated since v4.4._ 13 | */ 14 | abstract contract GovernorProposalThreshold is Governor { 15 | function propose( 16 | address[] memory targets, 17 | uint256[] memory values, 18 | bytes[] memory calldatas, 19 | string memory description 20 | ) public virtual override returns (uint256) { 21 | return super.propose(targets, values, calldatas, description); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotes.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorVotes.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../Governor.sol"; 7 | import "../utils/IVotes.sol"; 8 | 9 | /** 10 | * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes} token. 11 | * 12 | * _Available since v4.3._ 13 | */ 14 | abstract contract GovernorVotes is Governor { 15 | IVotes public immutable token; 16 | 17 | constructor(IVotes tokenAddress) { 18 | token = tokenAddress; 19 | } 20 | 21 | /** 22 | * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}). 23 | */ 24 | function _getVotes( 25 | address account, 26 | uint256 blockNumber, 27 | bytes memory /*params*/ 28 | ) internal view virtual override returns (uint256) { 29 | return token.getPastVotes(account, blockNumber); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotesComp.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorVotesComp.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../Governor.sol"; 7 | import "../../token/ERC20/extensions/ERC20VotesComp.sol"; 8 | 9 | /** 10 | * @dev Extension of {Governor} for voting weight extraction from a Comp token. 11 | * 12 | * _Available since v4.3._ 13 | */ 14 | abstract contract GovernorVotesComp is Governor { 15 | ERC20VotesComp public immutable token; 16 | 17 | constructor(ERC20VotesComp token_) { 18 | token = token_; 19 | } 20 | 21 | /** 22 | * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}). 23 | */ 24 | function _getVotes( 25 | address account, 26 | uint256 blockNumber, 27 | bytes memory /*params*/ 28 | ) internal view virtual override returns (uint256) { 29 | return token.getPriorVotes(account, blockNumber); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/governance/extensions/IGovernorTimelock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (governance/extensions/IGovernorTimelock.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IGovernor.sol"; 7 | 8 | /** 9 | * @dev Extension of the {IGovernor} for timelock supporting modules. 10 | * 11 | * _Available since v4.3._ 12 | */ 13 | abstract contract IGovernorTimelock is IGovernor { 14 | event ProposalQueued(uint256 proposalId, uint256 eta); 15 | 16 | function timelock() public view virtual returns (address); 17 | 18 | function proposalEta(uint256 proposalId) public view virtual returns (uint256); 19 | 20 | function queue( 21 | address[] memory targets, 22 | uint256[] memory values, 23 | bytes[] memory calldatas, 24 | bytes32 descriptionHash 25 | ) public virtual returns (uint256 proposalId); 26 | } 27 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/interfaces/IERC1363Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1363Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC1363Receiver { 7 | /* 8 | * Note: the ERC-165 identifier for this interface is 0x88a7ca5c. 9 | * 0x88a7ca5c === bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)")) 10 | */ 11 | 12 | /** 13 | * @notice Handle the receipt of ERC1363 tokens 14 | * @dev Any ERC1363 smart contract calls this function on the recipient 15 | * after a `transfer` or a `transferFrom`. This function MAY throw to revert and reject the 16 | * transfer. Return of other than the magic value MUST result in the 17 | * transaction being reverted. 18 | * Note: the token contract address is always the message sender. 19 | * @param operator address The address which called `transferAndCall` or `transferFromAndCall` function 20 | * @param from address The address which are token transferred from 21 | * @param value uint256 The amount of tokens transferred 22 | * @param data bytes Additional data with no specified format 23 | * @return `bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)"))` 24 | * unless throwing 25 | */ 26 | function onTransferReceived( 27 | address operator, 28 | address from, 29 | uint256 value, 30 | bytes memory data 31 | ) external returns (bytes4); 32 | } 33 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/interfaces/IERC1363Spender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1363Spender.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | interface IERC1363Spender { 7 | /* 8 | * Note: the ERC-165 identifier for this interface is 0x7b04a2d0. 9 | * 0x7b04a2d0 === bytes4(keccak256("onApprovalReceived(address,uint256,bytes)")) 10 | */ 11 | 12 | /** 13 | * @notice Handle the approval of ERC1363 tokens 14 | * @dev Any ERC1363 smart contract calls this function on the recipient 15 | * after an `approve`. This function MAY throw to revert and reject the 16 | * approval. Return of other than the magic value MUST result in the 17 | * transaction being reverted. 18 | * Note: the token contract address is always the message sender. 19 | * @param owner address The address which called `approveAndCall` function 20 | * @param value uint256 The amount of tokens to be spent 21 | * @param data bytes Additional data with no specified format 22 | * @return `bytes4(keccak256("onApprovalReceived(address,uint256,bytes)"))` 23 | * unless throwing 24 | */ 25 | function onApprovalReceived(address owner, uint256 value, bytes memory data) external returns (bytes4); 26 | } 27 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../utils/introspection/IERC165.sol"; 7 | 8 | /** 9 | * @dev Interface for the NFT Royalty Standard. 10 | * 11 | * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal 12 | * support for royalty payments across all NFT marketplaces and ecosystem participants. 13 | * 14 | * _Available since v4.5._ 15 | */ 16 | interface IERC2981 is IERC165 { 17 | /** 18 | * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of 19 | * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. 20 | */ 21 | function royaltyInfo( 22 | uint256 tokenId, 23 | uint256 salePrice 24 | ) external view returns (address receiver, uint256 royaltyAmount); 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashBorrower.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC3156 FlashBorrower, as defined in 8 | * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. 9 | * 10 | * _Available since v4.1._ 11 | */ 12 | interface IERC3156FlashBorrower { 13 | /** 14 | * @dev Receive a flash loan. 15 | * @param initiator The initiator of the loan. 16 | * @param token The loan currency. 17 | * @param amount The amount of tokens lent. 18 | * @param fee The additional amount of tokens to repay. 19 | * @param data Arbitrary data structure, intended to contain user-defined parameters. 20 | * @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan" 21 | */ 22 | function onFlashLoan( 23 | address initiator, 24 | address token, 25 | uint256 amount, 26 | uint256 fee, 27 | bytes calldata data 28 | ) external returns (bytes32); 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/interfaces/README.adoc: -------------------------------------------------------------------------------- 1 | = Interfaces 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/interfaces 5 | 6 | == List of standardized interfaces 7 | These interfaces are available as `.sol` files, and also as compiler `.json` ABI files (through the npm package). These 8 | are useful to interact with third party contracts that implement them. 9 | 10 | - {IERC20} 11 | - {IERC20Metadata} 12 | - {IERC165} 13 | - {IERC721} 14 | - {IERC721Receiver} 15 | - {IERC721Enumerable} 16 | - {IERC721Metadata} 17 | - {IERC777} 18 | - {IERC777Recipient} 19 | - {IERC777Sender} 20 | - {IERC1155} 21 | - {IERC1155Receiver} 22 | - {IERC1155MetadataURI} 23 | - {IERC1271} 24 | - {IERC1363} 25 | - {IERC1820Implementer} 26 | - {IERC1820Registry} 27 | - {IERC2612} 28 | - {IERC2981} 29 | - {IERC3156FlashLender} 30 | - {IERC3156FlashBorrower} 31 | 32 | == Detailed ABI 33 | 34 | {{IERC1271}} 35 | 36 | {{IERC1363}} 37 | 38 | {{IERC1363Receiver}} 39 | 40 | {{IERC1820Implementer}} 41 | 42 | {{IERC1820Registry}} 43 | 44 | {{IERC2612}} 45 | 46 | {{IERC2981}} 47 | 48 | {{IERC3156FlashLender}} 49 | 50 | {{IERC3156FlashBorrower}} 51 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified 8 | * proxy whose upgrades are fully controlled by the current implementation. 9 | */ 10 | interface IERC1822Proxiable { 11 | /** 12 | * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation 13 | * address. 14 | * 15 | * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks 16 | * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this 17 | * function revert if invoked through a proxy. 18 | */ 19 | function proxiableUUID() external view returns (bytes32); 20 | } 21 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/CheckpointsImpl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Checkpoints.sol"; 6 | 7 | contract CheckpointsImpl { 8 | using Checkpoints for Checkpoints.History; 9 | 10 | Checkpoints.History private _totalCheckpoints; 11 | 12 | function latest() public view returns (uint256) { 13 | return _totalCheckpoints.latest(); 14 | } 15 | 16 | function getAtBlock(uint256 blockNumber) public view returns (uint256) { 17 | return _totalCheckpoints.getAtBlock(blockNumber); 18 | } 19 | 20 | function push(uint256 value) public returns (uint256, uint256) { 21 | return _totalCheckpoints.push(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ClonesMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../proxy/Clones.sol"; 6 | import "../utils/Address.sol"; 7 | 8 | contract ClonesMock { 9 | using Address for address; 10 | using Clones for address; 11 | 12 | event NewInstance(address instance); 13 | 14 | function clone(address implementation, bytes calldata initdata) public payable { 15 | _initAndEmit(implementation.clone(), initdata); 16 | } 17 | 18 | function cloneDeterministic(address implementation, bytes32 salt, bytes calldata initdata) public payable { 19 | _initAndEmit(implementation.cloneDeterministic(salt), initdata); 20 | } 21 | 22 | function predictDeterministicAddress(address implementation, bytes32 salt) public view returns (address predicted) { 23 | return implementation.predictDeterministicAddress(salt); 24 | } 25 | 26 | function _initAndEmit(address instance, bytes memory initdata) private { 27 | if (initdata.length > 0) { 28 | instance.functionCallWithValue(initdata, msg.value); 29 | } 30 | emit NewInstance(instance); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ContextMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Context.sol"; 6 | 7 | contract ContextMock is Context { 8 | event Sender(address sender); 9 | 10 | function msgSender() public { 11 | emit Sender(_msgSender()); 12 | } 13 | 14 | event Data(bytes data, uint256 integerValue, string stringValue); 15 | 16 | function msgData(uint256 integerValue, string memory stringValue) public { 17 | emit Data(_msgData(), integerValue, stringValue); 18 | } 19 | } 20 | 21 | contract ContextMockCaller { 22 | function callSender(ContextMock context) public { 23 | context.msgSender(); 24 | } 25 | 26 | function callData(ContextMock context, uint256 integerValue, string memory stringValue) public { 27 | context.msgData(integerValue, stringValue); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/Create2Impl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Create2.sol"; 6 | import "../utils/introspection/ERC1820Implementer.sol"; 7 | 8 | contract Create2Impl { 9 | function deploy(uint256 value, bytes32 salt, bytes memory code) public { 10 | Create2.deploy(value, salt, code); 11 | } 12 | 13 | function deployERC1820Implementer(uint256 value, bytes32 salt) public { 14 | Create2.deploy(value, salt, type(ERC1820Implementer).creationCode); 15 | } 16 | 17 | function computeAddress(bytes32 salt, bytes32 codeHash) public view returns (address) { 18 | return Create2.computeAddress(salt, codeHash); 19 | } 20 | 21 | function computeAddressWithDeployer( 22 | bytes32 salt, 23 | bytes32 codeHash, 24 | address deployer 25 | ) public pure returns (address) { 26 | return Create2.computeAddress(salt, codeHash, deployer); 27 | } 28 | 29 | receive() external payable {} 30 | } 31 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ECDSAMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/ECDSA.sol"; 6 | 7 | contract ECDSAMock { 8 | using ECDSA for bytes32; 9 | using ECDSA for bytes; 10 | 11 | function recover(bytes32 hash, bytes memory signature) public pure returns (address) { 12 | return hash.recover(signature); 13 | } 14 | 15 | // solhint-disable-next-line func-name-mixedcase 16 | function recover_v_r_s(bytes32 hash, uint8 v, bytes32 r, bytes32 s) public pure returns (address) { 17 | return hash.recover(v, r, s); 18 | } 19 | 20 | // solhint-disable-next-line func-name-mixedcase 21 | function recover_r_vs(bytes32 hash, bytes32 r, bytes32 vs) public pure returns (address) { 22 | return hash.recover(r, vs); 23 | } 24 | 25 | function toEthSignedMessageHash(bytes32 hash) public pure returns (bytes32) { 26 | return hash.toEthSignedMessageHash(); 27 | } 28 | 29 | function toEthSignedMessageHash(bytes memory s) public pure returns (bytes32) { 30 | return s.toEthSignedMessageHash(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/EIP712External.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/draft-EIP712.sol"; 6 | import "../utils/cryptography/ECDSA.sol"; 7 | 8 | contract EIP712External is EIP712 { 9 | constructor(string memory name, string memory version) EIP712(name, version) {} 10 | 11 | function domainSeparator() external view returns (bytes32) { 12 | return _domainSeparatorV4(); 13 | } 14 | 15 | function verify(bytes memory signature, address signer, address mailTo, string memory mailContents) external view { 16 | bytes32 digest = _hashTypedDataV4( 17 | keccak256(abi.encode(keccak256("Mail(address to,string contents)"), mailTo, keccak256(bytes(mailContents)))) 18 | ); 19 | address recoveredSigner = ECDSA.recover(digest, signature); 20 | require(recoveredSigner == signer); 21 | } 22 | 23 | function getChainId() external view returns (uint256) { 24 | return block.chainid; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/murky/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(address to, uint256 id, uint256 value, bytes memory data) public { 11 | _mint(to, id, value, data); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC1155Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC1155/ERC1155.sol"; 6 | 7 | /** 8 | * @title ERC1155Mock 9 | * This mock just publicizes internal functions for testing purposes 10 | */ 11 | contract ERC1155Mock is ERC1155 { 12 | constructor(string memory uri) ERC1155(uri) {} 13 | 14 | function setURI(string memory newuri) public { 15 | _setURI(newuri); 16 | } 17 | 18 | function mint(address to, uint256 id, uint256 value, bytes memory data) public { 19 | _mint(to, id, value, data); 20 | } 21 | 22 | function mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) public { 23 | _mintBatch(to, ids, values, data); 24 | } 25 | 26 | function burn(address owner, uint256 id, uint256 value) public { 27 | _burn(owner, id, value); 28 | } 29 | 30 | function burnBatch(address owner, uint256[] memory ids, uint256[] memory values) public { 31 | _burnBatch(owner, ids, values); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC1155PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./ERC1155Mock.sol"; 6 | import "../token/ERC1155/extensions/ERC1155Pausable.sol"; 7 | 8 | contract ERC1155PausableMock is ERC1155Mock, ERC1155Pausable { 9 | constructor(string memory uri) ERC1155Mock(uri) {} 10 | 11 | function pause() external { 12 | _pause(); 13 | } 14 | 15 | function unpause() external { 16 | _unpause(); 17 | } 18 | 19 | function _beforeTokenTransfer( 20 | address operator, 21 | address from, 22 | address to, 23 | uint256[] memory ids, 24 | uint256[] memory amounts, 25 | bytes memory data 26 | ) internal virtual override(ERC1155, ERC1155Pausable) { 27 | super._beforeTokenTransfer(operator, from, to, ids, amounts, data); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../access/Ownable.sol"; 6 | import "../interfaces/IERC1271.sol"; 7 | import "../utils/cryptography/ECDSA.sol"; 8 | 9 | contract ERC1271WalletMock is Ownable, IERC1271 { 10 | constructor(address originalOwner) { 11 | transferOwnership(originalOwner); 12 | } 13 | 14 | function isValidSignature(bytes32 hash, bytes memory signature) public view override returns (bytes4 magicValue) { 15 | return ECDSA.recover(hash, signature) == owner() ? this.isValidSignature.selector : bytes4(0); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ERC165CheckerMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/introspection/ERC165Checker.sol"; 6 | 7 | contract ERC165CheckerMock { 8 | using ERC165Checker for address; 9 | 10 | function supportsERC165(address account) public view returns (bool) { 11 | return account.supportsERC165(); 12 | } 13 | 14 | function supportsInterface(address account, bytes4 interfaceId) public view returns (bool) { 15 | return account.supportsInterface(interfaceId); 16 | } 17 | 18 | function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) public view returns (bool) { 19 | return account.supportsAllInterfaces(interfaceIds); 20 | } 21 | 22 | function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) public view returns (bool[] memory) { 23 | return account.getSupportedInterfaces(interfaceIds); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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(string memory name, string memory symbol, uint256 cap) ERC20(name, symbol) ERC20Capped(cap) {} 9 | 10 | function mint(address to, uint256 tokenId) public { 11 | _mint(to, tokenId); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/murky/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(string memory name_, string memory symbol_, uint8 decimals_) ERC20(name_, symbol_) { 11 | _decimals = decimals_; 12 | } 13 | 14 | function decimals() public view virtual override returns (uint8) { 15 | return _decimals; 16 | } 17 | 18 | function mint(address account, uint256 amount) public { 19 | _mint(account, amount); 20 | } 21 | 22 | function burn(address account, uint256 amount) public { 23 | _burn(account, amount); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC20FlashMintMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20FlashMint.sol"; 6 | 7 | contract ERC20FlashMintMock is ERC20FlashMint { 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/murky/lib/openzeppelin-contracts/contracts/mocks/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/ERC20.sol"; 6 | 7 | // mock class using ERC20 8 | contract ERC20Mock is ERC20 { 9 | constructor( 10 | string memory name, 11 | string memory symbol, 12 | address initialAccount, 13 | uint256 initialBalance 14 | ) payable ERC20(name, symbol) { 15 | _mint(initialAccount, initialBalance); 16 | } 17 | 18 | function mint(address account, uint256 amount) public { 19 | _mint(account, amount); 20 | } 21 | 22 | function burn(address account, uint256 amount) public { 23 | _burn(account, amount); 24 | } 25 | 26 | function transferInternal(address from, address to, uint256 value) public { 27 | _transfer(from, to, value); 28 | } 29 | 30 | function approveInternal(address owner, address spender, uint256 value) public { 31 | _approve(owner, spender, value); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC20PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Pausable.sol"; 6 | 7 | // mock class using ERC20Pausable 8 | contract ERC20PausableMock is ERC20Pausable { 9 | constructor( 10 | string memory name, 11 | string memory symbol, 12 | address initialAccount, 13 | uint256 initialBalance 14 | ) ERC20(name, symbol) { 15 | _mint(initialAccount, initialBalance); 16 | } 17 | 18 | function pause() external { 19 | _pause(); 20 | } 21 | 22 | function unpause() external { 23 | _unpause(); 24 | } 25 | 26 | function mint(address to, uint256 amount) public { 27 | _mint(to, amount); 28 | } 29 | 30 | function burn(address from, uint256 amount) public { 31 | _burn(from, amount); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ERC2771ContextMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.9; 4 | 5 | import "./ContextMock.sol"; 6 | import "../metatx/ERC2771Context.sol"; 7 | 8 | // By inheriting from ERC2771Context, Context's internal functions are overridden automatically 9 | contract ERC2771ContextMock is ContextMock, ERC2771Context { 10 | /// @custom:oz-upgrades-unsafe-allow constructor 11 | constructor(address trustedForwarder) ERC2771Context(trustedForwarder) { 12 | emit Sender(_msgSender()); // _msgSender() should be accessible during construction 13 | } 14 | 15 | function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address) { 16 | return ERC2771Context._msgSender(); 17 | } 18 | 19 | function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) { 20 | return ERC2771Context._msgData(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC721BurnableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/extensions/ERC721Burnable.sol"; 6 | 7 | contract ERC721BurnableMock is ERC721Burnable { 8 | constructor(string memory name, string memory symbol) ERC721(name, symbol) {} 9 | 10 | function exists(uint256 tokenId) public view returns (bool) { 11 | return _exists(tokenId); 12 | } 13 | 14 | function mint(address to, uint256 tokenId) public { 15 | _mint(to, tokenId); 16 | } 17 | 18 | function safeMint(address to, uint256 tokenId) public { 19 | _safeMint(to, tokenId); 20 | } 21 | 22 | function safeMint(address to, uint256 tokenId, bytes memory _data) public { 23 | _safeMint(to, tokenId, _data); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC721EnumerableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/extensions/ERC721Enumerable.sol"; 6 | 7 | /** 8 | * @title ERC721Mock 9 | * This mock just provides a public safeMint, mint, and burn functions for testing purposes 10 | */ 11 | contract ERC721EnumerableMock is ERC721Enumerable { 12 | string private _baseTokenURI; 13 | 14 | constructor(string memory name, string memory symbol) ERC721(name, symbol) {} 15 | 16 | function _baseURI() internal view virtual override returns (string memory) { 17 | return _baseTokenURI; 18 | } 19 | 20 | function setBaseURI(string calldata newBaseTokenURI) public { 21 | _baseTokenURI = newBaseTokenURI; 22 | } 23 | 24 | function baseURI() public view returns (string memory) { 25 | return _baseURI(); 26 | } 27 | 28 | function exists(uint256 tokenId) public view returns (bool) { 29 | return _exists(tokenId); 30 | } 31 | 32 | function mint(address to, uint256 tokenId) public { 33 | _mint(to, tokenId); 34 | } 35 | 36 | function safeMint(address to, uint256 tokenId) public { 37 | _safeMint(to, tokenId); 38 | } 39 | 40 | function safeMint(address to, uint256 tokenId, bytes memory _data) public { 41 | _safeMint(to, tokenId, _data); 42 | } 43 | 44 | function burn(uint256 tokenId) public { 45 | _burn(tokenId); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC721Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/ERC721.sol"; 6 | 7 | /** 8 | * @title ERC721Mock 9 | * This mock just provides a public safeMint, mint, and burn functions for testing purposes 10 | */ 11 | contract ERC721Mock is ERC721 { 12 | constructor(string memory name, string memory symbol) ERC721(name, symbol) {} 13 | 14 | function baseURI() public view returns (string memory) { 15 | return _baseURI(); 16 | } 17 | 18 | function exists(uint256 tokenId) public view returns (bool) { 19 | return _exists(tokenId); 20 | } 21 | 22 | function mint(address to, uint256 tokenId) public { 23 | _mint(to, tokenId); 24 | } 25 | 26 | function safeMint(address to, uint256 tokenId) public { 27 | _safeMint(to, tokenId); 28 | } 29 | 30 | function safeMint(address to, uint256 tokenId, bytes memory _data) public { 31 | _safeMint(to, tokenId, _data); 32 | } 33 | 34 | function burn(uint256 tokenId) public { 35 | _burn(tokenId); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC721PausableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/extensions/ERC721Pausable.sol"; 6 | 7 | /** 8 | * @title ERC721PausableMock 9 | * This mock just provides a public mint, burn and exists functions for testing purposes 10 | */ 11 | contract ERC721PausableMock is ERC721Pausable { 12 | constructor(string memory name, string memory symbol) ERC721(name, symbol) {} 13 | 14 | function pause() external { 15 | _pause(); 16 | } 17 | 18 | function unpause() external { 19 | _unpause(); 20 | } 21 | 22 | function exists(uint256 tokenId) public view returns (bool) { 23 | return _exists(tokenId); 24 | } 25 | 26 | function mint(address to, uint256 tokenId) public { 27 | _mint(to, tokenId); 28 | } 29 | 30 | function safeMint(address to, uint256 tokenId) public { 31 | _safeMint(to, tokenId); 32 | } 33 | 34 | function safeMint(address to, uint256 tokenId, bytes memory _data) public { 35 | _safeMint(to, tokenId, _data); 36 | } 37 | 38 | function burn(uint256 tokenId) public { 39 | _burn(tokenId); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC721ReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/IERC721Receiver.sol"; 6 | 7 | contract ERC721ReceiverMock is IERC721Receiver { 8 | enum Error { 9 | None, 10 | RevertWithMessage, 11 | RevertWithoutMessage, 12 | Panic 13 | } 14 | 15 | bytes4 private immutable _retval; 16 | Error private immutable _error; 17 | 18 | event Received(address operator, address from, uint256 tokenId, bytes data, uint256 gas); 19 | 20 | constructor(bytes4 retval, Error error) { 21 | _retval = retval; 22 | _error = error; 23 | } 24 | 25 | function onERC721Received( 26 | address operator, 27 | address from, 28 | uint256 tokenId, 29 | bytes memory data 30 | ) public override returns (bytes4) { 31 | if (_error == Error.RevertWithMessage) { 32 | revert("ERC721ReceiverMock: reverting"); 33 | } else if (_error == Error.RevertWithoutMessage) { 34 | revert(); 35 | } else if (_error == Error.Panic) { 36 | uint256 a = uint256(0) / uint256(0); 37 | a; 38 | } 39 | emit Received(operator, from, tokenId, data, gasleft()); 40 | return _retval; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/ERC721RoyaltyMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC721/extensions/ERC721Royalty.sol"; 6 | 7 | contract ERC721RoyaltyMock is ERC721Royalty { 8 | constructor(string memory name, string memory symbol) ERC721(name, symbol) {} 9 | 10 | function setTokenRoyalty(uint256 tokenId, address recipient, uint96 fraction) public { 11 | _setTokenRoyalty(tokenId, recipient, fraction); 12 | } 13 | 14 | function setDefaultRoyalty(address recipient, uint96 fraction) public { 15 | _setDefaultRoyalty(recipient, fraction); 16 | } 17 | 18 | function mint(address to, uint256 tokenId) public { 19 | _mint(to, tokenId); 20 | } 21 | 22 | function burn(uint256 tokenId) public { 23 | _burn(tokenId); 24 | } 25 | 26 | function deleteDefaultRoyalty() public { 27 | _deleteDefaultRoyalty(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ERC777Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Context.sol"; 6 | import "../token/ERC777/ERC777.sol"; 7 | 8 | contract ERC777Mock is Context, ERC777 { 9 | event BeforeTokenTransfer(); 10 | 11 | constructor( 12 | address initialHolder, 13 | uint256 initialBalance, 14 | string memory name, 15 | string memory symbol, 16 | address[] memory defaultOperators 17 | ) ERC777(name, symbol, defaultOperators) { 18 | _mint(initialHolder, initialBalance, "", ""); 19 | } 20 | 21 | function mintInternal(address to, uint256 amount, bytes memory userData, bytes memory operatorData) public { 22 | _mint(to, amount, userData, operatorData); 23 | } 24 | 25 | function mintInternalExtended( 26 | address to, 27 | uint256 amount, 28 | bytes memory userData, 29 | bytes memory operatorData, 30 | bool requireReceptionAck 31 | ) public { 32 | _mint(to, amount, userData, operatorData, requireReceptionAck); 33 | } 34 | 35 | function approveInternal(address holder, address spender, uint256 value) public { 36 | _approve(holder, spender, value); 37 | } 38 | 39 | function _beforeTokenTransfer(address, address, address, uint256) internal override { 40 | emit BeforeTokenTransfer(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/GovernorCompMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../governance/extensions/GovernorVotesComp.sol"; 7 | 8 | contract GovernorCompMock is GovernorVotesComp, GovernorCountingSimple { 9 | constructor(string memory name_, ERC20VotesComp token_) Governor(name_) GovernorVotesComp(token_) {} 10 | 11 | function quorum(uint256) public pure override returns (uint256) { 12 | return 0; 13 | } 14 | 15 | function votingDelay() public pure override returns (uint256) { 16 | return 4; 17 | } 18 | 19 | function votingPeriod() public pure override returns (uint256) { 20 | return 16; 21 | } 22 | 23 | function cancel( 24 | address[] memory targets, 25 | uint256[] memory values, 26 | bytes[] memory calldatas, 27 | bytes32 salt 28 | ) public returns (uint256 proposalId) { 29 | return _cancel(targets, values, calldatas, salt); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/GovernorVoteMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../governance/extensions/GovernorCountingSimple.sol"; 6 | import "../governance/extensions/GovernorVotes.sol"; 7 | 8 | contract GovernorVoteMocks is GovernorVotes, GovernorCountingSimple { 9 | constructor(string memory name_, IVotes token_) Governor(name_) GovernorVotes(token_) {} 10 | 11 | function quorum(uint256) public pure override returns (uint256) { 12 | return 0; 13 | } 14 | 15 | function votingDelay() public pure override returns (uint256) { 16 | return 4; 17 | } 18 | 19 | function votingPeriod() public pure override returns (uint256) { 20 | return 16; 21 | } 22 | 23 | function cancel( 24 | address[] memory targets, 25 | uint256[] memory values, 26 | bytes[] memory calldatas, 27 | bytes32 salt 28 | ) public returns (uint256 proposalId) { 29 | return _cancel(targets, values, calldatas, salt); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/MathMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/math/Math.sol"; 6 | 7 | contract MathMock { 8 | function max(uint256 a, uint256 b) public pure returns (uint256) { 9 | return Math.max(a, b); 10 | } 11 | 12 | function min(uint256 a, uint256 b) public pure returns (uint256) { 13 | return Math.min(a, b); 14 | } 15 | 16 | function average(uint256 a, uint256 b) public pure returns (uint256) { 17 | return Math.average(a, b); 18 | } 19 | 20 | function ceilDiv(uint256 a, uint256 b) public pure returns (uint256) { 21 | return Math.ceilDiv(a, b); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/MerkleProofWrapper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/MerkleProof.sol"; 6 | 7 | contract MerkleProofWrapper { 8 | function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) public pure returns (bool) { 9 | return MerkleProof.verify(proof, root, leaf); 10 | } 11 | 12 | function processProof(bytes32[] memory proof, bytes32 leaf) public pure returns (bytes32) { 13 | return MerkleProof.processProof(proof, leaf); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/MulticallTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./MulticallTokenMock.sol"; 6 | 7 | contract MulticallTest { 8 | function testReturnValues( 9 | MulticallTokenMock multicallToken, 10 | address[] calldata recipients, 11 | uint256[] calldata amounts 12 | ) external { 13 | bytes[] memory calls = new bytes[](recipients.length); 14 | for (uint256 i = 0; i < recipients.length; i++) { 15 | calls[i] = abi.encodeWithSignature("transfer(address,uint256)", recipients[i], amounts[i]); 16 | } 17 | 18 | bytes[] memory results = multicallToken.multicall(calls); 19 | for (uint256 i = 0; i < results.length; i++) { 20 | require(abi.decode(results[i], (bool))); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/ReentrancyMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../security/ReentrancyGuard.sol"; 6 | import "./ReentrancyAttack.sol"; 7 | 8 | contract ReentrancyMock is ReentrancyGuard { 9 | uint256 public counter; 10 | 11 | constructor() { 12 | counter = 0; 13 | } 14 | 15 | function callback() external nonReentrant { 16 | _count(); 17 | } 18 | 19 | function countLocalRecursive(uint256 n) public nonReentrant { 20 | if (n > 0) { 21 | _count(); 22 | countLocalRecursive(n - 1); 23 | } 24 | } 25 | 26 | function countThisRecursive(uint256 n) public nonReentrant { 27 | if (n > 0) { 28 | _count(); 29 | (bool success, ) = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1)); 30 | require(success, "ReentrancyMock: failed call"); 31 | } 32 | } 33 | 34 | function countAndCall(ReentrancyAttack attacker) public nonReentrant { 35 | _count(); 36 | bytes4 func = bytes4(keccak256("callback()")); 37 | attacker.callSender(func); 38 | } 39 | 40 | function _count() private { 41 | counter += 1; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/murky/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(address signer, bytes32 hash, bytes memory signature) public view returns (bool) { 11 | return signer.isValidSignatureNow(hash, signature); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/mocks/SingleInheritanceInitializableMocks.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../proxy/utils/Initializable.sol"; 6 | 7 | /** 8 | * @title MigratableMockV1 9 | * @dev This contract is a mock to test initializable functionality through migrations 10 | */ 11 | contract MigratableMockV1 is Initializable { 12 | uint256 public x; 13 | 14 | function initialize(uint256 value) public payable initializer { 15 | x = value; 16 | } 17 | } 18 | 19 | /** 20 | * @title MigratableMockV2 21 | * @dev This contract is a mock to test migratable functionality with params 22 | */ 23 | contract MigratableMockV2 is MigratableMockV1 { 24 | bool internal _migratedV2; 25 | uint256 public y; 26 | 27 | function migrate(uint256 value, uint256 anotherValue) public payable { 28 | require(!_migratedV2); 29 | x = value; 30 | y = anotherValue; 31 | _migratedV2 = true; 32 | } 33 | } 34 | 35 | /** 36 | * @title MigratableMockV3 37 | * @dev This contract is a mock to test migratable functionality without params 38 | */ 39 | contract MigratableMockV3 is MigratableMockV2 { 40 | bool internal _migratedV3; 41 | 42 | function migrate() public payable { 43 | require(!_migratedV3); 44 | uint256 oldX = x; 45 | x = y; 46 | y = oldX; 47 | _migratedV3 = true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/StorageSlotMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/StorageSlot.sol"; 6 | 7 | contract StorageSlotMock { 8 | using StorageSlot for bytes32; 9 | 10 | function setBoolean(bytes32 slot, bool value) public { 11 | slot.getBooleanSlot().value = value; 12 | } 13 | 14 | function setAddress(bytes32 slot, address value) public { 15 | slot.getAddressSlot().value = value; 16 | } 17 | 18 | function setBytes32(bytes32 slot, bytes32 value) public { 19 | slot.getBytes32Slot().value = value; 20 | } 21 | 22 | function setUint256(bytes32 slot, uint256 value) public { 23 | slot.getUint256Slot().value = value; 24 | } 25 | 26 | function getBoolean(bytes32 slot) public view returns (bool) { 27 | return slot.getBooleanSlot().value; 28 | } 29 | 30 | function getAddress(bytes32 slot) public view returns (address) { 31 | return slot.getAddressSlot().value; 32 | } 33 | 34 | function getBytes32(bytes32 slot) public view returns (bytes32) { 35 | return slot.getBytes32Slot().value; 36 | } 37 | 38 | function getUint256(bytes32 slot) public view returns (uint256) { 39 | return slot.getUint256Slot().value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/murky/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 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/TimersBlockNumberImpl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Timers.sol"; 6 | 7 | contract TimersBlockNumberImpl { 8 | using Timers for Timers.BlockNumber; 9 | 10 | Timers.BlockNumber private _timer; 11 | 12 | function getDeadline() public view returns (uint64) { 13 | return _timer.getDeadline(); 14 | } 15 | 16 | function setDeadline(uint64 timestamp) public { 17 | _timer.setDeadline(timestamp); 18 | } 19 | 20 | function reset() public { 21 | _timer.reset(); 22 | } 23 | 24 | function isUnset() public view returns (bool) { 25 | return _timer.isUnset(); 26 | } 27 | 28 | function isStarted() public view returns (bool) { 29 | return _timer.isStarted(); 30 | } 31 | 32 | function isPending() public view returns (bool) { 33 | return _timer.isPending(); 34 | } 35 | 36 | function isExpired() public view returns (bool) { 37 | return _timer.isExpired(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/TimersTimestampImpl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/Timers.sol"; 6 | 7 | contract TimersTimestampImpl { 8 | using Timers for Timers.Timestamp; 9 | 10 | Timers.Timestamp private _timer; 11 | 12 | function getDeadline() public view returns (uint64) { 13 | return _timer.getDeadline(); 14 | } 15 | 16 | function setDeadline(uint64 timestamp) public { 17 | _timer.setDeadline(timestamp); 18 | } 19 | 20 | function reset() public { 21 | _timer.reset(); 22 | } 23 | 24 | function isUnset() public view returns (bool) { 25 | return _timer.isUnset(); 26 | } 27 | 28 | function isStarted() public view returns (bool) { 29 | return _timer.isStarted(); 30 | } 31 | 32 | function isPending() public view returns (bool) { 33 | return _timer.isPending(); 34 | } 35 | 36 | function isExpired() public view returns (bool) { 37 | return _timer.isExpired(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/UUPS/UUPSUpgradeableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../CountersImpl.sol"; 6 | import "../../proxy/utils/UUPSUpgradeable.sol"; 7 | 8 | contract UUPSUpgradeableMock is CountersImpl, UUPSUpgradeable { 9 | // Not having any checks in this function is dangerous! Do not do this outside tests! 10 | function _authorizeUpgrade(address) internal virtual override {} 11 | } 12 | 13 | contract UUPSUpgradeableUnsafeMock is UUPSUpgradeableMock { 14 | function upgradeTo(address newImplementation) external virtual override { 15 | ERC1967Upgrade._upgradeToAndCall(newImplementation, bytes(""), false); 16 | } 17 | 18 | function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual override { 19 | ERC1967Upgrade._upgradeToAndCall(newImplementation, data, false); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/mocks/VotesMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../governance/utils/Votes.sol"; 6 | 7 | contract VotesMock is Votes { 8 | mapping(address => uint256) private _balances; 9 | mapping(uint256 => address) private _owners; 10 | 11 | constructor(string memory name) EIP712(name, "1") {} 12 | 13 | function getTotalSupply() public view returns (uint256) { 14 | return _getTotalSupply(); 15 | } 16 | 17 | function delegate(address account, address newDelegation) public { 18 | return _delegate(account, newDelegation); 19 | } 20 | 21 | function _getVotingUnits(address account) internal view virtual override returns (uint256) { 22 | return _balances[account]; 23 | } 24 | 25 | function mint(address account, uint256 voteId) external { 26 | _balances[account] += 1; 27 | _owners[voteId] = account; 28 | _transferVotingUnits(address(0), account, 1); 29 | } 30 | 31 | function burn(uint256 voteId) external { 32 | address owner = _owners[voteId]; 33 | _balances[owner] -= 1; 34 | _transferVotingUnits(owner, address(0), 1); 35 | } 36 | 37 | function getChainId() external view returns (uint256) { 38 | return block.chainid; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@openzeppelin/contracts", 3 | "description": "Secure Smart Contract library for Solidity", 4 | "version": "4.5.0", 5 | "files": [ 6 | "**/*.sol", 7 | "/build/contracts/*.json", 8 | "!/mocks/**/*" 9 | ], 10 | "scripts": { 11 | "prepare": "bash ../scripts/prepare-contracts-package.sh", 12 | "prepare-docs": "cd ..; npm run prepare-docs" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/OpenZeppelin/openzeppelin-contracts.git" 17 | }, 18 | "keywords": [ 19 | "solidity", 20 | "ethereum", 21 | "smart", 22 | "contracts", 23 | "security", 24 | "zeppelin" 25 | ], 26 | "author": "OpenZeppelin Community ", 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/OpenZeppelin/openzeppelin-contracts/issues" 30 | }, 31 | "homepage": "https://openzeppelin.com/contracts/" 32 | } 33 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC1155.sol"; 7 | 8 | /** 9 | * @dev Extension of {ERC1155} that allows token holders to destroy both their 10 | * own tokens and those that they have been approved to use. 11 | * 12 | * _Available since v3.1._ 13 | */ 14 | abstract contract ERC1155Burnable is ERC1155 { 15 | function burn(address account, uint256 id, uint256 value) public virtual { 16 | require( 17 | account == _msgSender() || isApprovedForAll(account, _msgSender()), 18 | "ERC1155: caller is not owner nor approved" 19 | ); 20 | 21 | _burn(account, id, value); 22 | } 23 | 24 | function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual { 25 | require( 26 | account == _msgSender() || isApprovedForAll(account, _msgSender()), 27 | "ERC1155: caller is not owner nor approved" 28 | ); 29 | 30 | _burnBatch(account, ids, values); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC1155.sol"; 7 | import "../../../security/Pausable.sol"; 8 | 9 | /** 10 | * @dev ERC1155 token with pausable token transfers, minting and burning. 11 | * 12 | * Useful for scenarios such as preventing trades until the end of an evaluation 13 | * period, or having an emergency switch for freezing all token transfers in the 14 | * event of a large bug. 15 | * 16 | * _Available since v3.1._ 17 | */ 18 | abstract contract ERC1155Pausable is ERC1155, Pausable { 19 | /** 20 | * @dev See {ERC1155-_beforeTokenTransfer}. 21 | * 22 | * Requirements: 23 | * 24 | * - the contract must not be paused. 25 | */ 26 | function _beforeTokenTransfer( 27 | address operator, 28 | address from, 29 | address to, 30 | uint256[] memory ids, 31 | uint256[] memory amounts, 32 | bytes memory data 33 | ) internal virtual override { 34 | super._beforeTokenTransfer(operator, from, to, ids, amounts, data); 35 | 36 | require(!paused(), "ERC1155Pausable: token transfer while paused"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./ERC1155Receiver.sol"; 7 | 8 | /** 9 | * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. 10 | * 11 | * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be 12 | * stuck. 13 | * 14 | * @dev _Available since v3.1._ 15 | */ 16 | contract ERC1155Holder is ERC1155Receiver { 17 | function onERC1155Received( 18 | address, 19 | address, 20 | uint256, 21 | uint256, 22 | bytes memory 23 | ) public virtual override returns (bytes4) { 24 | return this.onERC1155Received.selector; 25 | } 26 | 27 | function onERC1155BatchReceived( 28 | address, 29 | address, 30 | uint256[] memory, 31 | uint256[] memory, 32 | bytes memory 33 | ) public virtual override returns (bytes4) { 34 | return this.onERC1155BatchReceived.selector; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC20.sol"; 7 | import "../../../utils/Context.sol"; 8 | 9 | /** 10 | * @dev Extension of {ERC20} that allows token holders to destroy both their own 11 | * tokens and those that they have an allowance for, in a way that can be 12 | * recognized off-chain (via event analysis). 13 | */ 14 | abstract contract ERC20Burnable is Context, ERC20 { 15 | /** 16 | * @dev Destroys `amount` tokens from the caller. 17 | * 18 | * See {ERC20-_burn}. 19 | */ 20 | function burn(uint256 amount) public virtual { 21 | _burn(_msgSender(), amount); 22 | } 23 | 24 | /** 25 | * @dev Destroys `amount` tokens from `account`, deducting from the caller's 26 | * allowance. 27 | * 28 | * See {ERC20-_burn} and {ERC20-allowance}. 29 | * 30 | * Requirements: 31 | * 32 | * - the caller must have allowance for ``accounts``'s tokens of at least 33 | * `amount`. 34 | */ 35 | function burnFrom(address account, uint256 amount) public virtual { 36 | _spendAllowance(account, _msgSender(), amount); 37 | _burn(account, amount); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Capped.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Capped.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC20.sol"; 7 | 8 | /** 9 | * @dev Extension of {ERC20} that adds a cap to the supply of tokens. 10 | */ 11 | abstract contract ERC20Capped is ERC20 { 12 | uint256 private immutable _cap; 13 | 14 | /** 15 | * @dev Sets the value of the `cap`. This value is immutable, it can only be 16 | * set once during construction. 17 | */ 18 | constructor(uint256 cap_) { 19 | require(cap_ > 0, "ERC20Capped: cap is 0"); 20 | _cap = cap_; 21 | } 22 | 23 | /** 24 | * @dev Returns the cap on the token's total supply. 25 | */ 26 | function cap() public view virtual returns (uint256) { 27 | return _cap; 28 | } 29 | 30 | /** 31 | * @dev See {ERC20-_mint}. 32 | */ 33 | function _mint(address account, uint256 amount) internal virtual override { 34 | require(ERC20.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded"); 35 | super._mint(account, amount); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Pausable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/ERC20Pausable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC20.sol"; 7 | import "../../../security/Pausable.sol"; 8 | 9 | /** 10 | * @dev ERC20 token with pausable token transfers, minting and burning. 11 | * 12 | * Useful for scenarios such as preventing trades until the end of an evaluation 13 | * period, or having an emergency switch for freezing all token transfers in the 14 | * event of a large bug. 15 | */ 16 | abstract contract ERC20Pausable is ERC20, Pausable { 17 | /** 18 | * @dev See {ERC20-_beforeTokenTransfer}. 19 | * 20 | * Requirements: 21 | * 22 | * - the contract must not be paused. 23 | */ 24 | function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { 25 | super._beforeTokenTransfer(from, to, amount); 26 | 27 | require(!paused(), "ERC20Pausable: token transfer while paused"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC20.sol"; 7 | 8 | /** 9 | * @dev Interface for the optional metadata functions from the ERC20 standard. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | interface IERC20Metadata is IERC20 { 14 | /** 15 | * @dev Returns the name of the token. 16 | */ 17 | function name() external view returns (string memory); 18 | 19 | /** 20 | * @dev Returns the symbol of the token. 21 | */ 22 | function symbol() external view returns (string memory); 23 | 24 | /** 25 | * @dev Returns the decimals places of the token. 26 | */ 27 | function decimals() external view returns (uint8); 28 | } 29 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/presets/ERC20PresetFixedSupply.sol) 3 | pragma solidity ^0.8.0; 4 | 5 | import "../extensions/ERC20Burnable.sol"; 6 | 7 | /** 8 | * @dev {ERC20} token, including: 9 | * 10 | * - Preminted initial supply 11 | * - Ability for holders to burn (destroy) their tokens 12 | * - No access control mechanism (for minting/pausing) and hence no governance 13 | * 14 | * This contract uses {ERC20Burnable} to include burn capabilities - head to 15 | * its documentation for details. 16 | * 17 | * _Available since v3.4._ 18 | * 19 | * _Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._ 20 | */ 21 | contract ERC20PresetFixedSupply is ERC20Burnable { 22 | /** 23 | * @dev Mints `initialSupply` amount of token and transfers them to `owner`. 24 | * 25 | * See {ERC20-constructor}. 26 | */ 27 | constructor(string memory name, string memory symbol, uint256 initialSupply, address owner) ERC20(name, symbol) { 28 | _mint(owner, initialSupply); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @title ERC721 token receiver interface 8 | * @dev Interface for any contract that wants to support safeTransfers 9 | * from ERC721 asset contracts. 10 | */ 11 | interface IERC721Receiver { 12 | /** 13 | * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} 14 | * by `operator` from `from`, this function is called. 15 | * 16 | * It must return its Solidity selector to confirm the token transfer. 17 | * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. 18 | * 19 | * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. 20 | */ 21 | function onERC721Received( 22 | address operator, 23 | address from, 24 | uint256 tokenId, 25 | bytes calldata data 26 | ) external returns (bytes4); 27 | } 28 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Burnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Burnable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC721.sol"; 7 | import "../../../utils/Context.sol"; 8 | 9 | /** 10 | * @title ERC721 Burnable Token 11 | * @dev ERC721 Token that can be burned (destroyed). 12 | */ 13 | abstract contract ERC721Burnable is Context, ERC721 { 14 | /** 15 | * @dev Burns `tokenId`. See {ERC721-_burn}. 16 | * 17 | * Requirements: 18 | * 19 | * - The caller must own `tokenId` or be an approved operator. 20 | */ 21 | function burn(uint256 tokenId) public virtual { 22 | //solhint-disable-next-line max-line-length 23 | require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); 24 | _burn(tokenId); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Pausable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../ERC721.sol"; 7 | import "../../../security/Pausable.sol"; 8 | 9 | /** 10 | * @dev ERC721 token with pausable token transfers, minting and burning. 11 | * 12 | * Useful for scenarios such as preventing trades until the end of an evaluation 13 | * period, or having an emergency switch for freezing all token transfers in the 14 | * event of a large bug. 15 | */ 16 | abstract contract ERC721Pausable is ERC721, Pausable { 17 | /** 18 | * @dev See {ERC721-_beforeTokenTransfer}. 19 | * 20 | * Requirements: 21 | * 22 | * - the contract must not be paused. 23 | */ 24 | function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override { 25 | super._beforeTokenTransfer(from, to, tokenId); 26 | 27 | require(!paused(), "ERC721Pausable: token transfer while paused"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721.sol"; 7 | 8 | /** 9 | * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension 10 | * @dev See https://eips.ethereum.org/EIPS/eip-721 11 | */ 12 | interface IERC721Enumerable is IERC721 { 13 | /** 14 | * @dev Returns the total amount of tokens stored by the contract. 15 | */ 16 | function totalSupply() external view returns (uint256); 17 | 18 | /** 19 | * @dev Returns a token ID owned by `owner` at a given `index` of its token list. 20 | * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. 21 | */ 22 | function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); 23 | 24 | /** 25 | * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. 26 | * Use along with {totalSupply} to enumerate all tokens. 27 | */ 28 | function tokenByIndex(uint256 index) external view returns (uint256); 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721.sol"; 7 | 8 | /** 9 | * @title ERC-721 Non-Fungible Token Standard, optional metadata extension 10 | * @dev See https://eips.ethereum.org/EIPS/eip-721 11 | */ 12 | interface IERC721Metadata is IERC721 { 13 | /** 14 | * @dev Returns the token collection name. 15 | */ 16 | function name() external view returns (string memory); 17 | 18 | /** 19 | * @dev Returns the token collection symbol. 20 | */ 21 | function symbol() external view returns (string memory); 22 | 23 | /** 24 | * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. 25 | */ 26 | function tokenURI(uint256 tokenId) external view returns (string memory); 27 | } 28 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "../IERC721Receiver.sol"; 7 | 8 | /** 9 | * @dev Implementation of the {IERC721Receiver} interface. 10 | * 11 | * Accepts all token transfers. 12 | * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. 13 | */ 14 | contract ERC721Holder is IERC721Receiver { 15 | /** 16 | * @dev See {IERC721Receiver-onERC721Received}. 17 | * 18 | * Always returns `IERC721Receiver.onERC721Received.selector`. 19 | */ 20 | function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { 21 | return this.onERC721Received.selector; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC777/IERC777Recipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC777/IERC777Recipient.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP. 8 | * 9 | * Accounts can be notified of {IERC777} tokens being sent to them by having a 10 | * contract implement this interface (contract holders can be their own 11 | * implementer) and registering it on the 12 | * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry]. 13 | * 14 | * See {IERC1820Registry} and {ERC1820Implementer}. 15 | */ 16 | interface IERC777Recipient { 17 | /** 18 | * @dev Called by an {IERC777} token contract whenever tokens are being 19 | * moved or created into a registered account (`to`). The type of operation 20 | * is conveyed by `from` being the zero address or not. 21 | * 22 | * This call occurs _after_ the token contract's state is updated, so 23 | * {IERC777-balanceOf}, etc., can be used to query the post-operation state. 24 | * 25 | * This function may revert to prevent the operation from being executed. 26 | */ 27 | function tokensReceived( 28 | address operator, 29 | address from, 30 | address to, 31 | uint256 amount, 32 | bytes calldata userData, 33 | bytes calldata operatorData 34 | ) external; 35 | } 36 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC777/IERC777Sender.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC777/IERC777Sender.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC777TokensSender standard as defined in the EIP. 8 | * 9 | * {IERC777} Token holders can be notified of operations performed on their 10 | * tokens by having a contract implement this interface (contract holders can be 11 | * their own implementer) and registering it on the 12 | * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry]. 13 | * 14 | * See {IERC1820Registry} and {ERC1820Implementer}. 15 | */ 16 | interface IERC777Sender { 17 | /** 18 | * @dev Called by an {IERC777} token contract whenever a registered holder's 19 | * (`from`) tokens are about to be moved or destroyed. The type of operation 20 | * is conveyed by `to` being the zero address or not. 21 | * 22 | * This call occurs _before_ the token contract's state is updated, so 23 | * {IERC777-balanceOf}, etc., can be used to query the pre-operation state. 24 | * 25 | * This function may revert to prevent the operation from being executed. 26 | */ 27 | function tokensToSend( 28 | address operator, 29 | address from, 30 | address to, 31 | uint256 amount, 32 | bytes calldata userData, 33 | bytes calldata operatorData 34 | ) external; 35 | } 36 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC777/README.adoc: -------------------------------------------------------------------------------- 1 | = ERC 777 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/token/erc777 5 | 6 | This set of interfaces and contracts are all related to the [ERC777 token standard](https://eips.ethereum.org/EIPS/eip-777). 7 | 8 | TIP: For an overview of ERC777 tokens and a walk through on how to create a token contract read our xref:ROOT:erc777.adoc[ERC777 guide]. 9 | 10 | The token behavior itself is implemented in the core contracts: {IERC777}, {ERC777}. 11 | 12 | Additionally there are interfaces used to develop contracts that react to token movements: {IERC777Sender}, {IERC777Recipient}. 13 | 14 | == Core 15 | 16 | {{IERC777}} 17 | 18 | {{ERC777}} 19 | 20 | == Hooks 21 | 22 | {{IERC777Sender}} 23 | 24 | {{IERC777Recipient}} 25 | 26 | == Presets 27 | 28 | These contracts are preconfigured combinations of features. They can be used through inheritance or as models to copy and paste their source code. 29 | 30 | {{ERC777PresetFixedSupply}} 31 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/token/ERC777/presets/ERC777PresetFixedSupply.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC777/presets/ERC777PresetFixedSupply.sol) 3 | pragma solidity ^0.8.0; 4 | 5 | import "../ERC777.sol"; 6 | 7 | /** 8 | * @dev {ERC777} token, including: 9 | * 10 | * - Preminted initial supply 11 | * - No access control mechanism (for minting/pausing) and hence no governance 12 | * 13 | * _Available since v3.4._ 14 | */ 15 | contract ERC777PresetFixedSupply is ERC777 { 16 | /** 17 | * @dev Mints `initialSupply` amount of token and transfers them to `owner`. 18 | * 19 | * See {ERC777-constructor}. 20 | */ 21 | constructor( 22 | string memory name, 23 | string memory symbol, 24 | address[] memory defaultOperators, 25 | uint256 initialSupply, 26 | address owner 27 | ) ERC777(name, symbol, defaultOperators) { 28 | _mint(owner, initialSupply, "", ""); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/contracts/utils/Context.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Provides information about the current execution context, including the 8 | * sender of the transaction and its data. While these are generally available 9 | * via msg.sender and msg.data, they should not be accessed in such a direct 10 | * manner, since when dealing with meta-transactions the account sending and 11 | * paying for execution may not be the actual sender (as far as an application 12 | * is concerned). 13 | * 14 | * This contract is only required for intermediate, library-like contracts. 15 | */ 16 | abstract contract Context { 17 | function _msgSender() internal view virtual returns (address) { 18 | return msg.sender; 19 | } 20 | 21 | function _msgData() internal view virtual returns (bytes calldata) { 22 | return msg.data; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/Multicall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./Address.sol"; 7 | 8 | /** 9 | * @dev Provides a function to batch together multiple calls in a single external call. 10 | * 11 | * _Available since v4.1._ 12 | */ 13 | abstract contract Multicall { 14 | /** 15 | * @dev Receives and executes a batch of function calls on this contract. 16 | */ 17 | function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { 18 | results = new bytes[](data.length); 19 | for (uint256 i = 0; i < data.length; i++) { 20 | results[i] = Address.functionDelegateCall(address(this), data[i]); 21 | } 22 | return results; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/escrow/ConditionalEscrow.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/escrow/ConditionalEscrow.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./Escrow.sol"; 7 | 8 | /** 9 | * @title ConditionalEscrow 10 | * @dev Base abstract escrow to only allow withdrawal if a condition is met. 11 | * @dev Intended usage: See {Escrow}. Same usage guidelines apply here. 12 | */ 13 | abstract contract ConditionalEscrow is Escrow { 14 | /** 15 | * @dev Returns whether an address is allowed to withdraw their funds. To be 16 | * implemented by derived contracts. 17 | * @param payee The destination address of the funds. 18 | */ 19 | function withdrawalAllowed(address payee) public view virtual returns (bool); 20 | 21 | function withdraw(address payable payee) public virtual override { 22 | require(withdrawalAllowed(payee), "ConditionalEscrow: payee is not allowed to withdraw"); 23 | super.withdraw(payee); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | import "./IERC165.sol"; 7 | 8 | /** 9 | * @dev Implementation of the {IERC165} interface. 10 | * 11 | * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check 12 | * for the additional interface id that will be supported. For example: 13 | * 14 | * ```solidity 15 | * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { 16 | * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); 17 | * } 18 | * ``` 19 | * 20 | * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. 21 | */ 22 | abstract contract ERC165 is IERC165 { 23 | /** 24 | * @dev See {IERC165-supportsInterface}. 25 | */ 26 | function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { 27 | return interfaceId == type(IERC165).interfaceId; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC165 standard, as defined in the 8 | * https://eips.ethereum.org/EIPS/eip-165[EIP]. 9 | * 10 | * Implementers can declare support of contract interfaces, which can then be 11 | * queried by others ({ERC165Checker}). 12 | * 13 | * For an implementation, see {ERC165}. 14 | */ 15 | interface IERC165 { 16 | /** 17 | * @dev Returns true if this contract implements the interface defined by 18 | * `interfaceId`. See the corresponding 19 | * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] 20 | * to learn more about how these ids are created. 21 | * 22 | * This function call must use less than 30 000 gas. 23 | */ 24 | function supportsInterface(bytes4 interfaceId) external view returns (bool); 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/introspection/IERC1820Implementer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC1820Implementer.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface for an ERC1820 implementer, as defined in the 8 | * https://eips.ethereum.org/EIPS/eip-1820#interface-implementation-erc1820implementerinterface[EIP]. 9 | * Used by contracts that will be registered as implementers in the 10 | * {IERC1820Registry}. 11 | */ 12 | interface IERC1820Implementer { 13 | /** 14 | * @dev Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contract 15 | * implements `interfaceHash` for `account`. 16 | * 17 | * See {IERC1820Registry-setInterfaceImplementer}. 18 | */ 19 | function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32); 20 | } 21 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/math/Math.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Standard math utilities missing in the Solidity language. 8 | */ 9 | library Math { 10 | /** 11 | * @dev Returns the largest of two numbers. 12 | */ 13 | function max(uint256 a, uint256 b) internal pure returns (uint256) { 14 | return a >= b ? a : b; 15 | } 16 | 17 | /** 18 | * @dev Returns the smallest of two numbers. 19 | */ 20 | function min(uint256 a, uint256 b) internal pure returns (uint256) { 21 | return a < b ? a : b; 22 | } 23 | 24 | /** 25 | * @dev Returns the average of two numbers. The result is rounded towards 26 | * zero. 27 | */ 28 | function average(uint256 a, uint256 b) internal pure returns (uint256) { 29 | // (a + b) / 2 can overflow. 30 | return (a & b) + (a ^ b) / 2; 31 | } 32 | 33 | /** 34 | * @dev Returns the ceiling of the division of two numbers. 35 | * 36 | * This differs from standard division with `/` in that it rounds up instead 37 | * of rounding down. 38 | */ 39 | function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { 40 | // (a + b - 1) / b can overflow on addition, so we distribute. 41 | return a / b + (a % b == 0 ? 0 : 1); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/SignedMath.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Standard signed math utilities missing in the Solidity language. 8 | */ 9 | library SignedMath { 10 | /** 11 | * @dev Returns the largest of two signed numbers. 12 | */ 13 | function max(int256 a, int256 b) internal pure returns (int256) { 14 | return a >= b ? a : b; 15 | } 16 | 17 | /** 18 | * @dev Returns the smallest of two signed numbers. 19 | */ 20 | function min(int256 a, int256 b) internal pure returns (int256) { 21 | return a < b ? a : b; 22 | } 23 | 24 | /** 25 | * @dev Returns the average of two signed numbers without overflow. 26 | * The result is rounded towards zero. 27 | */ 28 | function average(int256 a, int256 b) internal pure returns (int256) { 29 | // Formula from the book "Hacker's Delight" 30 | int256 x = (a & b) + ((a ^ b) >> 1); 31 | return x + (int256(uint256(x) >> 255) & (a ^ b)); 32 | } 33 | 34 | /** 35 | * @dev Returns the absolute unsigned value of a signed value. 36 | */ 37 | function abs(int256 n) internal pure returns (uint256) { 38 | unchecked { 39 | // must be unchecked in order to support `n = type(int256).min` 40 | return uint256(n >= 0 ? n : -n); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IMessageProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | /* 4 | * Copyright 2021, Offchain Labs, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | pragma solidity ^0.8.0; 20 | 21 | interface IMessageProvider { 22 | event InboxMessageDelivered(uint256 indexed messageNum, bytes data); 23 | 24 | event InboxMessageDeliveredFromOrigin(uint256 indexed messageNum); 25 | } 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/vendor/compound/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Compound Labs, Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/vendor/optimism/ICrossDomainMessenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >0.5.0 <0.9.0; 3 | 4 | /** 5 | * @title ICrossDomainMessenger 6 | */ 7 | interface ICrossDomainMessenger { 8 | /********** 9 | * Events * 10 | **********/ 11 | 12 | event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit); 13 | event RelayedMessage(bytes32 indexed msgHash); 14 | event FailedRelayedMessage(bytes32 indexed msgHash); 15 | 16 | /************* 17 | * Variables * 18 | *************/ 19 | 20 | function xDomainMessageSender() external view returns (address); 21 | 22 | /******************** 23 | * Public Functions * 24 | ********************/ 25 | 26 | /** 27 | * Sends a cross domain message to the target messenger. 28 | * @param _target Target contract address. 29 | * @param _message Message to send to the target. 30 | * @param _gasLimit Gas limit for the provided message. 31 | */ 32 | function sendMessage(address _target, bytes calldata _message, uint32 _gasLimit) external; 33 | } 34 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/vendor/optimism/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright 2020-2021 Optimism 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/contracts/vendor/polygon/IFxMessageProcessor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IFxMessageProcessor { 5 | function processMessageFromRoot(uint256 stateId, address rootMessageSender, bytes calldata data) external; 6 | } 7 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/antora.yml: -------------------------------------------------------------------------------- 1 | name: contracts 2 | title: Contracts 3 | version: 4.x 4 | nav: 5 | - modules/ROOT/nav.adoc 6 | - modules/api/nav.adoc 7 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/helpers.js: -------------------------------------------------------------------------------- 1 | const { version } = require('../package.json'); 2 | 3 | module.exports = { 4 | 'github-link': (contractPath) => { 5 | if (typeof contractPath !== 'string') { 6 | throw new Error('Missing argument'); 7 | } 8 | return `https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v${version}/contracts/${contractPath}`; 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPolygon/account-binary-search-tree/cd9b4b1d733a72ec641941d9e81d90922881f395/lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-admin.png -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPolygon/account-binary-search-tree/cd9b4b1d733a72ec641941d9e81d90922881f395/lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc: -------------------------------------------------------------------------------- 1 | * xref:index.adoc[Overview] 2 | * xref:wizard.adoc[Wizard] 3 | * xref:extending-contracts.adoc[Extending Contracts] 4 | * xref:upgradeable.adoc[Using with Upgrades] 5 | 6 | * xref:releases-stability.adoc[Releases & Stability] 7 | 8 | * xref:access-control.adoc[Access Control] 9 | 10 | * xref:tokens.adoc[Tokens] 11 | ** xref:erc20.adoc[ERC20] 12 | *** xref:erc20-supply.adoc[Creating Supply] 13 | ** xref:erc721.adoc[ERC721] 14 | ** xref:erc777.adoc[ERC777] 15 | ** xref:erc1155.adoc[ERC1155] 16 | 17 | * xref:governance.adoc[Governance] 18 | 19 | * xref:utilities.adoc[Utilities] 20 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/pages/crowdsales.adoc: -------------------------------------------------------------------------------- 1 | = Crowdsales 2 | 3 | All crowdsale-related contracts were removed from the OpenZeppelin Contracts library on the https://forum.openzeppelin.com/t/openzeppelin-contracts-v3-0-beta-release/2256[v3.0.0 release] due to both a decline in their usage and the complexity associated with migrating them to Solidity v0.6. 4 | 5 | They are however still available on the v2.5 release of OpenZeppelin Contracts, which you can install by running: 6 | 7 | ```console 8 | $ npm install @openzeppelin/contracts@v2.5 9 | ``` 10 | 11 | Refer to the https://docs.openzeppelin.com/contracts/2.x/crowdsales[v2.x documentation] when working with them. 12 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/pages/drafts.adoc: -------------------------------------------------------------------------------- 1 | = Drafts 2 | 3 | All draft contracts were either moved into a different directory or removed from the OpenZeppelin Contracts library on the https://forum.openzeppelin.com/t/openzeppelin-contracts-v3-0-beta-release/2256[v3.0.0 release]. 4 | 5 | * `ERC20Migrator`: removed. 6 | * xref:api:token/ERC20.adoc#ERC20Snapshot[`ERC20Snapshot`]: moved to `token/ERC20`. 7 | * `ERC20Detailed` and `ERC1046`: removed. 8 | * `TokenVesting`: removed. Pending a replacement that is being discussed in https://github.com/OpenZeppelin/openzeppelin-contracts/issues/1214[`#1214`]. 9 | * xref:api:utils.adoc#Counters[`Counters`]: moved to xref:api:utils.adoc[`utils`]. 10 | * xref:api:utils.adoc#Strings[`Strings`]: moved to xref:api:utils.adoc[`utils`]. 11 | * xref:api:utils.adoc#SignedSafeMath[`SignedSafeMath`]: moved to xref:api:utils.adoc[`utils`]. 12 | 13 | Removed contracts are still available on the v2.5 release of OpenZeppelin Contracts, which you can install by running: 14 | 15 | ```console 16 | $ npm install @openzeppelin/contracts@v2.5 17 | ``` 18 | 19 | Refer to the xref:2.x@contracts:api:drafts.adoc[v2.x documentation] when working with them. 20 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/modules/ROOT/pages/wizard.adoc: -------------------------------------------------------------------------------- 1 | = Contracts Wizard 2 | :page-notoc: 3 | 4 | Not sure where to start? Use the interactive generator below to bootstrap your 5 | contract and learn about the components offered in OpenZeppelin Contracts. 6 | 7 | TIP: Place the resulting contract in your `contracts` directory in order to compile it with a tool like Hardhat or Truffle. Consider reading our guide on xref:learn::developing-smart-contracts.adoc[Developing Smart Contracts] for more guidance! 8 | 9 | ++++ 10 | 11 | 12 | 13 | ++++ 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/docs/prelude.hbs: -------------------------------------------------------------------------------- 1 | :github-icon: pass:[] 2 | 3 | {{#links}} 4 | :{{slug target.fullName}}: pass:normal[xref:{{path}}#{{target.anchor}}[`{{target.fullName}}`]] :xref-{{slug 5 | target.anchor 6 | }}: xref:{{path}}#{{target.anchor}} 7 | {{/links}} -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPolygon/account-binary-search-tree/cd9b4b1d733a72ec641941d9e81d90922881f395/lib/murky/lib/openzeppelin-contracts/migrations/.gitkeep -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run docs" 3 | publish = "build/site" 4 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["github>OpenZeppelin/code-style"], 3 | "packageRules": [ 4 | { 5 | "extends": ["packages:eslint"], 6 | "enabled": false 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/scripts/gen-nav.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const path = require('path'); 4 | const proc = require('child_process'); 5 | const startCase = require('lodash.startcase'); 6 | 7 | const baseDir = process.argv[2]; 8 | 9 | const files = proc 10 | .execFileSync('find', [baseDir, '-type', 'f'], { encoding: 'utf8' }) 11 | .split('\n') 12 | .filter((s) => s !== ''); 13 | 14 | console.log('.API'); 15 | 16 | function getPageTitle(directory) { 17 | switch (directory) { 18 | case 'metatx': 19 | return 'Meta Transactions'; 20 | case 'common': 21 | return 'Common (Tokens)'; 22 | default: 23 | return startCase(directory); 24 | } 25 | } 26 | 27 | const links = files.map((file) => { 28 | const doc = file.replace(baseDir, ''); 29 | const title = path.parse(file).name; 30 | 31 | return { 32 | xref: `* xref:${doc}[${getPageTitle(title)}]`, 33 | title, 34 | }; 35 | }); 36 | 37 | // Case-insensitive sort based on titles (so 'token/ERC20' gets sorted as 'erc20') 38 | const sortedLinks = links.sort(function (a, b) { 39 | return a.title.toLowerCase().localeCompare(b.title.toLowerCase(), undefined, { numeric: true }); 40 | }); 41 | 42 | for (const link of sortedLinks) { 43 | console.log(link.xref); 44 | } 45 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/scripts/release/update-changelog-release-date.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Sets the release date of the current release in the changelog. 4 | // This is run automatically when npm version is run. 5 | 6 | const fs = require('fs'); 7 | const cp = require('child_process'); 8 | 9 | const suffix = process.env.PRERELEASE_SUFFIX || 'rc'; 10 | 11 | const changelog = fs.readFileSync('CHANGELOG.md', 'utf8'); 12 | 13 | // The changelog entry to be updated looks like this: 14 | // ## Unreleased 15 | // We need to add the version and release date in a YYYY-MM-DD format, so that it looks like this: 16 | // ## 2.5.3 (2019-04-25) 17 | 18 | const pkg = require('../../package.json'); 19 | const version = pkg.version.replace(new RegExp('-' + suffix + '\\..*'), ''); 20 | 21 | const header = new RegExp(`^## (Unreleased|${version})$`, 'm'); 22 | 23 | if (!header.test(changelog)) { 24 | console.error('Missing changelog entry'); 25 | process.exit(1); 26 | } 27 | 28 | const newHeader = 29 | pkg.version.indexOf(suffix) === -1 ? `## ${version} (${new Date().toISOString().split('T')[0]})` : `## ${version}`; 30 | 31 | fs.writeFileSync('CHANGELOG.md', changelog.replace(header, newHeader)); 32 | 33 | cp.execSync('git add CHANGELOG.md', { stdio: 'inherit' }); 34 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/scripts/release/update-comment.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const fs = require('fs'); 3 | const proc = require('child_process'); 4 | const semver = require('semver'); 5 | const run = (cmd, ...args) => proc.execFileSync(cmd, args, { encoding: 'utf8' }).trim(); 6 | 7 | const gitStatus = run('git', 'status', '--porcelain', '-uno', 'contracts/**/*.sol'); 8 | if (gitStatus.length > 0) { 9 | console.error('Contracts directory is not clean'); 10 | process.exit(1); 11 | } 12 | 13 | const { version } = require('../../package.json'); 14 | 15 | // Get latest tag according to semver. 16 | const [tag] = run('git', 'tag') 17 | .split(/\r?\n/) 18 | .filter((v) => semver.lt(semver.coerce(v), version)) // only consider older tags, ignore current prereleases 19 | .sort(semver.rcompare); 20 | 21 | // Ordering tag → HEAD is important here. 22 | const files = run('git', 'diff', tag, 'HEAD', '--name-only', 'contracts/**/*.sol') 23 | .split(/\r?\n/) 24 | .filter((file) => file && !file.match(/mock/i)); 25 | 26 | for (const file of files) { 27 | const current = fs.readFileSync(file, 'utf8'); 28 | const updated = current.replace( 29 | /(\/\/ SPDX-License-Identifier:.*)$(\n\/\/ OpenZeppelin Contracts .*$)?/m, 30 | `$1\n// OpenZeppelin Contracts (last updated v${version}) (${file.replace('contracts/', '')})`, 31 | ); 32 | fs.writeFileSync(file, updated); 33 | } 34 | 35 | run('git', 'add', '--update', 'contracts'); 36 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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 | } 5 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/test/access/AccessControl.test.js: -------------------------------------------------------------------------------- 1 | const { shouldBehaveLikeAccessControl } = require('./AccessControl.behavior.js'); 2 | 3 | const AccessControlMock = artifacts.require('AccessControlMock'); 4 | 5 | contract('AccessControl', function (accounts) { 6 | beforeEach(async function () { 7 | this.accessControl = await AccessControlMock.new({ from: accounts[0] }); 8 | }); 9 | 10 | shouldBehaveLikeAccessControl('AccessControl', ...accounts); 11 | }); 12 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/test/helpers/customError.js: -------------------------------------------------------------------------------- 1 | const { config } = require('hardhat'); 2 | 3 | const optimizationsEnabled = config.solidity.compilers.some((c) => c.settings.optimizer.enabled); 4 | 5 | /** Revert handler that supports custom errors. */ 6 | async function expectRevertCustomError(promise, reason) { 7 | try { 8 | await promise; 9 | expect.fail("Expected promise to throw but it didn't"); 10 | } catch (revert) { 11 | if (reason) { 12 | if (optimizationsEnabled) { 13 | // Optimizations currently mess with Hardhat's decoding of custom errors 14 | expect(revert.message).to.include.oneOf([reason, 'unrecognized return data or custom error']); 15 | } else { 16 | expect(revert.message).to.include(reason); 17 | } 18 | } 19 | } 20 | } 21 | 22 | module.exports = { 23 | expectRevertCustomError, 24 | }; 25 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/test/helpers/eip712.js: -------------------------------------------------------------------------------- 1 | const ethSigUtil = require('eth-sig-util'); 2 | 3 | const EIP712Domain = [ 4 | { name: 'name', type: 'string' }, 5 | { name: 'version', type: 'string' }, 6 | { name: 'chainId', type: 'uint256' }, 7 | { name: 'verifyingContract', type: 'address' }, 8 | ]; 9 | 10 | async function domainSeparator(name, version, chainId, verifyingContract) { 11 | return ( 12 | '0x' + 13 | ethSigUtil.TypedDataUtils.hashStruct( 14 | 'EIP712Domain', 15 | { name, version, chainId, verifyingContract }, 16 | { EIP712Domain }, 17 | ).toString('hex') 18 | ); 19 | } 20 | 21 | module.exports = { 22 | EIP712Domain, 23 | domainSeparator, 24 | }; 25 | -------------------------------------------------------------------------------- /lib/murky/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('Pending', 'Active', 'Canceled', 'Defeated', 'Succeeded', 'Queued', 'Expired', 'Executed'), 10 | VoteType: Enum('Against', 'For', 'Abstain'), 11 | }; 12 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/test/migrate-imports.test.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { 3 | promises: fs, 4 | constants: { F_OK }, 5 | } = require('fs'); 6 | const { expect } = require('chai'); 7 | 8 | const { pathUpdates, updateImportPaths, getUpgradeablePath } = require('../scripts/migrate-imports.js'); 9 | 10 | describe('migrate-imports.js', function () { 11 | it('every new path exists', async function () { 12 | for (const p of Object.values(pathUpdates)) { 13 | try { 14 | await fs.access(path.join('contracts', p), F_OK); 15 | } catch (e) { 16 | await fs.access(path.join('contracts', getUpgradeablePath(p)), F_OK); 17 | } 18 | } 19 | }); 20 | 21 | it('replaces import paths in a file', async function () { 22 | const source = ` 23 | import '@openzeppelin/contracts/math/Math.sol'; 24 | import '@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol'; 25 | `; 26 | const expected = ` 27 | import '@openzeppelin/contracts/utils/math/Math.sol'; 28 | import '@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol'; 29 | `; 30 | expect(updateImportPaths(source)).to.equal(expected); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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/murky/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/murky/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Capped.behavior.js: -------------------------------------------------------------------------------- 1 | const { expectRevert } = require('@openzeppelin/test-helpers'); 2 | 3 | const { expect } = require('chai'); 4 | 5 | function shouldBehaveLikeERC20Capped(minter, [other], cap) { 6 | describe('capped token', function () { 7 | const from = minter; 8 | 9 | it('starts with the correct cap', async function () { 10 | expect(await this.token.cap()).to.be.bignumber.equal(cap); 11 | }); 12 | 13 | it('mints when amount is less than cap', async function () { 14 | await this.token.mint(other, cap.subn(1), { from }); 15 | expect(await this.token.totalSupply()).to.be.bignumber.equal(cap.subn(1)); 16 | }); 17 | 18 | it('fails to mint if the amount exceeds the cap', async function () { 19 | await this.token.mint(other, cap.subn(1), { from }); 20 | await expectRevert(this.token.mint(other, 2, { from }), 'ERC20Capped: cap exceeded'); 21 | }); 22 | 23 | it('fails to mint after cap is reached', async function () { 24 | await this.token.mint(other, cap, { from }); 25 | await expectRevert(this.token.mint(other, 1, { from }), 'ERC20Capped: cap exceeded'); 26 | }); 27 | }); 28 | } 29 | 30 | module.exports = { 31 | shouldBehaveLikeERC20Capped, 32 | }; 33 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Capped.test.js: -------------------------------------------------------------------------------- 1 | const { BN, ether, expectRevert } = require('@openzeppelin/test-helpers'); 2 | const { shouldBehaveLikeERC20Capped } = require('./ERC20Capped.behavior'); 3 | 4 | const ERC20Capped = artifacts.require('ERC20CappedMock'); 5 | 6 | contract('ERC20Capped', function (accounts) { 7 | const [minter, ...otherAccounts] = accounts; 8 | 9 | const cap = ether('1000'); 10 | 11 | const name = 'My Token'; 12 | const symbol = 'MTKN'; 13 | 14 | it('requires a non-zero cap', async function () { 15 | await expectRevert(ERC20Capped.new(name, symbol, new BN(0), { from: minter }), 'ERC20Capped: cap is 0'); 16 | }); 17 | 18 | context('once deployed', async function () { 19 | beforeEach(async function () { 20 | this.token = await ERC20Capped.new(name, symbol, cap, { from: minter }); 21 | }); 22 | 23 | shouldBehaveLikeERC20Capped(minter, otherAccounts, cap); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/test/token/ERC721/ERC721.test.js: -------------------------------------------------------------------------------- 1 | const { shouldBehaveLikeERC721, shouldBehaveLikeERC721Metadata } = require('./ERC721.behavior'); 2 | 3 | const ERC721Mock = artifacts.require('ERC721Mock'); 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 ERC721Mock.new(name, symbol); 11 | }); 12 | 13 | shouldBehaveLikeERC721('ERC721', ...accounts); 14 | shouldBehaveLikeERC721Metadata('ERC721', name, symbol, ...accounts); 15 | }); 16 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/test/token/ERC721/utils/ERC721Holder.test.js: -------------------------------------------------------------------------------- 1 | const { BN } = require('@openzeppelin/test-helpers'); 2 | 3 | const { expect } = require('chai'); 4 | 5 | const ERC721Holder = artifacts.require('ERC721Holder'); 6 | const ERC721Mock = artifacts.require('ERC721Mock'); 7 | 8 | contract('ERC721Holder', function (accounts) { 9 | const [owner] = accounts; 10 | 11 | const name = 'Non Fungible Token'; 12 | const symbol = 'NFT'; 13 | 14 | it('receives an ERC721 token', async function () { 15 | const token = await ERC721Mock.new(name, symbol); 16 | const tokenId = new BN(1); 17 | await token.mint(owner, tokenId); 18 | 19 | const receiver = await ERC721Holder.new(); 20 | await token.safeTransferFrom(owner, receiver.address, tokenId, { from: owner }); 21 | 22 | expect(await token.ownerOf(tokenId)).to.be.equal(receiver.address); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/test/utils/Base64.test.js: -------------------------------------------------------------------------------- 1 | const { expect } = require('chai'); 2 | 3 | const Base64Mock = artifacts.require('Base64Mock'); 4 | 5 | contract('Strings', function () { 6 | beforeEach(async function () { 7 | this.base64 = await Base64Mock.new(); 8 | }); 9 | 10 | describe('from bytes - base64', function () { 11 | it('converts to base64 encoded string with double padding', async function () { 12 | const TEST_MESSAGE = 'test'; 13 | const input = web3.utils.asciiToHex(TEST_MESSAGE); 14 | expect(await this.base64.encode(input)).to.equal('dGVzdA=='); 15 | }); 16 | 17 | it('converts to base64 encoded string with single padding', async function () { 18 | const TEST_MESSAGE = 'test1'; 19 | const input = web3.utils.asciiToHex(TEST_MESSAGE); 20 | expect(await this.base64.encode(input)).to.equal('dGVzdDE='); 21 | }); 22 | 23 | it('converts to base64 encoded string without padding', async function () { 24 | const TEST_MESSAGE = 'test12'; 25 | const input = web3.utils.asciiToHex(TEST_MESSAGE); 26 | expect(await this.base64.encode(input)).to.equal('dGVzdDEy'); 27 | }); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /lib/murky/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/murky/lib/openzeppelin-contracts/test/utils/escrow/ConditionalEscrow.test.js: -------------------------------------------------------------------------------- 1 | const { ether, expectRevert } = require('@openzeppelin/test-helpers'); 2 | const { shouldBehaveLikeEscrow } = require('./Escrow.behavior'); 3 | 4 | const ConditionalEscrowMock = artifacts.require('ConditionalEscrowMock'); 5 | 6 | contract('ConditionalEscrow', function (accounts) { 7 | const [owner, payee, ...otherAccounts] = accounts; 8 | 9 | beforeEach(async function () { 10 | this.escrow = await ConditionalEscrowMock.new({ from: owner }); 11 | }); 12 | 13 | context('when withdrawal is allowed', function () { 14 | beforeEach(async function () { 15 | await Promise.all(otherAccounts.map((payee) => this.escrow.setAllowed(payee, true))); 16 | }); 17 | 18 | shouldBehaveLikeEscrow(owner, otherAccounts); 19 | }); 20 | 21 | context('when withdrawal is disallowed', function () { 22 | const amount = ether('23'); 23 | 24 | beforeEach(async function () { 25 | await this.escrow.setAllowed(payee, false); 26 | }); 27 | 28 | it('reverts on withdrawals', async function () { 29 | await this.escrow.deposit(payee, { from: owner, value: amount }); 30 | 31 | await expectRevert( 32 | this.escrow.withdraw(payee, { from: owner }), 33 | 'ConditionalEscrow: payee is not allowed to withdraw', 34 | ); 35 | }); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /lib/murky/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/murky/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(['ERC165']); 11 | }); 12 | -------------------------------------------------------------------------------- /lib/murky/lib/openzeppelin-contracts/test/utils/introspection/ERC165Storage.test.js: -------------------------------------------------------------------------------- 1 | const { expectRevert } = require('@openzeppelin/test-helpers'); 2 | 3 | const { shouldSupportInterfaces } = require('./SupportsInterface.behavior'); 4 | 5 | const ERC165Mock = artifacts.require('ERC165StorageMock'); 6 | 7 | contract('ERC165Storage', function (accounts) { 8 | beforeEach(async function () { 9 | this.mock = await ERC165Mock.new(); 10 | }); 11 | 12 | it('register interface', async function () { 13 | expect(await this.mock.supportsInterface('0x00000001')).to.be.equal(false); 14 | await this.mock.registerInterface('0x00000001'); 15 | expect(await this.mock.supportsInterface('0x00000001')).to.be.equal(true); 16 | }); 17 | 18 | it('does not allow 0xffffffff', async function () { 19 | await expectRevert(this.mock.registerInterface('0xffffffff'), 'ERC165: invalid interface id'); 20 | }); 21 | 22 | shouldSupportInterfaces(['ERC165']); 23 | }); 24 | -------------------------------------------------------------------------------- /lib/murky/reports/murky_gas_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPolygon/account-binary-search-tree/cd9b4b1d733a72ec641941d9e81d90922881f395/lib/murky/reports/murky_gas_report.png -------------------------------------------------------------------------------- /lib/murky/src/Merkle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | import "./common/MurkyBase.sol"; 5 | 6 | /// @notice Nascent, simple, kinda efficient (and improving!) Merkle proof generator and verifier 7 | /// @author dmfxyz 8 | /// @dev Note Generic Merkle Tree 9 | contract Merkle is MurkyBase { 10 | /******************** 11 | * HASHING FUNCTION * 12 | ********************/ 13 | 14 | /// ascending sort and concat prior to hashing 15 | function hashLeafPairs(bytes32 left, bytes32 right) public pure override returns (bytes32 _hash) { 16 | assembly { 17 | switch lt(left, right) 18 | case 0 { 19 | mstore(0x0, right) 20 | mstore(0x20, left) 21 | } 22 | default { 23 | mstore(0x0, left) 24 | mstore(0x20, right) 25 | } 26 | _hash := keccak256(0x0, 0x40) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/src/Xorkle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.4; 3 | 4 | import "./common/MurkyBase.sol"; 5 | 6 | /// @notice Nascent, simple, kinda efficient (and improving!) Merkle proof generator and verifier 7 | /// @author dmfxyz 8 | /// @dev Note Xor Based "Merkle" Tree 9 | contract Xorkle is MurkyBase { 10 | /******************** 11 | * HASHING FUNCTION * 12 | ********************/ 13 | 14 | function hashLeafPairs(bytes32 left, bytes32 right) public pure override returns (bytes32 _hash) { 15 | // saves a few gas lol 16 | assembly { 17 | mstore(0x0, xor(left, right)) 18 | _hash := keccak256(0x0, 0x20) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/murky/src/test/MurkyBase.t.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.4; 2 | 3 | import "forge-std/Test.sol"; 4 | import "../common/MurkyBase.sol"; 5 | 6 | contract MurkyBaseTest is Test, MurkyBase { 7 | // Hacky way to test the base functions until transitioned to library 8 | function hashLeafPairs(bytes32, bytes32) public pure virtual override returns (bytes32) { 9 | return bytes32(0x0); 10 | } 11 | 12 | function testLogCeil(uint256 x) public { 13 | vm.assume(x > 0); 14 | this.log2ceil(x); 15 | } 16 | 17 | function testLogCeilBitMagic(uint256 x) public { 18 | vm.assume(x > 0); 19 | this.log2ceilBitMagic(x); 20 | } 21 | 22 | function testLogCeil_KnownPowerOf2() public { 23 | assertEq(3, this.log2ceilBitMagic(8)); 24 | } 25 | 26 | function testLogCeil_Known() public { 27 | assertEq(8, this.log2ceilBitMagic((129))); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/murky/src/test/standard_data/README.md: -------------------------------------------------------------------------------- 1 | ## Standardized Testing Data 2 | 3 | This folder contains standardized testing data for reproducible proofs, gas snapshotting, etc. This is an important addition to fuzz testing as it allows for consistent performance measures, comparison with other libraries and implementations, and probably other benefits that I'm not aware of yet. 4 | 5 | The data is currently used by [StandardInput.t.sol](../StandardInput.t.sol) and is loaded at test time using Foundry's `ffi` cheatcode. 6 | 7 | The data is encoded, and is decoded into a `bytes32[100]` array at test time. 8 | 9 | ### Files 10 | 11 | - **StandardData.txt**: the current standard testing data file. Contains 100 addresses encoded to 32 bytes each. The generation script is [dead simple](https://gist.github.com/dmfxyz/36dce9db458eea1135e93ae739197bb3). Always interested in improvements! 12 | 13 | - **StandardData.old.txt**: a prior testing file. Also contains 100 32 byte data points, but most are very sparse with only the two highest order bits set. It remains here as prior gas-snapshots relied on it. 14 | -------------------------------------------------------------------------------- /scripts/deploy.ts: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | import { ethers, network, upgrades } from 'hardhat'; 3 | 4 | let num: number; 5 | 6 | if (network.name === 'mainnet') { 7 | num = 1; 8 | } else if (network.name === 'goerli') { 9 | num = 2; 10 | } else { 11 | throw new Error('Unsupported network'); 12 | } 13 | 14 | async function main(): Promise { 15 | const [deployer] = await ethers.getSigners(); 16 | console.log('Deploying contract with account:', deployer.address); 17 | const factory = await ethers.getContractFactory('TestContract'); 18 | const contract = await factory.deploy(num); 19 | console.log('Contract address:', contract.address); 20 | } 21 | 22 | main() 23 | .then(() => process.exit(0)) 24 | .catch((err) => { 25 | console.error(err); 26 | process.exit(1); 27 | }); 28 | -------------------------------------------------------------------------------- /test/foundry/TestPlus.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.17; 3 | 4 | import "forge-std/Test.sol"; 5 | 6 | import "contracts/interfaces/IAccount.sol"; 7 | 8 | abstract contract TestPlus is Test { 9 | function assertNotEq(uint256 a, uint256 b) internal virtual { 10 | if (a == b) { 11 | emit log("Error: a != b not satisfied [uint]"); 12 | emit log_named_uint("Not expected", b); 13 | emit log_named_uint(" Actual", a); 14 | fail(); 15 | } 16 | } 17 | 18 | function assertEq(Account memory a, Account memory b) internal virtual { 19 | if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { 20 | emit log("Error: a == b not satisfied [Account]"); 21 | fail(); 22 | } 23 | } 24 | 25 | function assertEq(Account memory a, Account memory b, string memory err) internal virtual { 26 | if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { 27 | emit log_named_string("Error", err); 28 | assertEq(a, b); 29 | } 30 | } 31 | 32 | function assertEq(Node memory a, Node memory b) internal virtual { 33 | if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { 34 | emit log("Error: a == b not satisfied [Node]"); 35 | fail(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "outDir": "dist", 8 | "declaration": true 9 | }, 10 | "exclude": ["node_modules"], 11 | "include": [ 12 | "scripts/**/*", 13 | "tasks/**/*", 14 | "test/**/*", 15 | "typechain/**/*", 16 | "types/**/*", 17 | "utils/**/*.ts", 18 | "hardhat.config.ts" 19 | ] 20 | } 21 | --------------------------------------------------------------------------------