├── lib ├── openzeppelin-contracts │ ├── migrations │ │ └── .gitkeep │ ├── .gitattributes │ ├── certora │ │ ├── munged │ │ │ └── .gitignore │ │ ├── scripts │ │ │ ├── Governor.sh │ │ │ ├── WizardFirstTry.sh │ │ │ ├── GovernorCountingSimple-counting.sh │ │ │ ├── sanity.sh │ │ │ └── WizardControlFirstPriority.sh │ │ ├── specs │ │ │ └── sanity.spec │ │ └── Makefile │ ├── netlify.toml │ ├── .mocharc.js │ ├── audit │ │ └── 2018-10.pdf │ ├── docs │ │ ├── antora.yml │ │ ├── modules │ │ │ └── ROOT │ │ │ │ ├── images │ │ │ │ ├── tally-admin.png │ │ │ │ └── tally-vote.png │ │ │ │ ├── nav.adoc │ │ │ │ └── pages │ │ │ │ ├── crowdsales.adoc │ │ │ │ └── wizard.adoc │ │ ├── prelude.hbs │ │ └── helpers.js │ ├── contracts │ │ ├── mocks │ │ │ ├── ERC165 │ │ │ │ ├── ERC165NotSupported.sol │ │ │ │ └── ERC165MissingData.sol │ │ │ ├── OwnableMock.sol │ │ │ ├── ERC165Mock.sol │ │ │ ├── BadBeacon.sol │ │ │ ├── Base64Mock.sol │ │ │ ├── ERC165StorageMock.sol │ │ │ ├── MulticallTokenMock.sol │ │ │ ├── ReentrancyAttack.sol │ │ │ ├── ERC1820ImplementerMock.sol │ │ │ ├── EtherReceiverMock.sol │ │ │ ├── PullPaymentMock.sol │ │ │ ├── ERC20BurnableMock.sol │ │ │ ├── ERC20FlashMintMock.sol │ │ │ ├── ArraysImpl.sol │ │ │ ├── ERC20CappedMock.sol │ │ │ ├── ERC1155BurnableMock.sol │ │ │ ├── SignatureCheckerMock.sol │ │ │ ├── AccessControlMock.sol │ │ │ ├── ERC20WrapperMock.sol │ │ │ ├── AccessControlEnumerableMock.sol │ │ │ ├── ConditionalEscrowMock.sol │ │ │ ├── MerkleProofWrapper.sol │ │ │ ├── ClashingImplementation.sol │ │ │ ├── ERC20PermitMock.sol │ │ │ ├── StringsMock.sol │ │ │ ├── ERC1271WalletMock.sol │ │ │ ├── CountersImpl.sol │ │ │ ├── ERC20VotesMock.sol │ │ │ ├── ERC20VotesCompMock.sol │ │ │ ├── MathMock.sol │ │ │ ├── BitmapMock.sol │ │ │ ├── SignedMathMock.sol │ │ │ ├── ERC1155SupplyMock.sol │ │ │ ├── CheckpointsImpl.sol │ │ │ ├── SignedSafeMathMock.sol │ │ │ ├── PausableMock.sol │ │ │ ├── ERC721VotesMock.sol │ │ │ ├── ERC1155URIStorageMock.sol │ │ │ ├── ERC20SnapshotMock.sol │ │ │ ├── ERC20DecimalsMock.sol │ │ │ ├── AccessControlCrossChainMock.sol │ │ │ ├── MulticallTest.sol │ │ │ ├── ERC721BurnableMock.sol │ │ │ ├── ERC1155PausableMock.sol │ │ │ └── ERC20PausableMock.sol │ │ ├── token │ │ │ ├── ERC20 │ │ │ │ ├── presets │ │ │ │ │ └── README.md │ │ │ │ └── extensions │ │ │ │ │ └── IERC20Metadata.sol │ │ │ ├── ERC1155 │ │ │ │ ├── presets │ │ │ │ │ └── README.md │ │ │ │ ├── utils │ │ │ │ │ └── ERC1155Receiver.sol │ │ │ │ └── extensions │ │ │ │ │ └── IERC1155MetadataURI.sol │ │ │ ├── ERC721 │ │ │ │ └── presets │ │ │ │ │ └── README.md │ │ │ └── common │ │ │ │ └── README.adoc │ │ ├── crosschain │ │ │ └── errors.sol │ │ ├── interfaces │ │ │ ├── IERC20.sol │ │ │ ├── IERC721.sol │ │ │ ├── IERC777.sol │ │ │ ├── IERC1155.sol │ │ │ ├── IERC165.sol │ │ │ ├── IERC777Sender.sol │ │ │ ├── IERC721Receiver.sol │ │ │ ├── IERC1155Receiver.sol │ │ │ ├── IERC20Metadata.sol │ │ │ ├── IERC777Recipient.sol │ │ │ ├── IERC1820Registry.sol │ │ │ ├── IERC721Metadata.sol │ │ │ ├── IERC721Enumerable.sol │ │ │ ├── IERC1820Implementer.sol │ │ │ ├── IERC3156.sol │ │ │ ├── IERC1155MetadataURI.sol │ │ │ ├── draft-IERC2612.sol │ │ │ └── IERC1271.sol │ │ ├── metatx │ │ │ └── README.adoc │ │ ├── vendor │ │ │ └── polygon │ │ │ │ └── IFxMessageProcessor.sol │ │ ├── proxy │ │ │ └── beacon │ │ │ │ └── IBeacon.sol │ │ ├── security │ │ │ └── README.adoc │ │ ├── governance │ │ │ └── extensions │ │ │ │ ├── GovernorProposalThreshold.sol │ │ │ │ └── IGovernorTimelock.sol │ │ ├── utils │ │ │ ├── Multicall.sol │ │ │ └── introspection │ │ │ │ └── IERC1820Implementer.sol │ │ ├── finance │ │ │ └── README.adoc │ │ └── access │ │ │ └── README.adoc │ ├── slither.config.json │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ │ ├── config.yml │ │ │ └── feature_request.md │ │ ├── workflows │ │ │ ├── docs.yml │ │ │ ├── slither.yml │ │ │ └── upgradeable.yml │ │ └── PULL_REQUEST_TEMPLATE.md │ ├── scripts │ │ ├── git-user-config.sh │ │ ├── release │ │ │ ├── version.sh │ │ │ └── synchronize-versions.js │ │ ├── prepack.sh │ │ ├── prepare-contracts-package.sh │ │ ├── prepare-docs.sh │ │ └── prepare-docs-solc.js │ ├── renovate.json │ ├── .codecov.yml │ ├── test │ │ ├── TESTING.md │ │ ├── utils │ │ │ ├── introspection │ │ │ │ └── ERC165.test.js │ │ │ ├── escrow │ │ │ │ └── Escrow.test.js │ │ │ └── Context.test.js │ │ ├── access │ │ │ ├── AccessControl.test.js │ │ │ └── AccessControlEnumerable.test.js │ │ ├── proxy │ │ │ ├── ERC1967 │ │ │ │ └── ERC1967Proxy.test.js │ │ │ └── transparent │ │ │ │ └── TransparentUpgradeableProxy.test.js │ │ ├── helpers │ │ │ ├── enums.js │ │ │ ├── eip712.js │ │ │ ├── erc1967.js │ │ │ └── customError.js │ │ └── token │ │ │ ├── ERC721 │ │ │ ├── ERC721.test.js │ │ │ ├── ERC721Enumerable.test.js │ │ │ └── utils │ │ │ │ └── ERC721Holder.test.js │ │ │ └── ERC20 │ │ │ └── extensions │ │ │ └── ERC20Burnable.test.js │ ├── .prettierrc │ ├── .solcover.js │ ├── .editorconfig │ ├── hardhat │ │ └── env-contract.js │ ├── .solhint.json │ ├── DOCUMENTATION.md │ └── SECURITY.md ├── uniswap-v3-periphery │ ├── .prettierignore │ ├── .yarnrc │ ├── .gitattributes │ ├── .gitignore │ ├── .prettierrc │ ├── testnet-deploys.md │ ├── .solhint.json │ ├── test │ │ ├── __snapshots__ │ │ │ ├── Path.spec.ts.snap │ │ │ ├── PairFlash.spec.ts.snap │ │ │ ├── SwapRouter.spec.ts.snap │ │ │ ├── V3Migrator.spec.ts.snap │ │ │ ├── OracleLibrary.spec.ts.snap │ │ │ ├── PeripheryImmutableState.spec.ts.snap │ │ │ ├── Multicall.spec.ts.snap │ │ │ ├── TickLens.spec.ts.snap │ │ │ ├── PoolAddress.spec.ts.snap │ │ │ └── PositionValue.spec.ts.snap │ │ └── shared │ │ │ ├── expandTo18Decimals.ts │ │ │ ├── expect.ts │ │ │ ├── base64.ts │ │ │ ├── extractJSONFromURI.ts │ │ │ ├── constants.ts │ │ │ ├── poolAtAddress.ts │ │ │ ├── tokenSort.ts │ │ │ ├── ticks.ts │ │ │ └── encodePriceSqrt.ts │ ├── audits │ │ └── abdk │ │ │ └── audit.pdf │ ├── contracts │ │ ├── lens │ │ │ └── README.md │ │ ├── test │ │ │ ├── SelfPermitTest.sol │ │ │ ├── PeripheryImmutableStateTest.sol │ │ │ ├── TestERC20.sol │ │ │ ├── TestERC20Metadata.sol │ │ │ ├── TestCallbackValidation.sol │ │ │ ├── Base64Test.sol │ │ │ ├── MockTimeSwapRouter.sol │ │ │ ├── TickLensTest.sol │ │ │ ├── PoolTicksCounterTest.sol │ │ │ ├── MockTimeNonfungiblePositionManager.sol │ │ │ ├── NonfungiblePositionManagerPositionsGasTest.sol │ │ │ └── TestMulticall.sol │ │ ├── base │ │ │ ├── PeripheryValidation.sol │ │ │ ├── BlockTimestamp.sol │ │ │ └── PeripheryImmutableState.sol │ │ ├── libraries │ │ │ ├── TokenRatioSortOrder.sol │ │ │ ├── ChainId.sol │ │ │ └── PositionKey.sol │ │ └── interfaces │ │ │ ├── external │ │ │ └── IWETH9.sol │ │ │ ├── IPeripheryImmutableState.sol │ │ │ ├── IERC20Metadata.sol │ │ │ ├── IMulticall.sol │ │ │ └── INonfungibleTokenPositionDescriptor.sol │ └── tsconfig.json ├── uniswap-v3-core │ ├── .yarnrc │ ├── .gitattributes │ ├── .gitignore │ ├── .prettierrc │ ├── .solhint.json │ ├── audits │ │ ├── tob │ │ │ ├── audit.pdf │ │ │ └── contracts │ │ │ │ └── crytic │ │ │ │ ├── echidna │ │ │ │ ├── Other.config.yaml │ │ │ │ ├── E2E_swap.config.yaml │ │ │ │ └── E2E_mint_burn.config.yaml │ │ │ │ └── manticore │ │ │ │ ├── 003.sol │ │ │ │ ├── 001.sol │ │ │ │ └── 002.sol │ │ └── abdk │ │ │ └── audit.pdf │ ├── test │ │ ├── __snapshots__ │ │ │ ├── NoDelegateCall.spec.ts.snap │ │ │ ├── LiquidityMath.spec.ts.snap │ │ │ ├── UniswapV3Factory.spec.ts.snap │ │ │ ├── BitMath.spec.ts.snap │ │ │ ├── SwapMath.spec.ts.snap │ │ │ └── SqrtPriceMath.spec.ts.snap │ │ └── shared │ │ │ ├── expect.ts │ │ │ └── format.ts │ ├── contracts │ │ ├── libraries │ │ │ ├── FixedPoint128.sol │ │ │ ├── FixedPoint96.sol │ │ │ ├── LiquidityMath.sol │ │ │ └── UnsafeMath.sol │ │ └── test │ │ │ ├── UnsafeMathEchidnaTest.sol │ │ │ ├── LiquidityMathTest.sol │ │ │ ├── FullMathTest.sol │ │ │ ├── BitMathEchidnaTest.sol │ │ │ └── MockTimeUniswapV3Pool.sol │ ├── tsconfig.json │ └── .github │ │ └── workflows │ │ └── lint.yml ├── ds-test │ ├── .gitignore │ ├── default.nix │ └── Makefile ├── openzeppelin-contracts-upgradeable │ ├── migrations │ │ └── .gitkeep │ ├── scripts │ │ ├── upgradeable │ │ │ ├── patch │ │ │ │ └── .gitkeep │ │ │ ├── git-user-config.sh │ │ │ ├── transpile.sh │ │ │ └── transpile-onto.sh │ │ ├── git-user-config.sh │ │ ├── release │ │ │ ├── version.sh │ │ │ └── synchronize-versions.js │ │ ├── prepack.sh │ │ ├── prepare-contracts-package.sh │ │ ├── prepare-docs.sh │ │ └── prepare-docs-solc.js │ ├── certora │ │ ├── munged │ │ │ └── .gitignore │ │ ├── scripts │ │ │ ├── Governor.sh │ │ │ ├── WizardFirstTry.sh │ │ │ ├── GovernorCountingSimple-counting.sh │ │ │ ├── sanity.sh │ │ │ └── WizardControlFirstPriority.sh │ │ ├── specs │ │ │ └── sanity.spec │ │ └── Makefile │ ├── .gitattributes │ ├── netlify.toml │ ├── .mocharc.js │ ├── audit │ │ └── 2018-10.pdf │ ├── docs │ │ ├── antora.yml │ │ ├── modules │ │ │ └── ROOT │ │ │ │ ├── images │ │ │ │ ├── tally-vote.png │ │ │ │ └── tally-admin.png │ │ │ │ ├── nav.adoc │ │ │ │ └── pages │ │ │ │ ├── crowdsales.adoc │ │ │ │ └── wizard.adoc │ │ ├── prelude.hbs │ │ └── helpers.js │ ├── slither.config.json │ ├── contracts │ │ ├── token │ │ │ ├── ERC1155 │ │ │ │ ├── presets │ │ │ │ │ └── README.md │ │ │ │ └── extensions │ │ │ │ │ └── IERC1155MetadataURIUpgradeable.sol │ │ │ ├── ERC20 │ │ │ │ └── presets │ │ │ │ │ └── README.md │ │ │ ├── ERC721 │ │ │ │ └── presets │ │ │ │ │ └── README.md │ │ │ └── common │ │ │ │ └── README.adoc │ │ ├── crosschain │ │ │ └── errorsUpgradeable.sol │ │ ├── interfaces │ │ │ ├── IERC20Upgradeable.sol │ │ │ ├── IERC721Upgradeable.sol │ │ │ ├── IERC777Upgradeable.sol │ │ │ ├── IERC1155Upgradeable.sol │ │ │ ├── IERC165Upgradeable.sol │ │ │ ├── IERC777SenderUpgradeable.sol │ │ │ ├── IERC721ReceiverUpgradeable.sol │ │ │ ├── IERC777RecipientUpgradeable.sol │ │ │ ├── IERC1155ReceiverUpgradeable.sol │ │ │ ├── IERC20MetadataUpgradeable.sol │ │ │ ├── IERC1820RegistryUpgradeable.sol │ │ │ ├── IERC721MetadataUpgradeable.sol │ │ │ ├── IERC721EnumerableUpgradeable.sol │ │ │ ├── IERC1820ImplementerUpgradeable.sol │ │ │ ├── IERC1155MetadataURIUpgradeable.sol │ │ │ ├── IERC3156Upgradeable.sol │ │ │ ├── draft-IERC2612Upgradeable.sol │ │ │ └── IERC1271Upgradeable.sol │ │ ├── metatx │ │ │ └── README.adoc │ │ ├── vendor │ │ │ └── polygon │ │ │ │ └── IFxMessageProcessorUpgradeable.sol │ │ ├── proxy │ │ │ └── beacon │ │ │ │ └── IBeaconUpgradeable.sol │ │ ├── mocks │ │ │ ├── ERC165 │ │ │ │ ├── ERC165NotSupportedUpgradeable.sol │ │ │ │ └── ERC165MissingDataUpgradeable.sol │ │ │ ├── ERC165MockUpgradeable.sol │ │ │ └── OwnableMockUpgradeable.sol │ │ ├── security │ │ │ └── README.adoc │ │ ├── finance │ │ │ └── README.adoc │ │ └── access │ │ │ └── README.adoc │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ │ ├── config.yml │ │ │ └── feature_request.md │ │ ├── workflows │ │ │ ├── docs.yml │ │ │ ├── slither.yml │ │ │ └── merge-upstream.yml │ │ └── PULL_REQUEST_TEMPLATE.md │ ├── renovate.json │ ├── .codecov.yml │ ├── test │ │ ├── TESTING.md │ │ ├── utils │ │ │ ├── introspection │ │ │ │ └── ERC165.test.js │ │ │ ├── escrow │ │ │ │ └── Escrow.test.js │ │ │ └── Context.test.js │ │ ├── access │ │ │ ├── AccessControl.test.js │ │ │ └── AccessControlEnumerable.test.js │ │ ├── proxy │ │ │ ├── ERC1967 │ │ │ │ └── ERC1967Proxy.test.js │ │ │ └── transparent │ │ │ │ └── TransparentUpgradeableProxy.test.js │ │ ├── helpers │ │ │ ├── enums.js │ │ │ ├── eip712.js │ │ │ ├── erc1967.js │ │ │ └── customError.js │ │ └── token │ │ │ ├── ERC721 │ │ │ ├── ERC721.test.js │ │ │ ├── ERC721Enumerable.test.js │ │ │ └── utils │ │ │ │ └── ERC721Holder.test.js │ │ │ └── ERC20 │ │ │ └── extensions │ │ │ └── ERC20Burnable.test.js │ ├── .prettierrc │ ├── .solcover.js │ ├── .editorconfig │ ├── hardhat │ │ ├── env-contract.js │ │ ├── task-get-compiler-input.js │ │ ├── env-artifacts.js │ │ └── task-test-get-files.js │ ├── .solhint.json │ ├── DOCUMENTATION.md │ └── SECURITY.md ├── uniswap-v2-periphery │ ├── .yarnrc │ ├── .gitignore │ ├── .gitattributes │ ├── .prettierrc │ ├── .mocharc.json │ ├── contracts │ │ ├── interfaces │ │ │ ├── V1 │ │ │ │ ├── IUniswapV1Factory.sol │ │ │ │ └── IUniswapV1Exchange.sol │ │ │ ├── IUniswapV2Migrator.sol │ │ │ └── IWETH.sol │ │ ├── examples │ │ │ └── README.md │ │ └── libraries │ │ │ └── SafeMath.sol │ ├── tsconfig.json │ ├── .waffle.json │ └── README.md └── v3-quoter │ ├── frontend │ ├── public │ │ ├── robots.txt │ │ └── favicon.ico │ ├── src │ │ ├── index.js │ │ ├── helpers │ │ │ └── loadAppContracts.js │ │ └── hooks │ │ │ └── useContractConfig.js │ └── .gitignore │ ├── .gitignore │ ├── deploy │ └── quoter.js │ └── contracts │ ├── libraries │ ├── FixedPoint96.sol │ ├── LiquidityMath.sol │ └── UnsafeMath.sol │ └── interfaces │ └── IQuoter.sol ├── .eslintignore ├── .prettierignore ├── .env.template ├── scripts ├── deployments │ └── local_deployments.json ├── config │ ├── DeploymentHistory.ts │ └── DeployConfig.ts ├── utils │ ├── TradeHelper.ts │ └── ColorConsole.ts └── deploy.local.ts ├── src ├── main │ ├── models │ │ ├── CurveModels.sol │ │ └── TradeManagerModels.sol │ ├── interfaces │ │ ├── weth │ │ │ └── IWETH9.sol │ │ └── curve.finance │ │ │ ├── IStableSwap.sol │ │ │ └── ISwaps.sol │ └── traders │ │ └── DexTraderBase.sol └── test │ └── mocks │ └── MockUniswapV3Quoter.sol ├── .gitignore ├── .prettierrc ├── tsconfig.json ├── remappings.txt ├── .github └── workflows │ └── CI.yml ├── .eslintrc.js ├── .vscode └── settings.json └── README.md /lib/openzeppelin-contracts/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/.prettierignore: -------------------------------------------------------------------------------- 1 | .github -------------------------------------------------------------------------------- /lib/uniswap-v3-core/.yarnrc: -------------------------------------------------------------------------------- 1 | ignore-scripts true 2 | -------------------------------------------------------------------------------- /lib/ds-test/.gitignore: -------------------------------------------------------------------------------- 1 | /.dapple 2 | /build 3 | /out 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/.yarnrc: -------------------------------------------------------------------------------- 1 | ignore-scripts true 2 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/.yarnrc: -------------------------------------------------------------------------------- 1 | ignore-scripts true 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | artifacts 3 | cache 4 | coverage 5 | -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/scripts/upgradeable/patch/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/certora/munged/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/certora/munged/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | artifacts 3 | cache 4 | coverage* 5 | gasReporterOutput.json 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run docs" 3 | publish = "build/site" 4 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/.gitignore: -------------------------------------------------------------------------------- 1 | artifacts/ 2 | cache/ 3 | crytic-export/ 4 | node_modules/ 5 | typechain/ 6 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/.gitignore: -------------------------------------------------------------------------------- 1 | artifacts/ 2 | cache/ 3 | crytic-export/ 4 | node_modules/ 5 | typechain/ -------------------------------------------------------------------------------- /lib/uniswap-v3-core/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "printWidth": 120 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | command = "npm run docs" 3 | publish = "build/site" 4 | -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "printWidth": 120 5 | } 6 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "printWidth": 120 5 | } 6 | -------------------------------------------------------------------------------- /lib/v3-quoter/frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /.env.template: -------------------------------------------------------------------------------- 1 | ETHERSCAN_API_KEY=MISSING 2 | MAINNET_URL=MISSING 3 | 4 | PRIVATE_KEY_TEST=MISSING 5 | PRIVATE_KEY=MISSING 6 | -------------------------------------------------------------------------------- /lib/ds-test/default.nix: -------------------------------------------------------------------------------- 1 | { solidityPackage, dappsys }: solidityPackage { 2 | name = "ds-test"; 3 | src = ./src; 4 | } 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.mocharc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | require: 'hardhat/register', 3 | timeout: 4000, 4 | }; 5 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/testnet-deploys.md: -------------------------------------------------------------------------------- 1 | ## Uniswap V3 is live on Mainnet 2 | 3 | See the addresses [here](./deploys.md). 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.mocharc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | require: 'hardhat/register', 3 | timeout: 4000, 4 | }; 5 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["prettier"], 3 | "rules": { 4 | "prettier/prettier": "error" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/audits/tob/audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/uniswap-v3-core/audits/tob/audit.pdf -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/.solhint.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["prettier"], 3 | "rules": { 4 | "prettier/prettier": "error" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/audits/abdk/audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/uniswap-v3-core/audits/abdk/audit.pdf -------------------------------------------------------------------------------- /lib/v3-quoter/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/v3-quoter/frontend/public/favicon.ico -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/audit/2018-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/openzeppelin-contracts/audit/2018-10.pdf -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/Path.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Path gas cost 1`] = `451`; 4 | -------------------------------------------------------------------------------- /scripts/deployments/local_deployments.json: -------------------------------------------------------------------------------- 1 | { 2 | "DefaultContract": { 3 | "address": "0x38122a45d0CCE49E6294e372932f8a22F2E65838" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/audits/abdk/audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/uniswap-v3-periphery/audits/abdk/audit.pdf -------------------------------------------------------------------------------- /scripts/config/DeploymentHistory.ts: -------------------------------------------------------------------------------- 1 | interface IDeploymentHistory { 2 | address: string 3 | proxyAdmin?: string 4 | tx?: string 5 | ether?: string 6 | } 7 | -------------------------------------------------------------------------------- /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/uniswap-v3-periphery/test/__snapshots__/PairFlash.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`PairFlash test flash gas 1`] = `349643`; 4 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/SwapRouter.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`SwapRouter bytecode size 1`] = `12160`; 4 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/V3Migrator.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`V3Migrator #migrate gas 1`] = `730625`; 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/audit/2018-10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/openzeppelin-contracts-upgradeable/audit/2018-10.pdf -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension": ["ts"], 3 | "spec": "./test/**/*.spec.ts", 4 | "require": "ts-node/register", 5 | "timeout": 12000 6 | } 7 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/test/__snapshots__/NoDelegateCall.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`NoDelegateCall runtime overhead 1`] = `30`; 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/uniswap-v3-periphery/contracts/lens/README.md: -------------------------------------------------------------------------------- 1 | # lens 2 | 3 | These contracts are not designed to be called on-chain. They simplify 4 | fetching on-chain data from off-chain. 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/slither.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "detectors_to_run": "reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas", 3 | "filter_paths": "contracts/mocks" 4 | } -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/OracleLibrary.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`OracleLibrary #getQuoteAtTick gas test 1`] = `1205`; 4 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/slither.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "detectors_to_run": "reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas", 3 | "filter_paths": "contracts/mocks" 4 | } -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-admin.png -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/PeripheryImmutableState.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`PeripheryImmutableState bytecode size 1`] = `193`; 4 | -------------------------------------------------------------------------------- /lib/v3-quoter/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain 6 | .DS_Store 7 | .vscode 8 | 9 | #Hardhat files 10 | cache 11 | artifacts 12 | deployments 13 | -------------------------------------------------------------------------------- /src/main/models/CurveModels.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.13; 3 | 4 | struct PoolInfo { 5 | address pool; 6 | int128 indexA; 7 | int128 indexB; 8 | } 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/utils/TradeHelper.ts: -------------------------------------------------------------------------------- 1 | 2 | export function ensureValidString(value: string | undefined): string { 3 | if (value === undefined) 4 | throw "invalid string" 5 | return value 6 | } -------------------------------------------------------------------------------- /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/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/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/tally-vote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/tally-vote.png -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Factory.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV1Factory { 4 | function getExchange(address) external view returns (address); 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/tally-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/up-to-sky/multi-dex-trader/HEAD/lib/openzeppelin-contracts-upgradeable/docs/modules/ROOT/images/tally-admin.png -------------------------------------------------------------------------------- /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/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/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/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions & Support Requests 3 | url: https://forum.openzeppelin.com/c/support/contracts/18 4 | about: Ask in the OpenZeppelin Forum 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/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/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/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/uniswap-v3-core/test/__snapshots__/LiquidityMath.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`LiquidityMath #addDelta gas add 1`] = `162`; 4 | 5 | exports[`LiquidityMath #addDelta gas sub 1`] = `176`; 6 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/expandTo18Decimals.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber } from 'ethers' 2 | 3 | export function expandTo18Decimals(n: number): BigNumber { 4 | return BigNumber.from(n).mul(BigNumber.from(10).pow(18)) 5 | } 6 | -------------------------------------------------------------------------------- /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/uniswap-v2-periphery/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "resolveJsonModule": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/audits/tob/contracts/crytic/echidna/Other.config.yaml: -------------------------------------------------------------------------------- 1 | checkAsserts: true 2 | coverage: true 3 | codeSize: 0x60000 4 | corpusDir: echidna_other_corpus 5 | seqLen: 1000 6 | testLimit: 100000 7 | timeout: 3600 # 1 hour 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Questions & Support Requests 3 | url: https://forum.openzeppelin.com/c/support/contracts/18 4 | about: Ask in the OpenZeppelin Forum 5 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/scripts/git-user-config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail -x 4 | 5 | git config user.name 'github-actions' 6 | git config user.email '41898282+github-actions[bot]@users.noreply.github.com' 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | cache/ 2 | out/ 3 | 4 | lib 5 | node_modules 6 | .env 7 | coverage 8 | coverage.json 9 | typechain 10 | typechain-types/ 11 | 12 | #Hardhat files 13 | cache 14 | artifacts 15 | 16 | 17 | # Added by cargo 18 | 19 | /target 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/crosschain/errorsUpgradeable.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/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/openzeppelin-contracts/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "github>OpenZeppelin/code-style" 4 | ], 5 | "packageRules": [ 6 | { 7 | "extends": ["packages:eslint"], 8 | "enabled": false 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/Multicall.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Multicall gas cost of pay w/ multicall 1`] = `45845`; 4 | 5 | exports[`Multicall gas cost of pay w/o multicall 1`] = `43342`; 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/scripts/upgradeable/git-user-config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail -x 4 | 5 | git config user.name 'github-actions' 6 | git config user.email '41898282+github-actions[bot]@users.noreply.github.com' 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.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/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/uniswap-v2-periphery/contracts/interfaces/IUniswapV2Migrator.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV2Migrator { 4 | function migrate(address token, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external; 5 | } 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC20Upgradeable.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/IERC20Upgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "github>OpenZeppelin/code-style" 4 | ], 5 | "packageRules": [ 6 | { 7 | "extends": ["packages:eslint"], 8 | "enabled": false 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /lib/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/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/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/openzeppelin-contracts-upgradeable/.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/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC721Upgradeable.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/IERC721Upgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC777Upgradeable.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/IERC777Upgradeable.sol"; 7 | -------------------------------------------------------------------------------- /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/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/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/uniswap-v3-core/test/shared/expect.ts: -------------------------------------------------------------------------------- 1 | import { expect, use } from 'chai' 2 | import { solidity } from 'ethereum-waffle' 3 | import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot' 4 | 5 | use(solidity) 6 | use(jestSnapshotPlugin()) 7 | 8 | export { expect } 9 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155Upgradeable.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/IERC1155Upgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.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/IERC165Upgradeable.sol"; 7 | -------------------------------------------------------------------------------- /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/uniswap-v3-periphery/test/shared/expect.ts: -------------------------------------------------------------------------------- 1 | import { expect, use } from 'chai' 2 | import { solidity } from 'ethereum-waffle' 3 | import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot' 4 | 5 | use(solidity) 6 | use(jestSnapshotPlugin()) 7 | 8 | export { expect } 9 | -------------------------------------------------------------------------------- /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/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/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/uniswap-v2-periphery/contracts/interfaces/IWETH.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IWETH { 4 | function deposit() external payable; 5 | function transfer(address to, uint value) external returns (bool); 6 | function withdraw(uint) external; 7 | } 8 | -------------------------------------------------------------------------------- /lib/v3-quoter/frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render( 6 | 7 | 8 | , 9 | document.getElementById('root') 10 | ); 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 75, 3 | "semi": false, 4 | "singleQuote": false, 5 | "tabWidth": 2, 6 | "arrowParens": "avoid", 7 | "endOfLine": "crlf", 8 | "proseWrap": "always", 9 | "bracketSpacing": true, 10 | "useTabs": true, 11 | "explicitTypes": "always" 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC777SenderUpgradeable.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/IERC777SenderUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /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/uniswap-v3-periphery/contracts/test/SelfPermitTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../base/SelfPermit.sol'; 5 | 6 | /// @dev Same as SelfPermit but not abstract 7 | contract SelfPermitTest is SelfPermit { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/base64.ts: -------------------------------------------------------------------------------- 1 | export function base64Encode(str: string): string { 2 | return Buffer.from(str, 'utf8').toString('base64') 3 | } 4 | 5 | export function base64Decode(str: string): string { 6 | return Buffer.from(str, 'base64').toString('utf8') 7 | } 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC721ReceiverUpgradeable.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/IERC721ReceiverUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC777RecipientUpgradeable.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/IERC777RecipientUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155ReceiverUpgradeable.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/IERC1155ReceiverUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC20MetadataUpgradeable.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/IERC20MetadataUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/uniswap-v3-periphery/test/__snapshots__/TickLens.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`TickLens #getPopulatedTicksInWord fully populated ticks 1`] = `2803889`; 4 | 5 | exports[`TickLens #getPopulatedTicksInWord gas for single populated tick 1`] = `55664`; 6 | -------------------------------------------------------------------------------- /lib/v3-quoter/frontend/src/helpers/loadAppContracts.js: -------------------------------------------------------------------------------- 1 | const contractListPromise = import("../abi/contracts.json"); 2 | 3 | export const loadAppContracts = async () => { 4 | const config = {}; 5 | config.deployedContracts = (await contractListPromise).default ?? {}; 6 | return config; 7 | }; 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1820RegistryUpgradeable.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/IERC1820RegistryUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC721MetadataUpgradeable.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/IERC721MetadataUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/metatx/README.adoc: -------------------------------------------------------------------------------- 1 | = Meta Transactions 2 | 3 | [.readme-notice] 4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx 5 | 6 | == Core 7 | 8 | {{ERC2771Context}} 9 | 10 | == Utils 11 | 12 | {{MinimalForwarder}} 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC721EnumerableUpgradeable.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/IERC721EnumerableUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1820ImplementerUpgradeable.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/IERC1820ImplementerUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/uniswap-v3-periphery/test/__snapshots__/PoolAddress.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`PoolAddress #computeAddress gas cost 1`] = `642`; 4 | 5 | exports[`PoolAddress #computeAddress matches example from core repo 1`] = `"0x03D8bab195A5BC23d249693F53dfA0e358F2650D"`; 6 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155MetadataURIUpgradeable.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/IERC1155MetadataURIUpgradeable.sol"; 7 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts/docs/prelude.hbs: -------------------------------------------------------------------------------- 1 | :github-icon: pass:[] 2 | 3 | {{#links}} 4 | :{{slug target.fullName}}: pass:normal[xref:{{path}}#{{target.anchor}}[`{{target.fullName}}`]] 5 | :xref-{{slug target.anchor}}: xref:{{path}}#{{target.anchor}} 6 | {{/links}} 7 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC3156Upgradeable.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 "./IERC3156FlashBorrowerUpgradeable.sol"; 7 | import "./IERC3156FlashLenderUpgradeable.sol"; 8 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/test/__snapshots__/UniswapV3Factory.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`UniswapV3Factory #createPool gas 1`] = `4557092`; 4 | 5 | exports[`UniswapV3Factory factory bytecode size 1`] = `24535`; 6 | 7 | exports[`UniswapV3Factory pool bytecode size 1`] = `22142`; 8 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/docs/prelude.hbs: -------------------------------------------------------------------------------- 1 | :github-icon: pass:[] 2 | 3 | {{#links}} 4 | :{{slug target.fullName}}: pass:normal[xref:{{path}}#{{target.anchor}}[`{{target.fullName}}`]] 5 | :xref-{{slug target.anchor}}: xref:{{path}}#{{target.anchor}} 6 | {{/links}} 7 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml: -------------------------------------------------------------------------------- 1 | checkAsserts: true 2 | coverage: true 3 | codeSize: 0x60000 4 | corpusDir: echidna_e2e_swap_corpus 5 | seqLen: 10 6 | testLimit: 100000 7 | timeout: 3600 # 1 hour 8 | 9 | # blacklist 10 | filterFunctions: ['E2E_swap.viewRandomInit(uint128)'] 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/main/models/TradeManagerModels.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.13; 3 | 4 | struct Swap { 5 | address trader; 6 | address tokenIn; 7 | address tokenOut; 8 | } 9 | 10 | struct TradeParams { 11 | Swap[] path; 12 | uint256 correctionRatio; // correction ratio decimals 18 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.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/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/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( 6 | uint256 stateId, 7 | address rootMessageSender, 8 | bytes calldata data 9 | ) external; 10 | } 11 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/audits/tob/contracts/crytic/manticore/003.sol: -------------------------------------------------------------------------------- 1 | import '../../../../../contracts/libraries/LiquidityMath.sol'; 2 | 3 | contract VerifyLiquidityMathAddDelta { 4 | function verify(uint128 x, int128 y) external { 5 | uint256 z = LiquidityMath.addDelta(x, y); 6 | 7 | require(z != x + uint128(y)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /scripts/config/DeployConfig.ts: -------------------------------------------------------------------------------- 1 | interface ITokenList { 2 | renBTC: string 3 | wBTC: string 4 | wETH: string 5 | FRAX: string 6 | } 7 | 8 | export interface IDeployConfig { 9 | outputFile: string 10 | TX_CONFIRMATIONS: number 11 | 12 | tokens: ITokenList 13 | 14 | uniswapV3Quoter: string 15 | curvePool_renBTC_wBTC: string 16 | } 17 | -------------------------------------------------------------------------------- /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/uniswap-v3-periphery/test/shared/extractJSONFromURI.ts: -------------------------------------------------------------------------------- 1 | export function extractJSONFromURI(uri: string): { name: string; description: string; image: string } { 2 | const encodedJSON = uri.substr('data:application/json;base64,'.length) 3 | const decodedJSON = Buffer.from(encodedJSON, 'base64').toString('utf8') 4 | return JSON.parse(decodedJSON) 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "strict": true, 6 | "resolveJsonModule": true, 7 | "esModuleInterop": true, 8 | "outDir": "dist", 9 | "declaration": true 10 | }, 11 | "include": ["./scripts", "./test", "./typechain", "./lib"], 12 | "files": ["./hardhat.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC2612Upgradeable.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-IERC20PermitUpgradeable.sol"; 7 | 8 | interface IERC2612Upgradeable is IERC20PermitUpgradeable {} 9 | -------------------------------------------------------------------------------- /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/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/uniswap-v3-periphery/contracts/test/PeripheryImmutableStateTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity =0.7.6; 3 | 4 | import '../base/PeripheryImmutableState.sol'; 5 | 6 | contract PeripheryImmutableStateTest is PeripheryImmutableState { 7 | constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {} 8 | } 9 | -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | ds-test/=lib/ds-test/src/ 2 | 3 | @openzeppelin/contracts=lib/openzeppelin-contracts/contracts/ 4 | @openzeppelin/contracts-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts/ 5 | @uniswap/v2-periphery=lib/uniswap-v2-periphery/ 6 | @uniswap/v3-periphery=lib/uniswap-v3-periphery/ 7 | @uniswap/v3-core=lib/uniswap-v3-core/ 8 | uniswap-quoter=lib/v3-quoter/ -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/contracts/vendor/polygon/IFxMessageProcessorUpgradeable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IFxMessageProcessorUpgradeable { 5 | function processMessageFromRoot( 6 | uint256 stateId, 7 | address rootMessageSender, 8 | bytes calldata data 9 | ) external; 10 | } 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/contracts/token/common/README.adoc: -------------------------------------------------------------------------------- 1 | = Common (Tokens) 2 | 3 | Functionality that is common to multiple token standards. 4 | 5 | * {ERC2981}: NFT Royalties compatible with both ERC721 and ERC1155. 6 | ** For ERC721 consider {ERC721Royalty} which clears the royalty information from storage on burn. 7 | 8 | == Contracts 9 | 10 | {{ERC2981}} 11 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/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/uniswap-v3-core/contracts/libraries/FixedPoint128.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.4.0; 3 | 4 | /// @title FixedPoint128 5 | /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) 6 | library FixedPoint128 { 7 | uint256 internal constant Q128 = 0x100000000000000000000000000000000; 8 | } 9 | -------------------------------------------------------------------------------- /lib/v3-quoter/deploy/quoter.js: -------------------------------------------------------------------------------- 1 | module.exports = async ({ getNamedAccounts, deployments }) => { 2 | const { deploy } = deployments; 3 | const { deployer } = await getNamedAccounts(); 4 | 5 | await deploy("Quoter", { 6 | from: deployer, 7 | args: ["0x1F98431c8aD98523631AE4a59f267346ea31F984"], 8 | log: true, 9 | }); 10 | 11 | }; 12 | module.exports.tags = ["Quoter"]; 13 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/test/TestERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '@openzeppelin/contracts/drafts/ERC20Permit.sol'; 5 | 6 | contract TestERC20 is ERC20Permit { 7 | constructor(uint256 amountToMint) ERC20('Test ERC20', 'TEST') ERC20Permit('Test ERC20') { 8 | _mint(msg.sender, amountToMint); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/audits/tob/contracts/crytic/manticore/001.sol: -------------------------------------------------------------------------------- 1 | import '../../../../../contracts/libraries/BitMath.sol'; 2 | 3 | contract VerifyBitMathMsb { 4 | function verify(uint256 x) external { 5 | uint256 msb = BitMath.mostSignificantBit(x); 6 | 7 | bool property = x >= 2**msb && (msb == 255 || x < 2**(msb + 1)); 8 | 9 | require(!property); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/base/PeripheryValidation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity =0.7.6; 3 | 4 | import './BlockTimestamp.sol'; 5 | 6 | abstract contract PeripheryValidation is BlockTimestamp { 7 | modifier checkDeadline(uint256 deadline) { 8 | require(_blockTimestamp() <= deadline, 'Transaction too old'); 9 | _; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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 | -------------------------------------------------------------------------------- /scripts/deploy.local.ts: -------------------------------------------------------------------------------- 1 | import { IDeployConfig } from "./config/DeployConfig" 2 | import { Deployer } from "./Deployer" 3 | 4 | const config: IDeployConfig = { 5 | outputFile: "local_deployments.json", 6 | TX_CONFIRMATIONS: 1, 7 | } 8 | 9 | async function main() { 10 | await new Deployer(config).run() 11 | } 12 | 13 | main().catch(error => { 14 | console.error(error) 15 | process.exitCode = 1 16 | }) 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | norpc: true, 3 | testCommand: 'npm test', 4 | compileCommand: 'npm run compile', 5 | skipFiles: [ 6 | 'mocks', 7 | ], 8 | providerOptions: { 9 | default_balance_ether: '10000000000000000000000000', 10 | }, 11 | mocha: { 12 | fgrep: '[skip-on-coverage]', 13 | invert: true, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/utils/introspection/ERC165.test.js: -------------------------------------------------------------------------------- 1 | const { shouldSupportInterfaces } = require('./SupportsInterface.behavior'); 2 | 3 | const ERC165Mock = artifacts.require('ERC165Mock'); 4 | 5 | contract('ERC165', function (accounts) { 6 | beforeEach(async function () { 7 | this.mock = await ERC165Mock.new(); 8 | }); 9 | 10 | shouldSupportInterfaces([ 11 | 'ERC165', 12 | ]); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/constants.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber } from 'ethers' 2 | 3 | export const MaxUint128 = BigNumber.from(2).pow(128).sub(1) 4 | 5 | export enum FeeAmount { 6 | LOW = 500, 7 | MEDIUM = 3000, 8 | HIGH = 10000, 9 | } 10 | 11 | export const TICK_SPACINGS: { [amount in FeeAmount]: number } = { 12 | [FeeAmount.LOW]: 10, 13 | [FeeAmount.MEDIUM]: 60, 14 | [FeeAmount.HIGH]: 200, 15 | } 16 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "outDir": "dist", 8 | "typeRoots": ["./typechain", "./node_modules/@types"], 9 | "types": ["@nomiclabs/hardhat-ethers", "@nomiclabs/hardhat-waffle"] 10 | }, 11 | "include": ["./test"], 12 | "files": ["./hardhat.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/poolAtAddress.ts: -------------------------------------------------------------------------------- 1 | import { abi as POOL_ABI } from '@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json' 2 | import { Contract, Wallet } from 'ethers' 3 | import { IUniswapV3Pool } from '../../typechain' 4 | 5 | export default function poolAtAddress(address: string, wallet: Wallet): IUniswapV3Pool { 6 | return new Contract(address, POOL_ABI, wallet) as IUniswapV3Pool 7 | } 8 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/tokenSort.ts: -------------------------------------------------------------------------------- 1 | export function compareToken(a: { address: string }, b: { address: string }): -1 | 1 { 2 | return a.address.toLowerCase() < b.address.toLowerCase() ? -1 : 1 3 | } 4 | 5 | export function sortedTokens( 6 | a: { address: string }, 7 | b: { address: string } 8 | ): [typeof a, typeof b] | [typeof b, typeof a] { 9 | return compareToken(a, b) < 0 ? [a, b] : [b, a] 10 | } 11 | -------------------------------------------------------------------------------- /scripts/utils/ColorConsole.ts: -------------------------------------------------------------------------------- 1 | export const Colors = { 2 | gray: 90, 3 | green: 92, 4 | red: 91, 5 | yellow: 93, 6 | blue: 36, 7 | white: 0, 8 | } 9 | 10 | export function colorLog(colorCode: number, msg: string) { 11 | console.log("\u001b[" + colorCode + "m" + msg + "\u001b[0m") 12 | } 13 | export function addColor(colorCode: number, msg: string) { 14 | return "\u001b[" + colorCode + "m" + msg + "\u001b[0m" 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | run-ci: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | with: 10 | submodules: recursive 11 | 12 | - name: Install Foundry 13 | uses: onbjerg/foundry-toolchain@v1 14 | with: 15 | version: nightly 16 | 17 | - name: Run tests 18 | run: make test 19 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.solcover.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | norpc: true, 3 | testCommand: 'npm test', 4 | compileCommand: 'npm run compile', 5 | skipFiles: [ 6 | 'mocks', 7 | ], 8 | providerOptions: { 9 | default_balance_ether: '10000000000000000000000000', 10 | }, 11 | mocha: { 12 | fgrep: '[skip-on-coverage]', 13 | invert: true, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/test/utils/introspection/ERC165.test.js: -------------------------------------------------------------------------------- 1 | const { shouldSupportInterfaces } = require('./SupportsInterface.behavior'); 2 | 3 | const ERC165Mock = artifacts.require('ERC165Mock'); 4 | 5 | contract('ERC165', function (accounts) { 6 | beforeEach(async function () { 7 | this.mock = await ERC165Mock.new(); 8 | }); 9 | 10 | shouldSupportInterfaces([ 11 | 'ERC165', 12 | ]); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/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/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/openzeppelin-contracts-upgradeable/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/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/openzeppelin-contracts-upgradeable/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/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/v3-quoter/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /lib/v3-quoter/contracts/libraries/FixedPoint96.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.4.0; 3 | 4 | /// @title FixedPoint96 5 | /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) 6 | /// @dev Used in SqrtPriceMath.sol 7 | library FixedPoint96 { 8 | uint8 internal constant RESOLUTION = 96; 9 | uint256 internal constant Q96 = 0x1000000000000000000000000; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/interfaces/weth/IWETH9.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity ^0.8.13; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 5 | 6 | /// @title Interface for WETH9 7 | interface IWETH9 is IERC20 { 8 | /// @notice Deposit ether to get wrapped ether 9 | function deposit() external payable; 10 | 11 | /// @notice Withdraw wrapped ether to get ether 12 | function withdraw(uint256) external; 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.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/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/uniswap-v3-periphery/contracts/libraries/TokenRatioSortOrder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity =0.7.6; 3 | 4 | library TokenRatioSortOrder { 5 | int256 constant NUMERATOR_MOST = 300; 6 | int256 constant NUMERATOR_MORE = 200; 7 | int256 constant NUMERATOR = 100; 8 | 9 | int256 constant DENOMINATOR_MOST = -300; 10 | int256 constant DENOMINATOR_MORE = -200; 11 | int256 constant DENOMINATOR = -100; 12 | } 13 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/test/shared/format.ts: -------------------------------------------------------------------------------- 1 | import { Decimal } from 'decimal.js' 2 | import { BigNumberish } from 'ethers' 3 | 4 | export function formatTokenAmount(num: BigNumberish): string { 5 | return new Decimal(num.toString()).dividedBy(new Decimal(10).pow(18)).toPrecision(5) 6 | } 7 | 8 | export function formatPrice(price: BigNumberish): string { 9 | return new Decimal(price.toString()).dividedBy(new Decimal(2).pow(96)).pow(2).toPrecision(5) 10 | } 11 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/libraries/ChainId.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.7.0; 3 | 4 | /// @title Function for getting the current chain ID 5 | library ChainId { 6 | /// @dev Gets the current chain ID 7 | /// @return chainId The current chain ID 8 | function get() internal pure returns (uint256 chainId) { 9 | assembly { 10 | chainId := chainid() 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/contracts/libraries/FixedPoint96.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.4.0; 3 | 4 | /// @title FixedPoint96 5 | /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) 6 | /// @dev Used in SqrtPriceMath.sol 7 | library FixedPoint96 { 8 | uint8 internal constant RESOLUTION = 96; 9 | uint256 internal constant Q96 = 0x1000000000000000000000000; 10 | } 11 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "resolveJsonModule": true, 8 | "outDir": "dist", 9 | "typeRoots": ["./typechain", "./node_modules/@types"], 10 | "types": ["@nomiclabs/hardhat-ethers", "@nomiclabs/hardhat-waffle"] 11 | }, 12 | "include": ["./test"], 13 | "files": ["./hardhat.config.ts"] 14 | } 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/uniswap-v3-periphery/contracts/test/TestERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '@openzeppelin/contracts/drafts/ERC20Permit.sol'; 5 | 6 | contract TestERC20Metadata is ERC20Permit { 7 | constructor( 8 | uint256 amountToMint, 9 | string memory name, 10 | string memory symbol 11 | ) ERC20(name, symbol) ERC20Permit(name) { 12 | _mint(msg.sender, amountToMint); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/uniswap-v3-periphery/contracts/libraries/PositionKey.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | 4 | library PositionKey { 5 | /// @dev Returns the key of the position in the core library 6 | function compute( 7 | address owner, 8 | int24 tickLower, 9 | int24 tickUpper 10 | ) internal pure returns (bytes32) { 11 | return keccak256(abi.encodePacked(owner, tickLower, tickUpper)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/interfaces/curve.finance/IStableSwap.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.13; 3 | 4 | interface IStableSwap { 5 | function coins(uint256 index) external view returns (address); 6 | 7 | function get_dy( 8 | int128 i, 9 | int128 j, 10 | uint256 _dx 11 | ) external view returns (uint256); 12 | 13 | function exchange( 14 | int128 i, 15 | int128 j, 16 | uint256 _dx, 17 | uint256 _min_dy 18 | ) external returns (uint256); 19 | } 20 | -------------------------------------------------------------------------------- /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/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/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/uniswap-v3-periphery/contracts/interfaces/external/IWETH9.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity =0.7.6; 3 | 4 | import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; 5 | 6 | /// @title Interface for WETH9 7 | interface IWETH9 is IERC20 { 8 | /// @notice Deposit ether to get wrapped ether 9 | function deposit() external payable; 10 | 11 | /// @notice Withdraw wrapped ether to get ether 12 | function withdraw(uint256) external; 13 | } 14 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/access/AccessControl.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeAccessControl, 3 | } = require('./AccessControl.behavior.js'); 4 | 5 | const AccessControlMock = artifacts.require('AccessControlMock'); 6 | 7 | contract('AccessControl', function (accounts) { 8 | beforeEach(async function () { 9 | this.accessControl = await AccessControlMock.new({ from: accounts[0] }); 10 | }); 11 | 12 | shouldBehaveLikeAccessControl('AccessControl', ...accounts); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/ticks.ts: -------------------------------------------------------------------------------- 1 | import { BigNumber } from 'ethers' 2 | 3 | export const getMinTick = (tickSpacing: number) => Math.ceil(-887272 / tickSpacing) * tickSpacing 4 | export const getMaxTick = (tickSpacing: number) => Math.floor(887272 / tickSpacing) * tickSpacing 5 | export const getMaxLiquidityPerTick = (tickSpacing: number) => 6 | BigNumber.from(2) 7 | .pow(128) 8 | .sub(1) 9 | .div((getMaxTick(tickSpacing) - getMinTick(tickSpacing)) / tickSpacing + 1) 10 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/.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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/test/access/AccessControl.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeAccessControl, 3 | } = require('./AccessControl.behavior.js'); 4 | 5 | const AccessControlMock = artifacts.require('AccessControlMock'); 6 | 7 | contract('AccessControl', function (accounts) { 8 | beforeEach(async function () { 9 | this.accessControl = await AccessControlMock.new({ from: accounts[0] }); 10 | }); 11 | 12 | shouldBehaveLikeAccessControl('AccessControl', ...accounts); 13 | }); 14 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/audits/tob/contracts/crytic/manticore/002.sol: -------------------------------------------------------------------------------- 1 | import '../../../../../contracts/libraries/BitMath.sol'; 2 | 3 | contract VerifyBitMathLsb { 4 | function verify(uint256 x) external { 5 | uint256 lsb = BitMath.leastSignificantBit(x); 6 | 7 | // (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) 8 | bool property = ((x & (2**lsb)) != 0) && ((x & (2**(lsb - 1))) == 0); 9 | 10 | require(!property); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/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/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/openzeppelin-contracts/contracts/mocks/ERC20CappedMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/extensions/ERC20Capped.sol"; 6 | 7 | contract ERC20CappedMock is ERC20Capped { 8 | constructor( 9 | string memory name, 10 | string memory symbol, 11 | uint256 cap 12 | ) ERC20(name, symbol) ERC20Capped(cap) {} 13 | 14 | function mint(address to, uint256 tokenId) public { 15 | _mint(to, tokenId); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/__snapshots__/PositionValue.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`PositionValue #fees when price is above the position range gas 1`] = `47658`; 4 | 5 | exports[`PositionValue #fees when price is below the position range gas 1`] = `47626`; 6 | 7 | exports[`PositionValue #fees when price is within the position range gas 1`] = `53216`; 8 | 9 | exports[`PositionValue #principal gas 1`] = `23001`; 10 | 11 | exports[`PositionValue #total gas 1`] = `59777`; 12 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/ERC1155BurnableMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC1155/extensions/ERC1155Burnable.sol"; 6 | 7 | contract ERC1155BurnableMock is ERC1155Burnable { 8 | constructor(string memory uri) ERC1155(uri) {} 9 | 10 | function mint( 11 | address to, 12 | uint256 id, 13 | uint256 value, 14 | bytes memory data 15 | ) public { 16 | _mint(to, id, value, data); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/base/BlockTimestamp.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity =0.7.6; 3 | 4 | /// @title Function for getting block timestamp 5 | /// @dev Base contract that is overridden for tests 6 | abstract contract BlockTimestamp { 7 | /// @dev Method that exists purely to be overridden for tests 8 | /// @return The current block timestamp 9 | function _blockTimestamp() internal view virtual returns (uint256) { 10 | return block.timestamp; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/test/TestCallbackValidation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../libraries/CallbackValidation.sol'; 5 | 6 | contract TestCallbackValidation { 7 | function verifyCallback( 8 | address factory, 9 | address tokenA, 10 | address tokenB, 11 | uint24 fee 12 | ) external view returns (IUniswapV3Pool pool) { 13 | return CallbackValidation.verifyCallback(factory, tokenA, tokenB, fee); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/contracts/mocks/SignatureCheckerMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/cryptography/SignatureChecker.sol"; 6 | 7 | contract SignatureCheckerMock { 8 | using SignatureChecker for address; 9 | 10 | function isValidSignatureNow( 11 | address signer, 12 | bytes32 hash, 13 | bytes memory signature 14 | ) public view returns (bool) { 15 | return signer.isValidSignatureNow(hash, signature); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/hardhat/task-get-compiler-input.js: -------------------------------------------------------------------------------- 1 | // adds storageLayout to solc outputSelection, necessary for storage gaps 2 | 3 | const { internalTask } = require('hardhat/config'); 4 | const { TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT } = require('hardhat/builtin-tasks/task-names'); 5 | 6 | internalTask(TASK_COMPILE_SOLIDITY_GET_COMPILER_INPUT, async (args, bre, runSuper) => { 7 | const input = await runSuper(); 8 | input.settings.outputSelection['*']['*'].push('storageLayout'); 9 | return input; 10 | }); 11 | -------------------------------------------------------------------------------- /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/uniswap-v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | 4 | /// @title Immutable state 5 | /// @notice Functions that return immutable state of the router 6 | interface IPeripheryImmutableState { 7 | /// @return Returns the address of the Uniswap V3 factory 8 | function factory() external view returns (address); 9 | 10 | /// @return Returns the address of WETH9 11 | function WETH9() external view returns (address); 12 | } 13 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/uniswap-v2-periphery/contracts/interfaces/V1/IUniswapV1Exchange.sol: -------------------------------------------------------------------------------- 1 | pragma solidity >=0.5.0; 2 | 3 | interface IUniswapV1Exchange { 4 | function balanceOf(address owner) external view returns (uint); 5 | function transferFrom(address from, address to, uint value) external returns (bool); 6 | function removeLiquidity(uint, uint, uint, uint) external returns (uint, uint); 7 | function tokenToEthSwapInput(uint, uint, uint) external returns (uint); 8 | function ethToTokenSwapInput(uint, uint) external payable returns (uint); 9 | } 10 | -------------------------------------------------------------------------------- /.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: [ 10 | "standard", 11 | "plugin:prettier/recommended", 12 | "plugin:node/recommended", 13 | ], 14 | parser: "@typescript-eslint/parser", 15 | parserOptions: { 16 | ecmaVersion: 12, 17 | }, 18 | rules: { 19 | "node/no-unsupported-features/es-syntax": [ 20 | "error", 21 | { ignores: ["modules"] }, 22 | ], 23 | }, 24 | }; 25 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/test/helpers/enums.js: -------------------------------------------------------------------------------- 1 | const { BN } = require('@openzeppelin/test-helpers'); 2 | 3 | function Enum (...options) { 4 | return Object.fromEntries(options.map((key, i) => [ key, new BN(i) ])); 5 | } 6 | 7 | module.exports = { 8 | Enum, 9 | ProposalState: Enum( 10 | 'Pending', 11 | 'Active', 12 | 'Canceled', 13 | 'Defeated', 14 | 'Succeeded', 15 | 'Queued', 16 | 'Expired', 17 | 'Executed', 18 | ), 19 | VoteType: Enum( 20 | 'Against', 21 | 'For', 22 | 'Abstain', 23 | ), 24 | }; 25 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/test/Base64Test.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import 'base64-sol/base64.sol'; 5 | 6 | contract Base64Test { 7 | function encode(bytes memory data) external pure returns (string memory) { 8 | return Base64.encode(data); 9 | } 10 | 11 | function getGasCostOfEncode(bytes memory data) external view returns (uint256) { 12 | uint256 gasBefore = gasleft(); 13 | Base64.encode(data); 14 | return gasBefore - gasleft(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/test/helpers/enums.js: -------------------------------------------------------------------------------- 1 | const { BN } = require('@openzeppelin/test-helpers'); 2 | 3 | function Enum (...options) { 4 | return Object.fromEntries(options.map((key, i) => [ key, new BN(i) ])); 5 | } 6 | 7 | module.exports = { 8 | Enum, 9 | ProposalState: Enum( 10 | 'Pending', 11 | 'Active', 12 | 'Canceled', 13 | 'Defeated', 14 | 'Succeeded', 15 | 'Queued', 16 | 'Expired', 17 | 'Executed', 18 | ), 19 | VoteType: Enum( 20 | 'Against', 21 | 'For', 22 | 'Abstain', 23 | ), 24 | }; 25 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/contracts/test/UnsafeMathEchidnaTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../libraries/UnsafeMath.sol'; 5 | 6 | contract UnsafeMathEchidnaTest { 7 | function checkDivRoundingUp(uint256 x, uint256 d) external pure { 8 | require(d > 0); 9 | uint256 z = UnsafeMath.divRoundingUp(x, d); 10 | uint256 diff = z - (x / d); 11 | if (x % d == 0) { 12 | assert(diff == 0); 13 | } else { 14 | assert(diff == 1); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/v3-quoter/frontend/src/hooks/useContractConfig.js: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from "react"; 2 | import { loadAppContracts } from "../helpers/loadAppContracts"; 3 | 4 | const useContractConfig = () => { 5 | const [contractsConfig, setContractsConfig] = useState({}); 6 | 7 | useEffect(() => { 8 | const loadFunc = async () => { 9 | const result = await loadAppContracts(); 10 | setContractsConfig(result); 11 | }; 12 | void loadFunc(); 13 | }, []); 14 | return contractsConfig; 15 | }; 16 | 17 | export default useContractConfig; 18 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.fixAll.eslint": true 4 | }, 5 | "editor.formatOnSave": true, 6 | "solidity.packageDefaultDependenciesContractsDirectory": "", 7 | "solidity.packageDefaultDependenciesDirectory": "lib", 8 | "solidity.compileUsingRemoteVersion": "v0.8.13+commit.abaa5c0e", 9 | "files.exclude": { 10 | "**/.git": true, 11 | "**/.svn": true, 12 | "**/.hg": true, 13 | "**/CVS": true, 14 | "**/.DS_Store": true, 15 | "**/Thumbs.db": true, 16 | "**/node_modules": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/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/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/uniswap-v3-periphery/contracts/test/MockTimeSwapRouter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | pragma abicoder v2; 4 | 5 | import '../SwapRouter.sol'; 6 | 7 | contract MockTimeSwapRouter is SwapRouter { 8 | uint256 time; 9 | 10 | constructor(address _factory, address _WETH9) SwapRouter(_factory, _WETH9) {} 11 | 12 | function _blockTimestamp() internal view override returns (uint256) { 13 | return time; 14 | } 15 | 16 | function setTime(uint256 _time) external { 17 | time = _time; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/test/shared/encodePriceSqrt.ts: -------------------------------------------------------------------------------- 1 | import bn from 'bignumber.js' 2 | import { BigNumber, BigNumberish } from 'ethers' 3 | 4 | bn.config({ EXPONENTIAL_AT: 999999, DECIMAL_PLACES: 40 }) 5 | 6 | // returns the sqrt price as a 64x96 7 | export function encodePriceSqrt(reserve1: BigNumberish, reserve0: BigNumberish): BigNumber { 8 | return BigNumber.from( 9 | new bn(reserve1.toString()) 10 | .div(reserve0.toString()) 11 | .sqrt() 12 | .multipliedBy(new bn(2).pow(96)) 13 | .integerValue(3) 14 | .toString() 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for OpenZeppelin Contracts 4 | 5 | --- 6 | 7 | **🧐 Motivation** 8 | 9 | 10 | **📝 Details** 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/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/uniswap-v3-core/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml: -------------------------------------------------------------------------------- 1 | checkAsserts: true 2 | coverage: true 3 | codeSize: 0x60000 4 | corpusDir: echidna_e2e_mint_burn_corpus 5 | seqLen: 10 6 | testLimit: 100000 7 | timeout: 600 # 10 minutes 8 | 9 | # blacklist 10 | filterFunctions: 11 | [ 12 | 'E2E_mint_burn.viewInitRandomPoolParams(uint128)', 13 | 'E2E_mint_burn.viewMintRandomNewPosition(uint128,int24,uint24,int24)', 14 | 'E2E_mint_burn.viewBurnRandomPositionIdx(uint128,uint128)', 15 | 'E2E_mint_burn.viewBurnRandomPositionBurnAmount(uint128,uint128)', 16 | ] 17 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for OpenZeppelin Contracts 4 | 5 | --- 6 | 7 | **🧐 Motivation** 8 | 9 | 10 | **📝 Details** 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /lib/uniswap-v3-core/contracts/test/LiquidityMathTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../libraries/LiquidityMath.sol'; 5 | 6 | contract LiquidityMathTest { 7 | function addDelta(uint128 x, int128 y) external pure returns (uint128 z) { 8 | return LiquidityMath.addDelta(x, y); 9 | } 10 | 11 | function getGasCostOfAddDelta(uint128 x, int128 y) external view returns (uint256) { 12 | uint256 gasBefore = gasleft(); 13 | LiquidityMath.addDelta(x, y); 14 | return gasBefore - gasleft(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.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 IBeaconUpgradeable { 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/openzeppelin-contracts/test/token/ERC721/ERC721.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeERC721, 3 | shouldBehaveLikeERC721Metadata, 4 | } = require('./ERC721.behavior'); 5 | 6 | const ERC721Mock = artifacts.require('ERC721Mock'); 7 | 8 | contract('ERC721', function (accounts) { 9 | const name = 'Non Fungible Token'; 10 | const symbol = 'NFT'; 11 | 12 | beforeEach(async function () { 13 | this.token = await ERC721Mock.new(name, symbol); 14 | }); 15 | 16 | shouldBehaveLikeERC721('ERC721', ...accounts); 17 | shouldBehaveLikeERC721Metadata('ERC721', name, symbol, ...accounts); 18 | }); 19 | -------------------------------------------------------------------------------- /lib/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/uniswap-v3-core/test/__snapshots__/BitMath.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`BitMath #leastSignificantBit gas cost of max uint128 1`] = `431`; 4 | 5 | exports[`BitMath #leastSignificantBit gas cost of max uint256 1`] = `431`; 6 | 7 | exports[`BitMath #leastSignificantBit gas cost of smaller number 1`] = `429`; 8 | 9 | exports[`BitMath #mostSignificantBit gas cost of max uint128 1`] = `367`; 10 | 11 | exports[`BitMath #mostSignificantBit gas cost of max uint256 1`] = `385`; 12 | 13 | exports[`BitMath #mostSignificantBit gas cost of smaller number 1`] = `295`; 14 | -------------------------------------------------------------------------------- /lib/v3-quoter/contracts/interfaces/IQuoter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity >=0.8.0 <0.9.0; 3 | pragma experimental ABIEncoderV2; 4 | 5 | interface IQuoter { 6 | function estimateMaxSwapUniswapV3( 7 | address _fromToken, 8 | address _toToken, 9 | uint256 _amount, 10 | uint24 _poolFee 11 | ) external view returns (uint256); 12 | 13 | function estimateMinSwapUniswapV3( 14 | address _fromToken, 15 | address _toToken, 16 | uint256 _amount, 17 | uint24 _poolFee 18 | ) external view returns (uint256); 19 | } 20 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/test/token/ERC721/ERC721.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | shouldBehaveLikeERC721, 3 | shouldBehaveLikeERC721Metadata, 4 | } = require('./ERC721.behavior'); 5 | 6 | const ERC721Mock = artifacts.require('ERC721Mock'); 7 | 8 | contract('ERC721', function (accounts) { 9 | const name = 'Non Fungible Token'; 10 | const symbol = 'NFT'; 11 | 12 | beforeEach(async function () { 13 | this.token = await ERC721Mock.new(name, symbol); 14 | }); 15 | 16 | shouldBehaveLikeERC721('ERC721', ...accounts); 17 | shouldBehaveLikeERC721Metadata('ERC721', name, symbol, ...accounts); 18 | }); 19 | -------------------------------------------------------------------------------- /lib/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/uniswap-v3-core/contracts/test/FullMathTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../libraries/FullMath.sol'; 5 | 6 | contract FullMathTest { 7 | function mulDiv( 8 | uint256 x, 9 | uint256 y, 10 | uint256 z 11 | ) external pure returns (uint256) { 12 | return FullMath.mulDiv(x, y, z); 13 | } 14 | 15 | function mulDivRoundingUp( 16 | uint256 x, 17 | uint256 y, 18 | uint256 z 19 | ) external pure returns (uint256) { 20 | return FullMath.mulDivRoundingUp(x, y, z); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/test/utils/Context.test.js: -------------------------------------------------------------------------------- 1 | require('@openzeppelin/test-helpers'); 2 | 3 | const ContextMock = artifacts.require('ContextMock'); 4 | const ContextMockCaller = artifacts.require('ContextMockCaller'); 5 | 6 | const { shouldBehaveLikeRegularContext } = require('./Context.behavior'); 7 | 8 | contract('Context', function (accounts) { 9 | const [ sender ] = accounts; 10 | 11 | beforeEach(async function () { 12 | this.context = await ContextMock.new(); 13 | this.caller = await ContextMockCaller.new(); 14 | }); 15 | 16 | shouldBehaveLikeRegularContext(sender); 17 | }); 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts/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( 9 | bytes32[] memory proof, 10 | bytes32 root, 11 | bytes32 leaf 12 | ) public pure returns (bool) { 13 | return MerkleProof.verify(proof, root, leaf); 14 | } 15 | 16 | function processProof(bytes32[] memory proof, bytes32 leaf) public pure returns (bytes32) { 17 | return MerkleProof.processProof(proof, leaf); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /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/uniswap-v2-periphery/.waffle.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerVersion": "./node_modules/solc", 3 | "outputType": "all", 4 | "compilerOptions": { 5 | "outputSelection": { 6 | "*": { 7 | "*": [ 8 | "evm.bytecode.object", 9 | "evm.deployedBytecode.object", 10 | "abi", 11 | "evm.bytecode.sourceMap", 12 | "evm.deployedBytecode.sourceMap", 13 | "metadata" 14 | ], 15 | "": ["ast"] 16 | } 17 | }, 18 | "evmVersion": "istanbul", 19 | "optimizer": { 20 | "enabled": true, 21 | "runs": 999999 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/test/TickLensTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | pragma abicoder v2; 4 | 5 | import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; 6 | import '../lens/TickLens.sol'; 7 | 8 | /// @title Tick Lens contract 9 | contract TickLensTest is TickLens { 10 | function getGasCostOfGetPopulatedTicksInWord(address pool, int16 tickBitmapIndex) external view returns (uint256) { 11 | uint256 gasBefore = gasleft(); 12 | getPopulatedTicksInWord(pool, tickBitmapIndex); 13 | return gasBefore - gasleft(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Multi Dex Trader 2 | 3 | Smart contracts for managing trade paths across multiple DEXs to trade any 4 | collaterals into a targeted token 5 | 6 | ### Structure 7 | 8 | - Dex Traders: Dedicated trader contract for each DEX used, including 9 | Uniswap v2, v3, Sushiswap, and Curve. Must be inherited from 10 | IVestaDexTrader interface. 11 | - VestaTradeManager: Manages trading paths and actions for any collaterals 12 | supported in Vesta Protocol v1. 13 | 14 | ### Commands script 15 | 16 | ``` 17 | git clone https://github.com/IntelMin/multi-dex-trader.git 18 | forge install 19 | forge build 20 | forge test 21 | ``` 22 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/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/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/openzeppelin-contracts-upgradeable/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/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/openzeppelin-contracts-upgradeable/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/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/uniswap-v3-periphery/contracts/test/PoolTicksCounterTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; 3 | 4 | pragma solidity >=0.6.0; 5 | 6 | import '../libraries/PoolTicksCounter.sol'; 7 | 8 | contract PoolTicksCounterTest { 9 | using PoolTicksCounter for IUniswapV3Pool; 10 | 11 | function countInitializedTicksCrossed( 12 | IUniswapV3Pool pool, 13 | int24 tickBefore, 14 | int24 tickAfter 15 | ) external view returns (uint32 initializedTicksCrossed) { 16 | return pool.countInitializedTicksCrossed(tickBefore, tickAfter); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/interfaces/curve.finance/ISwaps.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.13; 3 | 4 | interface ISwaps { 5 | function get_best_rate( 6 | address _from, 7 | address _to, 8 | uint256 _amount 9 | ) external view returns (address, uint256); 10 | 11 | function get_exchange_amount( 12 | address _pool, 13 | address _from, 14 | address _to, 15 | uint256 _amount 16 | ) external view returns (uint256); 17 | 18 | function exchange( 19 | address _pool, 20 | address _from, 21 | address _to, 22 | uint256 _amount, 23 | uint256 _expected, 24 | address _receiver 25 | ) external payable returns (uint256); 26 | } 27 | -------------------------------------------------------------------------------- /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/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/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 '0x' + ethSigUtil.TypedDataUtils.hashStruct( 12 | 'EIP712Domain', 13 | { name, version, chainId, verifyingContract }, 14 | { EIP712Domain }, 15 | ).toString('hex'); 16 | } 17 | 18 | module.exports = { 19 | EIP712Domain, 20 | domainSeparator, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/contracts/examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | ## Disclaimer 4 | 5 | These contracts are for demonstrative purposes only. 6 | While these contracts have unit tests, and we generally expect them to be 7 | correct, there are no guarantees about the correctness or security of 8 | these contracts. We hold these contracts to a different standard of 9 | correctness and security than other contracts in this repository. 10 | E.g., we have explicitly excluded these contracts from the 11 | [bug bounty](https://uniswap.org/bug-bounty/#scope). 12 | 13 | You must do your own due diligence if you wish to use code 14 | from these examples in your project. 15 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/hardhat/env-artifacts.js: -------------------------------------------------------------------------------- 1 | const { HardhatError } = require('hardhat/internal/core/errors'); 2 | 3 | extendEnvironment(env => { 4 | const artifactsRequire = env.artifacts.require; 5 | 6 | env.artifacts.require = (name) => { 7 | for (const suffix of ['UpgradeableWithInit', 'Upgradeable', '']) { 8 | try { 9 | return artifactsRequire(name + suffix); 10 | } catch (e) { 11 | if (HardhatError.isHardhatError(e) && e.number === 700 && suffix !== '') { 12 | continue; 13 | } else { 14 | throw e; 15 | } 16 | } 17 | } 18 | throw new Error('Unreachable'); 19 | }; 20 | }); 21 | -------------------------------------------------------------------------------- /lib/uniswap-v2-periphery/contracts/libraries/SafeMath.sol: -------------------------------------------------------------------------------- 1 | pragma solidity =0.6.6; 2 | 3 | // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) 4 | 5 | library SafeMath { 6 | function add(uint x, uint y) internal pure returns (uint z) { 7 | require((z = x + y) >= x, 'ds-math-add-overflow'); 8 | } 9 | 10 | function sub(uint x, uint y) internal pure returns (uint z) { 11 | require((z = x - y) <= x, 'ds-math-sub-underflow'); 12 | } 13 | 14 | function mul(uint x, uint y) internal pure returns (uint z) { 15 | require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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 '0x' + ethSigUtil.TypedDataUtils.hashStruct( 12 | 'EIP712Domain', 13 | { name, version, chainId, verifyingContract }, 14 | { EIP712Domain }, 15 | ).toString('hex'); 16 | } 17 | 18 | module.exports = { 19 | EIP712Domain, 20 | domainSeparator, 21 | }; 22 | -------------------------------------------------------------------------------- /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/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/openzeppelin-contracts-upgradeable/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/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/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/uniswap-v3-periphery/contracts/base/PeripheryImmutableState.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity =0.7.6; 3 | 4 | import '../interfaces/IPeripheryImmutableState.sol'; 5 | 6 | /// @title Immutable state 7 | /// @notice Immutable state used by periphery contracts 8 | abstract contract PeripheryImmutableState is IPeripheryImmutableState { 9 | /// @inheritdoc IPeripheryImmutableState 10 | address public immutable override factory; 11 | /// @inheritdoc IPeripheryImmutableState 12 | address public immutable override WETH9; 13 | 14 | constructor(address _factory, address _WETH9) { 15 | factory = _factory; 16 | WETH9 = _WETH9; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/hardhat/task-test-get-files.js: -------------------------------------------------------------------------------- 1 | // ignores the proxy tests 2 | 3 | const { internalTask } = require('hardhat/config'); 4 | 5 | const { TASK_TEST_GET_TEST_FILES } = require('hardhat/builtin-tasks/task-names'); 6 | const glob = require('glob'); 7 | const path = require('path'); 8 | const { promisify } = require('util'); 9 | 10 | internalTask(TASK_TEST_GET_TEST_FILES) 11 | .setAction(async ({ testFiles }, { config }) => { 12 | if (testFiles.length !== 0) { 13 | return testFiles; 14 | } 15 | return await promisify(glob)( 16 | path.join(config.paths.tests, '**/*.js'), 17 | { ignore: [path.join(config.paths.tests, 'proxy/**/*')] }, 18 | ); 19 | }); 20 | -------------------------------------------------------------------------------- /lib/v3-quoter/contracts/libraries/LiquidityMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0; 3 | 4 | /// @title Math library for liquidity 5 | library LiquidityMath { 6 | /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows 7 | /// @param x The liquidity before change 8 | /// @param y The delta by which liquidity should be changed 9 | /// @return z The liquidity delta 10 | function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) { 11 | if (y < 0) { 12 | require((z = x - uint128(-y)) < x, 'LS'); 13 | } else { 14 | require((z = x + uint128(y)) >= x, 'LA'); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /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/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/uniswap-v3-core/contracts/test/BitMathEchidnaTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../libraries/BitMath.sol'; 5 | 6 | contract BitMathEchidnaTest { 7 | function mostSignificantBitInvariant(uint256 input) external pure { 8 | uint8 msb = BitMath.mostSignificantBit(input); 9 | assert(input >= (uint256(2)**msb)); 10 | assert(msb == 255 || input < uint256(2)**(msb + 1)); 11 | } 12 | 13 | function leastSignificantBitInvariant(uint256 input) external pure { 14 | uint8 lsb = BitMath.leastSignificantBit(input); 15 | assert(input & (uint256(2)**lsb) != 0); 16 | assert(input & (uint256(2)**lsb - 1) == 0); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/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/uniswap-v3-periphery/contracts/interfaces/IERC20Metadata.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity ^0.7.0; 3 | 4 | import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; 5 | 6 | /// @title IERC20Metadata 7 | /// @title Interface for ERC20 Metadata 8 | /// @notice Extension to IERC20 that includes token metadata 9 | interface IERC20Metadata is IERC20 { 10 | /// @return The name of the token 11 | function name() external view returns (string memory); 12 | 13 | /// @return The symbol of the token 14 | function symbol() external view returns (string memory); 15 | 16 | /// @return The number of decimal places the token has 17 | function decimals() external view returns (uint8); 18 | } 19 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/contracts/libraries/LiquidityMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | 4 | /// @title Math library for liquidity 5 | library LiquidityMath { 6 | /// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows 7 | /// @param x The liquidity before change 8 | /// @param y The delta by which liquidity should be changed 9 | /// @return z The liquidity delta 10 | function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) { 11 | if (y < 0) { 12 | require((z = x - uint128(-y)) < x, 'LS'); 13 | } else { 14 | require((z = x + uint128(y)) >= x, 'LA'); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/uniswap-v3-periphery/contracts/test/MockTimeNonfungiblePositionManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | pragma abicoder v2; 4 | 5 | import '../NonfungiblePositionManager.sol'; 6 | 7 | contract MockTimeNonfungiblePositionManager is NonfungiblePositionManager { 8 | uint256 time; 9 | 10 | constructor( 11 | address _factory, 12 | address _WETH9, 13 | address _tokenDescriptor 14 | ) NonfungiblePositionManager(_factory, _WETH9, _tokenDescriptor) {} 15 | 16 | function _blockTimestamp() internal view override returns (uint256) { 17 | return time; 18 | } 19 | 20 | function setTime(uint256 _time) external { 21 | time = _time; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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/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/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/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/openzeppelin-contracts-upgradeable/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/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/uniswap-v3-periphery/contracts/test/NonfungiblePositionManagerPositionsGasTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../interfaces/INonfungiblePositionManager.sol'; 5 | 6 | contract NonfungiblePositionManagerPositionsGasTest { 7 | INonfungiblePositionManager immutable nonfungiblePositionManager; 8 | 9 | constructor(INonfungiblePositionManager _nonfungiblePositionManager) { 10 | nonfungiblePositionManager = _nonfungiblePositionManager; 11 | } 12 | 13 | function getGasCostOfPositions(uint256 tokenId) external view returns (uint256) { 14 | uint256 gasBefore = gasleft(); 15 | nonfungiblePositionManager.positions(tokenId); 16 | return gasBefore - gasleft(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/mocks/ERC165/ERC165NotSupportedUpgradeable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | import "../../proxy/utils/Initializable.sol"; 5 | 6 | contract ERC165NotSupportedUpgradeable is Initializable { function __ERC165NotSupported_init() internal onlyInitializing { 7 | } 8 | 9 | function __ERC165NotSupported_init_unchained() internal onlyInitializing { 10 | } 11 | 12 | /** 13 | * @dev This empty reserved space is put in place to allow future versions to add new 14 | * variables without shifting down storage in the inheritance chain. 15 | * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps 16 | */ 17 | uint256[50] private __gap; 18 | } 19 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/contracts/libraries/UnsafeMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | 4 | /// @title Math functions that do not check inputs or outputs 5 | /// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks 6 | library UnsafeMath { 7 | /// @notice Returns ceil(x / y) 8 | /// @dev division by 0 has unspecified behavior, and must be checked externally 9 | /// @param x The dividend 10 | /// @param y The divisor 11 | /// @return z The quotient, ceil(x / y) 12 | function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) { 13 | assembly { 14 | z := add(div(x, y), gt(mod(x, y), 0)) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/.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/openzeppelin-contracts-upgradeable/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/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/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/uniswap-v2-periphery/README.md: -------------------------------------------------------------------------------- 1 | # Uniswap V2 2 | 3 | [![Actions Status](https://github.com/Uniswap/uniswap-v2-periphery/workflows/CI/badge.svg)](https://github.com/Uniswap/uniswap-v2-periphery/actions) 4 | [![npm](https://img.shields.io/npm/v/@uniswap/v2-periphery?style=flat-square)](https://npmjs.com/package/@uniswap/v2-periphery) 5 | 6 | In-depth documentation on Uniswap V2 is available at [uniswap.org](https://uniswap.org/docs). 7 | 8 | The built contract artifacts can be browsed via [unpkg.com](https://unpkg.com/browse/@uniswap/v2-periphery@latest/). 9 | 10 | # Local Development 11 | 12 | The following assumes the use of `node@>=10`. 13 | 14 | ## Install Dependencies 15 | 16 | `yarn` 17 | 18 | ## Compile Contracts 19 | 20 | `yarn compile` 21 | 22 | ## Run Tests 23 | 24 | `yarn test` 25 | -------------------------------------------------------------------------------- /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/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/uniswap-v3-periphery/contracts/interfaces/IMulticall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.7.5; 3 | pragma abicoder v2; 4 | 5 | /// @title Multicall interface 6 | /// @notice Enables calling multiple methods in a single call to the contract 7 | interface IMulticall { 8 | /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed 9 | /// @dev The `msg.value` should not be trusted for any method callable from multicall. 10 | /// @param data The encoded function data for each of the calls to make to this contract 11 | /// @return results The results from each of the calls passed in via data 12 | function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); 13 | } 14 | -------------------------------------------------------------------------------- /lib/v3-quoter/contracts/libraries/UnsafeMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0; 3 | 4 | /// @title Math functions that do not check inputs or outputs 5 | /// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks 6 | library UnsafeMath { 7 | /// @notice Returns ceil(x / y) 8 | /// @dev division by 0 has unspecified behavior, and must be checked externally 9 | /// @param x The dividend 10 | /// @param y The divisor 11 | /// @return z The quotient, ceil(x / y) 12 | function divRoundingUp(uint256 x, uint256 y) 13 | internal 14 | pure 15 | returns (uint256 z) 16 | { 17 | assembly { 18 | z := add(div(x, y), gt(mod(x, y), 0)) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/mocks/MockUniswapV3Quoter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: SEE LICENSE IN LICENSE 2 | pragma solidity ^0.8.13; 3 | 4 | import "./MockUniswapV3Router.sol"; 5 | 6 | contract MockUniswapV3Quoter { 7 | MockUniswapV3Router immutable uniswapV3Router; 8 | 9 | constructor(MockUniswapV3Router _uniswapV3Router) { 10 | uniswapV3Router = _uniswapV3Router; 11 | } 12 | 13 | function estimateMinSwapUniswapV3( 14 | address, 15 | address, 16 | uint256 _amount, 17 | uint24 18 | ) external view returns (uint256) { 19 | return uniswapV3Router.expectAmountIn(_amount); 20 | } 21 | 22 | function estimateMaxSwapUniswapV3( 23 | address, 24 | address, 25 | uint256 _amount, 26 | uint24 27 | ) external view returns (uint256) { 28 | return uniswapV3Router.expectAmountOut(_amount); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/mocks/ERC165MockUpgradeable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../utils/introspection/ERC165Upgradeable.sol"; 6 | import "../proxy/utils/Initializable.sol"; 7 | 8 | contract ERC165MockUpgradeable is Initializable, ERC165Upgradeable { function __ERC165Mock_init() internal onlyInitializing { 9 | } 10 | 11 | function __ERC165Mock_init_unchained() internal onlyInitializing { 12 | } 13 | 14 | /** 15 | * @dev This empty reserved space is put in place to allow future versions to add new 16 | * variables without shifting down storage in the inheritance chain. 17 | * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps 18 | */ 19 | uint256[50] private __gap; 20 | } 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/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/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1271Upgradeable.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 IERC1271Upgradeable { 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/openzeppelin-contracts/contracts/mocks/ERC20DecimalsMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../token/ERC20/ERC20.sol"; 6 | 7 | contract ERC20DecimalsMock is ERC20 { 8 | uint8 private immutable _decimals; 9 | 10 | constructor( 11 | string memory name_, 12 | string memory symbol_, 13 | uint8 decimals_ 14 | ) ERC20(name_, symbol_) { 15 | _decimals = decimals_; 16 | } 17 | 18 | function decimals() public view virtual override returns (uint8) { 19 | return _decimals; 20 | } 21 | 22 | function mint(address account, uint256 amount) public { 23 | _mint(account, amount); 24 | } 25 | 26 | function burn(address account, uint256 amount) public { 27 | _burn(account, amount); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/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/openzeppelin-contracts-upgradeable/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/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/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/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Fixes #???? 7 | 8 | 9 | 10 | 11 | 12 | #### PR Checklist 13 | 14 | 15 | 16 | 17 | 18 | - [ ] Tests 19 | - [ ] Documentation 20 | - [ ] Changelog entry 21 | -------------------------------------------------------------------------------- /lib/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/openzeppelin-contracts-upgradeable/.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/openzeppelin-contracts-upgradeable/contracts/mocks/OwnableMockUpgradeable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../access/OwnableUpgradeable.sol"; 6 | import "../proxy/utils/Initializable.sol"; 7 | 8 | contract OwnableMockUpgradeable is Initializable, OwnableUpgradeable { function __OwnableMock_init() internal onlyInitializing { 9 | __Ownable_init_unchained(); 10 | } 11 | 12 | function __OwnableMock_init_unchained() internal onlyInitializing { 13 | } 14 | 15 | /** 16 | * @dev This empty reserved space is put in place to allow future versions to add new 17 | * variables without shifting down storage in the inheritance chain. 18 | * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps 19 | */ 20 | uint256[50] private __gap; 21 | } 22 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Fixes #???? 7 | 8 | 9 | 10 | 11 | 12 | #### PR Checklist 13 | 14 | 15 | 16 | 17 | 18 | - [ ] Tests 19 | - [ ] Documentation 20 | - [ ] Changelog entry 21 | -------------------------------------------------------------------------------- /lib/uniswap-v3-periphery/contracts/test/TestMulticall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | pragma abicoder v2; 4 | 5 | import '../base/Multicall.sol'; 6 | 7 | contract TestMulticall is Multicall { 8 | function functionThatRevertsWithError(string memory error) external pure { 9 | revert(error); 10 | } 11 | 12 | struct Tuple { 13 | uint256 a; 14 | uint256 b; 15 | } 16 | 17 | function functionThatReturnsTuple(uint256 a, uint256 b) external pure returns (Tuple memory tuple) { 18 | tuple = Tuple({b: a, a: b}); 19 | } 20 | 21 | uint256 public paid; 22 | 23 | function pays() external payable { 24 | paid += msg.value; 25 | } 26 | 27 | function returnSender() external view returns (address) { 28 | return msg.sender; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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/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/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/openzeppelin-contracts-upgradeable/contracts/mocks/ERC165/ERC165MissingDataUpgradeable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | import "../../proxy/utils/Initializable.sol"; 5 | 6 | contract ERC165MissingDataUpgradeable is Initializable { 7 | function __ERC165MissingData_init() internal onlyInitializing { 8 | } 9 | 10 | function __ERC165MissingData_init_unchained() internal onlyInitializing { 11 | } 12 | function supportsInterface(bytes4 interfaceId) public view {} // missing return 13 | 14 | /** 15 | * @dev This empty reserved space is put in place to allow future versions to add new 16 | * variables without shifting down storage in the inheritance chain. 17 | * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps 18 | */ 19 | uint256[50] private __gap; 20 | } 21 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/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/uniswap-v3-core/test/__snapshots__/SwapMath.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`SwapMath #computeSwapStep gas swap one for zero exact in capped 1`] = `2103`; 4 | 5 | exports[`SwapMath #computeSwapStep gas swap one for zero exact in partial 1`] = `2802`; 6 | 7 | exports[`SwapMath #computeSwapStep gas swap one for zero exact out capped 1`] = `1855`; 8 | 9 | exports[`SwapMath #computeSwapStep gas swap one for zero exact out partial 1`] = `2802`; 10 | 11 | exports[`SwapMath #computeSwapStep gas swap zero for one exact in capped 1`] = `2104`; 12 | 13 | exports[`SwapMath #computeSwapStep gas swap zero for one exact in partial 1`] = `3106`; 14 | 15 | exports[`SwapMath #computeSwapStep gas swap zero for one exact out capped 1`] = `1856`; 16 | 17 | exports[`SwapMath #computeSwapStep gas swap zero for one exact out partial 1`] = `3106`; 18 | -------------------------------------------------------------------------------- /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/openzeppelin-contracts-upgradeable/.github/workflows/merge-upstream.yml: -------------------------------------------------------------------------------- 1 | name: Merge upstream 2 | 3 | on: 4 | push: 5 | branches: [patches] 6 | workflow_dispatch: {} 7 | repository_dispatch: 8 | types: [Update] 9 | # client_payload: { ref: string } 10 | 11 | concurrency: 12 | group: merge-${{ github.event.client_payload.ref || github.ref }} 13 | cancel-in-progress: true 14 | 15 | jobs: 16 | merge: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v2 20 | with: 21 | ref: patches 22 | fetch-depth: 0 23 | ssh-key: ${{ secrets.DEPLOY_KEY }} 24 | - run: bash scripts/upgradeable/git-user-config.sh 25 | - run: bash scripts/upgradeable/merge-upstream.sh 26 | env: 27 | REF: ${{ github.event.client_payload.ref || github.ref}} 28 | - run: git push origin HEAD 29 | -------------------------------------------------------------------------------- /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( 23 | address to, 24 | uint256 tokenId, 25 | bytes memory _data 26 | ) public { 27 | _safeMint(to, tokenId, _data); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/scripts/upgradeable/transpile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail -x 4 | 5 | npm run compile 6 | 7 | # -D: delete original and excluded files 8 | # -i: use included Initializable 9 | # -x: exclude all proxy contracts except Clones library 10 | # -p: emit public initializer 11 | npx @openzeppelin/upgrade-safe-transpiler@latest -D \ 12 | -i contracts/proxy/utils/Initializable.sol \ 13 | -x 'contracts/proxy/**/*' \ 14 | -x '!contracts/proxy/Clones.sol' \ 15 | -x '!contracts/proxy/ERC1967/ERC1967{Storage,Upgrade}.sol' \ 16 | -x '!contracts/proxy/utils/UUPSUpgradeable.sol' \ 17 | -x '!contracts/proxy/beacon/IBeacon.sol' \ 18 | -p 'contracts/**/presets/**/*' 19 | 20 | # this is currently no longer used but could be useful again in the future 21 | # for p in scripts/upgradeable/patch/*.patch; do 22 | # git apply "$p" 23 | # done 24 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.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 "../IERC1155Upgradeable.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 IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { 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/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/uniswap-v3-core/test/__snapshots__/SqrtPriceMath.spec.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`SqrtPriceMath #getAmount0Delta gas cost for amount0 where roundUp = true 1`] = `610`; 4 | 5 | exports[`SqrtPriceMath #getAmount0Delta gas cost for amount0 where roundUp = true 2`] = `478`; 6 | 7 | exports[`SqrtPriceMath #getAmount1Delta gas cost for amount0 where roundUp = false 1`] = `478`; 8 | 9 | exports[`SqrtPriceMath #getAmount1Delta gas cost for amount0 where roundUp = true 1`] = `610`; 10 | 11 | exports[`SqrtPriceMath #getNextSqrtPriceFromInput zeroForOne = false gas 1`] = `536`; 12 | 13 | exports[`SqrtPriceMath #getNextSqrtPriceFromInput zeroForOne = true gas 1`] = `753`; 14 | 15 | exports[`SqrtPriceMath #getNextSqrtPriceFromOutput zeroForOne = false gas 1`] = `848`; 16 | 17 | exports[`SqrtPriceMath #getNextSqrtPriceFromOutput zeroForOne = true gas 1`] = `441`; 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/scripts/upgradeable/transpile-onto.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | if [ $# -lt 1 ]; then 6 | echo "usage: bash $0 [base]" >&2 7 | exit 1 8 | fi 9 | 10 | set -x 11 | 12 | target="$1" 13 | base="${2-}" 14 | 15 | bash scripts/upgradeable/transpile.sh 16 | 17 | commit="$(git rev-parse --short HEAD)" 18 | branch="$(git rev-parse --abbrev-ref HEAD)" 19 | 20 | git add contracts 21 | 22 | git checkout --quiet --detach 23 | 24 | if git rev-parse -q --verify "$target"; then 25 | git reset --soft "$target" 26 | git checkout "$target" 27 | else 28 | git checkout --orphan "$target" 29 | if [ -n "$base" ] && git rev-parse -q --verify "$base"; then 30 | git reset --soft "$base" 31 | fi 32 | fi 33 | 34 | if ! git diff --quiet --cached; then 35 | git commit -m "Transpile $commit" 36 | fi 37 | 38 | git checkout "$branch" 39 | -------------------------------------------------------------------------------- /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/uniswap-v3-core/.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | run-linters: 11 | name: Run linters 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Check out Git repository 16 | uses: actions/checkout@v2 17 | 18 | - name: Set up node 19 | uses: actions/setup-node@v1 20 | with: 21 | node-version: 12 22 | 23 | - name: Install dependencies 24 | run: yarn install --frozen-lockfile 25 | 26 | - name: Run linters 27 | uses: wearerequired/lint-action@a8497ddb33fb1205941fd40452ca9fff07e0770d 28 | with: 29 | github_token: ${{ secrets.github_token }} 30 | prettier: true 31 | auto_fix: true 32 | prettier_extensions: 'css,html,js,json,jsx,md,sass,scss,ts,tsx,vue,yaml,yml,sol' 33 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/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/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/uniswap-v3-core/contracts/test/MockTimeUniswapV3Pool.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity =0.7.6; 3 | 4 | import '../UniswapV3Pool.sol'; 5 | 6 | // used for testing time dependent behavior 7 | contract MockTimeUniswapV3Pool is UniswapV3Pool { 8 | // Monday, October 5, 2020 9:00:00 AM GMT-05:00 9 | uint256 public time = 1601906400; 10 | 11 | function setFeeGrowthGlobal0X128(uint256 _feeGrowthGlobal0X128) external { 12 | feeGrowthGlobal0X128 = _feeGrowthGlobal0X128; 13 | } 14 | 15 | function setFeeGrowthGlobal1X128(uint256 _feeGrowthGlobal1X128) external { 16 | feeGrowthGlobal1X128 = _feeGrowthGlobal1X128; 17 | } 18 | 19 | function advanceTime(uint256 by) external { 20 | time += by; 21 | } 22 | 23 | function _blockTimestamp() internal view override returns (uint32) { 24 | return uint32(time); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /src/main/traders/DexTraderBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.13; 3 | 4 | import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; 5 | 6 | abstract contract DexTraderBase is OwnableUpgradeable { 7 | error ZeroAmountPassed(); 8 | error ZeroAddressPassed(); 9 | 10 | modifier checkNonZero(uint256 _amount) { 11 | if (_amount == 0) revert ZeroAmountPassed(); 12 | _; 13 | } 14 | 15 | modifier checkNonZero2(uint256 _amount0, uint256 _amount1) { 16 | if (_amount0 == 0 || _amount1 == 0) revert ZeroAmountPassed(); 17 | _; 18 | } 19 | 20 | modifier checkNonZeroAddress(address _addr) { 21 | if (_addr == address(0)) revert ZeroAddressPassed(); 22 | _; 23 | } 24 | 25 | modifier checkNonZeroAddress2(address _addr0, address _addr1) { 26 | if (_addr0 == address(0) || _addr1 == address(0)) 27 | revert ZeroAddressPassed(); 28 | _; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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/openzeppelin-contracts-upgradeable/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/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/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/uniswap-v3-periphery/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-or-later 2 | pragma solidity >=0.5.0; 3 | 4 | import './INonfungiblePositionManager.sol'; 5 | 6 | /// @title Describes position NFT tokens via URI 7 | interface INonfungibleTokenPositionDescriptor { 8 | /// @notice Produces the URI describing a particular token ID for a position manager 9 | /// @dev Note this URI may be a data: URI with the JSON contents directly inlined 10 | /// @param positionManager The position manager for which to describe the token 11 | /// @param tokenId The ID of the token for which to produce a description, which may not be valid 12 | /// @return The URI of the ERC721-compliant metadata 13 | function tokenURI(INonfungiblePositionManager positionManager, uint256 tokenId) 14 | external 15 | view 16 | returns (string memory); 17 | } 18 | -------------------------------------------------------------------------------- /lib/openzeppelin-contracts-upgradeable/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 | --------------------------------------------------------------------------------