├── .commitlintrc.json ├── .github └── workflows │ ├── lint_pr.yml │ ├── pr.yml │ └── release.yml ├── .gitignore ├── .gitmodules ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .nvmrc ├── .prettierignore ├── .releaserc.json ├── .vscode ├── extensions.json └── settings.json ├── ContributionAgreement ├── LICENSE ├── README.md ├── contracts ├── adapters │ ├── AbstractAdapter.sol │ ├── LICENSE │ └── UniversalAdapter.sol ├── core │ ├── ACL.sol │ ├── ACLNonReentrantTrait.sol │ ├── ACLTrait.sol │ ├── AccountFactory.sol │ ├── AddressProvider.sol │ ├── ContractsRegister.sol │ ├── DataCompressor.sol │ ├── WETHGateway.sol │ └── access │ │ └── Claimable.sol ├── credit │ ├── CreditAccount.sol │ ├── CreditConfigurator.sol │ ├── CreditFacade.sol │ └── CreditManager.sol ├── factories │ ├── CreditManagerFactoryBase.sol │ ├── GenesisFactory.sol │ └── PoolFactory.sol ├── interfaces │ ├── IACL.sol │ ├── IAccountFactory.sol │ ├── IAddressProvider.sol │ ├── IAirdropDistributor.sol │ ├── IBlacklistHelper.sol │ ├── IContractsRegister.sol │ ├── ICreditAccount.sol │ ├── ICreditConfigurator.sol │ ├── ICreditFacade.sol │ ├── ICreditManagerV2.sol │ ├── IDataCompressor.sol │ ├── IDegenDistributor.sol │ ├── IDegenNFT.sol │ ├── IDieselToken.sol │ ├── IErrors.sol │ ├── IGearToken.sol │ ├── IInterestRateModel.sol │ ├── ILPPriceFeed.sol │ ├── IMerkleDistributor.sol │ ├── IPausable.sol │ ├── IPhantomERC20.sol │ ├── IPoolService.sol │ ├── IPriceFeedAddress.sol │ ├── IPriceFeedType.sol │ ├── IPriceOracle.sol │ ├── IVersion.sol │ ├── IWETHGateway.sol │ ├── LICENSE │ ├── V1 │ │ ├── ICreditFilter.sol │ │ ├── ICreditManager.sol │ │ └── IPriceOracle.sol │ ├── adapters │ │ ├── IAdapter.sol │ │ └── IUniversalAdapter.sol │ └── external │ │ └── IWETH.sol ├── libraries │ ├── AddressList.sol │ ├── Balances.sol │ ├── Constants.sol │ ├── Errors.sol │ ├── LICENSE AGPL 3.0 │ ├── LICENSE GPL 2.0 │ ├── MultiCall.sol │ ├── PercentageMath.sol │ └── Types.sol ├── multicall │ └── CreditFacadeCalls.sol ├── oracles │ ├── BoundedPriceFeed.sol │ ├── CompositePriceFeed.sol │ ├── LPPriceFeed.sol │ ├── PriceFeedChecker.sol │ ├── PriceOracle.sol │ └── ZeroPriceFeed.sol ├── pool │ ├── LinearInterestRateModel.sol │ └── PoolService.sol ├── support │ ├── BlacklistHelper.sol │ ├── ContractUpgrader.sol │ └── PauseMulticall.sol ├── test │ ├── adapters │ │ ├── AbstractAdapter.t.sol │ │ └── UniversalAdapter.t.sol │ ├── config │ │ ├── CreditConfig.sol │ │ ├── Tokens.sol │ │ └── TokensData.sol │ ├── core │ │ ├── ACL.t.sol │ │ └── AddressProvider.t.sol │ ├── credit │ │ ├── CreditConfigurator.t.sol │ │ ├── CreditFacade.t.sol │ │ ├── CreditFacadeGas.t.sol │ │ └── CreditManager.t.sol │ ├── helpers │ │ ├── BalanceEngine.sol │ │ ├── BalanceHelper.sol │ │ ├── CreditFacadeTestEngine.sol │ │ └── CreditFacadeTestHelper.sol │ ├── interfaces │ │ ├── ICreditConfig.sol │ │ └── ITokenTestSuite.sol │ ├── lib │ │ ├── MathUtil.sol │ │ ├── ParseLib.sol │ │ ├── StringUtils.sol │ │ ├── cheatCodes.sol │ │ ├── constants.sol │ │ ├── stdStorage.sol │ │ └── test.sol │ ├── mocks │ │ ├── adapters │ │ │ ├── AdapterMock.sol │ │ │ └── TargetContractMock.sol │ │ ├── core │ │ │ ├── ACLTraitTest.sol │ │ │ └── AddressProviderACLMock.sol │ │ ├── credit │ │ │ └── CreditManagerTestInternal.sol │ │ ├── dao │ │ │ └── TreasuryMock.sol │ │ ├── oracles │ │ │ ├── LPPriceFeedMock.sol │ │ │ └── PriceFeedMock.sol │ │ ├── pool │ │ │ ├── CreditManagerMockForPoolTest.sol │ │ │ ├── PoolServiceMock.sol │ │ │ └── TestPoolService.sol │ │ └── token │ │ │ ├── ERC20ApproveRestricted.sol │ │ │ ├── ERC20Blacklistable.sol │ │ │ ├── ERC20Blocking.sol │ │ │ ├── ERC20Fee.sol │ │ │ ├── ERC20Mock.sol │ │ │ ├── ERC20NonCompliant.sol │ │ │ ├── ERC721ReceiverMock.sol │ │ │ └── WETHMock.sol │ ├── oracles │ │ ├── BoundedPriceFeed.t.sol │ │ ├── CompositePriceFeed.t.sol │ │ ├── LPPriceFeed.t.sol │ │ ├── PriceOracle.t.sol │ │ └── ZeroPriceFeed.t.sol │ ├── pool │ │ └── PoolService.t.sol │ ├── suites │ │ ├── CreditFacadeTestSuite.sol │ │ ├── CreditManagerTestSuite.sol │ │ ├── PoolDeployer.sol │ │ ├── PoolServiceTestSuite.sol │ │ ├── TokensTestSuite.sol │ │ └── TokensTestSuiteHelper.sol │ ├── support │ │ ├── BlacklistHelper.t.sol │ │ └── PauseMulticall.t.sol │ └── tokens │ │ └── DegenNFT.t.sol └── tokens │ ├── DegenNFT.sol │ ├── DieselToken.sol │ ├── GearToken.sol │ ├── LICENSE │ └── PhantomERC20.sol ├── foundry.toml ├── package.json ├── remappings.txt ├── scripts ├── abigen.sh └── trimport.sh ├── tsconfig.build.json ├── tsconfig.json ├── types ├── ACL.ts ├── ACLNonReentrantTrait.ts ├── ACLTrait.ts ├── ACLTraitTest.ts ├── AbstractAdapter.ts ├── AccountFactory.ts ├── AddressProvider.ts ├── AggregatorInterface.ts ├── AggregatorV2V3Interface.ts ├── AggregatorV3Interface.ts ├── BalanceEngine.ts ├── BalanceHelper.ts ├── Balances.sol │ ├── BalanceOps.ts │ └── index.ts ├── BlacklistHelper.sol │ ├── BlacklistHelper.ts │ ├── IBlacklistableUSDC.ts │ ├── IBlacklistableUSDT.ts │ └── index.ts ├── BoundedPriceFeed.sol │ ├── BoundedPriceFeed.ts │ ├── ChainlinkReadableAggregator.ts │ └── index.ts ├── Claimable.ts ├── CompositePriceFeed.ts ├── Constants.sol │ ├── Roles.ts │ └── index.ts ├── ContractUpgrader.ts ├── ContractsRegister.ts ├── CreditAccount.ts ├── CreditConfig.ts ├── CreditConfigurator.ts ├── CreditFacade.ts ├── CreditFacadeTestEngine.ts ├── CreditFacadeTestHelper.ts ├── CreditFacadeTestSuite.ts ├── CreditManager.ts ├── CreditManagerFactoryBase.ts ├── CreditManagerMockForPoolTest.ts ├── CreditManagerTestInternal.ts ├── CreditManagerTestSuite.ts ├── DataCompressor.ts ├── DegenNFT.ts ├── DieselToken.ts ├── ERC165.ts ├── ERC20.ts ├── ERC20ApproveRestricted.sol │ ├── ERC20ApproveRestrictedFalse.ts │ ├── ERC20ApproveRestrictedRevert.ts │ └── index.ts ├── ERC20Blacklistable.sol │ ├── ERC20BlacklistableMock.ts │ └── index.ts ├── ERC20Blocking.sol │ ├── ERC20BlockingMock.ts │ └── index.ts ├── ERC20Fee.sol │ ├── TokenFeeMock.ts │ └── index.ts ├── ERC20NonCompliant.sol │ ├── NonCompliantERC20.ts │ └── index.ts ├── ERC721.ts ├── Errors.ts ├── GearToken.ts ├── GenesisFactory.ts ├── IACL.sol │ ├── IACL.ts │ ├── IACLEvents.ts │ ├── IACLExceptions.ts │ └── index.ts ├── IAccountFactory.sol │ ├── IAccountFactory.ts │ ├── IAccountFactoryEvents.ts │ ├── IAccountFactoryGetters.ts │ └── index.ts ├── IAdapter.sol │ ├── IAdapter.ts │ ├── IAdapterExceptions.ts │ └── index.ts ├── IAddressProvider.sol │ ├── IAddressProvider.ts │ ├── IAddressProviderEvents.ts │ └── index.ts ├── IAirdropDistributor.sol │ ├── IAirdropDistributor.ts │ ├── IAirdropDistributorEvents.ts │ └── index.ts ├── IBlacklistHelper.sol │ ├── IBlacklistHelper.ts │ ├── IBlacklistHelperEvents.ts │ ├── IBlacklistHelperExceptions.ts │ └── index.ts ├── IContractsRegister.sol │ ├── IContractsRegister.ts │ ├── IContractsRegisterEvents.ts │ └── index.ts ├── ICreditAccount.sol │ ├── ICrediAccountExceptions.ts │ ├── ICreditAccount.ts │ └── index.ts ├── ICreditConfig.ts ├── ICreditConfigurator.sol │ ├── ICreditConfigurator.ts │ ├── ICreditConfiguratorEvents.ts │ ├── ICreditConfiguratorExceptions.ts │ └── index.ts ├── ICreditFacade.sol │ ├── ICreditFacade.ts │ ├── ICreditFacadeEvents.ts │ ├── ICreditFacadeExceptions.ts │ ├── ICreditFacadeExtended.ts │ ├── ICreditFacadeV2.ts │ └── index.ts ├── ICreditFilter.ts ├── ICreditManager.ts ├── ICreditManagerV2.sol │ ├── ICreditManagerV2.ts │ ├── ICreditManagerV2Events.ts │ ├── ICreditManagerV2Exceptions.ts │ └── index.ts ├── IDataCompressor.sol │ ├── IDataCompressor.ts │ ├── IDataCompressorExceptions.ts │ └── index.ts ├── IDegenDistributor.sol │ ├── IDegenDistributor.ts │ ├── IDegenDistributorEvents.ts │ └── index.ts ├── IDegenNFT.sol │ ├── IDegenNFT.ts │ ├── IDegenNFTEvents.ts │ ├── IDegenNFTExceptions.ts │ └── index.ts ├── IDieselToken.sol │ ├── IDieselToken.ts │ ├── IDieselTokenExceptions.ts │ └── index.ts ├── IERC165.ts ├── IERC20.ts ├── IERC20Metadata.ts ├── IERC721.ts ├── IERC721Metadata.ts ├── IERC721Receiver.ts ├── IGearToken.ts ├── IInterestRateModel.ts ├── ILPPriceFeed.sol │ ├── ILPPriceFeed.ts │ ├── ILPPriceFeedEvents.ts │ ├── ILPPriceFeedExceptions.ts │ └── index.ts ├── IMerkleDistributor.ts ├── IPausable.ts ├── IPhantomERC20.ts ├── IPoolService.sol │ ├── IPoolService.ts │ ├── IPoolServiceEvents.ts │ └── index.ts ├── IPriceFeedAddress.ts ├── IPriceFeedType.ts ├── IPriceOracle.sol │ ├── IPriceOracle.ts │ ├── IPriceOracleV2.ts │ ├── IPriceOracleV2Events.ts │ ├── IPriceOracleV2Exceptions.ts │ ├── IPriceOracleV2Ext.ts │ └── index.ts ├── ITokenTestSuite.ts ├── IUniversalAdapter.ts ├── IVersion.ts ├── IWETH.ts ├── IWETHGateway.ts ├── Initializable.ts ├── LPPriceFeed.ts ├── LinearInterestRateModel.ts ├── Ownable.ts ├── Pausable.ts ├── PauseMulticall.ts ├── PhantomERC20.ts ├── PoolDeployer.ts ├── PoolFactory.ts ├── PoolService.ts ├── PoolServiceTestSuite.ts ├── PriceFeedChecker.ts ├── PriceOracle.ts ├── StdStorage.ts ├── TestPoolService.ts ├── TokensTestSuite.ts ├── TokensTestSuiteHelper.ts ├── UniversalAdapter.ts ├── WETHGateway.ts ├── ZeroPriceFeed.ts ├── cheatCodes.sol │ ├── CheatCodes.ts │ └── index.ts ├── common.ts ├── draft-IERC20Permit.sol │ ├── IERC20Permit.ts │ └── index.ts ├── factories │ ├── ACLNonReentrantTrait__factory.ts │ ├── ACLTraitTest__factory.ts │ ├── ACLTrait__factory.ts │ ├── ACL__factory.ts │ ├── AbstractAdapter__factory.ts │ ├── AccountFactory__factory.ts │ ├── AddressProvider__factory.ts │ ├── AggregatorInterface__factory.ts │ ├── AggregatorV2V3Interface__factory.ts │ ├── AggregatorV3Interface__factory.ts │ ├── BalanceEngine__factory.ts │ ├── BalanceHelper__factory.ts │ ├── Balances.sol │ │ ├── BalanceOps__factory.ts │ │ └── index.ts │ ├── BlacklistHelper.sol │ │ ├── BlacklistHelper__factory.ts │ │ ├── IBlacklistableUSDC__factory.ts │ │ ├── IBlacklistableUSDT__factory.ts │ │ └── index.ts │ ├── BoundedPriceFeed.sol │ │ ├── BoundedPriceFeed__factory.ts │ │ ├── ChainlinkReadableAggregator__factory.ts │ │ └── index.ts │ ├── Claimable__factory.ts │ ├── CompositePriceFeed__factory.ts │ ├── Constants.sol │ │ ├── Roles__factory.ts │ │ └── index.ts │ ├── ContractUpgrader__factory.ts │ ├── ContractsRegister__factory.ts │ ├── CreditAccount__factory.ts │ ├── CreditConfig__factory.ts │ ├── CreditConfigurator__factory.ts │ ├── CreditFacadeTestEngine__factory.ts │ ├── CreditFacadeTestHelper__factory.ts │ ├── CreditFacadeTestSuite__factory.ts │ ├── CreditFacade__factory.ts │ ├── CreditManagerFactoryBase__factory.ts │ ├── CreditManagerMockForPoolTest__factory.ts │ ├── CreditManagerTestInternal__factory.ts │ ├── CreditManagerTestSuite__factory.ts │ ├── CreditManager__factory.ts │ ├── DataCompressor__factory.ts │ ├── DegenNFT__factory.ts │ ├── DieselToken__factory.ts │ ├── ERC165__factory.ts │ ├── ERC20ApproveRestricted.sol │ │ ├── ERC20ApproveRestrictedFalse__factory.ts │ │ ├── ERC20ApproveRestrictedRevert__factory.ts │ │ └── index.ts │ ├── ERC20Blacklistable.sol │ │ ├── ERC20BlacklistableMock__factory.ts │ │ └── index.ts │ ├── ERC20Blocking.sol │ │ ├── ERC20BlockingMock__factory.ts │ │ └── index.ts │ ├── ERC20Fee.sol │ │ ├── TokenFeeMock__factory.ts │ │ └── index.ts │ ├── ERC20NonCompliant.sol │ │ ├── NonCompliantERC20__factory.ts │ │ └── index.ts │ ├── ERC20__factory.ts │ ├── ERC721__factory.ts │ ├── Errors__factory.ts │ ├── GearToken__factory.ts │ ├── GenesisFactory__factory.ts │ ├── IACL.sol │ │ ├── IACLEvents__factory.ts │ │ ├── IACLExceptions__factory.ts │ │ ├── IACL__factory.ts │ │ └── index.ts │ ├── IAccountFactory.sol │ │ ├── IAccountFactoryEvents__factory.ts │ │ ├── IAccountFactoryGetters__factory.ts │ │ ├── IAccountFactory__factory.ts │ │ └── index.ts │ ├── IAdapter.sol │ │ ├── IAdapterExceptions__factory.ts │ │ ├── IAdapter__factory.ts │ │ └── index.ts │ ├── IAddressProvider.sol │ │ ├── IAddressProviderEvents__factory.ts │ │ ├── IAddressProvider__factory.ts │ │ └── index.ts │ ├── IAirdropDistributor.sol │ │ ├── IAirdropDistributorEvents__factory.ts │ │ ├── IAirdropDistributor__factory.ts │ │ └── index.ts │ ├── IBlacklistHelper.sol │ │ ├── IBlacklistHelperEvents__factory.ts │ │ ├── IBlacklistHelperExceptions__factory.ts │ │ ├── IBlacklistHelper__factory.ts │ │ └── index.ts │ ├── IContractsRegister.sol │ │ ├── IContractsRegisterEvents__factory.ts │ │ ├── IContractsRegister__factory.ts │ │ └── index.ts │ ├── ICreditAccount.sol │ │ ├── ICrediAccountExceptions__factory.ts │ │ ├── ICreditAccount__factory.ts │ │ └── index.ts │ ├── ICreditConfig__factory.ts │ ├── ICreditConfigurator.sol │ │ ├── ICreditConfiguratorEvents__factory.ts │ │ ├── ICreditConfiguratorExceptions__factory.ts │ │ ├── ICreditConfigurator__factory.ts │ │ └── index.ts │ ├── ICreditFacade.sol │ │ ├── ICreditFacadeEvents__factory.ts │ │ ├── ICreditFacadeExceptions__factory.ts │ │ ├── ICreditFacadeExtended__factory.ts │ │ ├── ICreditFacadeV2__factory.ts │ │ ├── ICreditFacade__factory.ts │ │ └── index.ts │ ├── ICreditFilter__factory.ts │ ├── ICreditManagerV2.sol │ │ ├── ICreditManagerV2Events__factory.ts │ │ ├── ICreditManagerV2Exceptions__factory.ts │ │ ├── ICreditManagerV2__factory.ts │ │ └── index.ts │ ├── ICreditManager__factory.ts │ ├── IDataCompressor.sol │ │ ├── IDataCompressorExceptions__factory.ts │ │ ├── IDataCompressor__factory.ts │ │ └── index.ts │ ├── IDegenDistributor.sol │ │ ├── IDegenDistributorEvents__factory.ts │ │ ├── IDegenDistributor__factory.ts │ │ └── index.ts │ ├── IDegenNFT.sol │ │ ├── IDegenNFTEvents__factory.ts │ │ ├── IDegenNFTExceptions__factory.ts │ │ ├── IDegenNFT__factory.ts │ │ └── index.ts │ ├── IDieselToken.sol │ │ ├── IDieselTokenExceptions__factory.ts │ │ ├── IDieselToken__factory.ts │ │ └── index.ts │ ├── IERC165__factory.ts │ ├── IERC20Metadata__factory.ts │ ├── IERC20__factory.ts │ ├── IERC721Metadata__factory.ts │ ├── IERC721Receiver__factory.ts │ ├── IERC721__factory.ts │ ├── IGearToken__factory.ts │ ├── IInterestRateModel__factory.ts │ ├── ILPPriceFeed.sol │ │ ├── ILPPriceFeedEvents__factory.ts │ │ ├── ILPPriceFeedExceptions__factory.ts │ │ ├── ILPPriceFeed__factory.ts │ │ └── index.ts │ ├── IMerkleDistributor__factory.ts │ ├── IPausable__factory.ts │ ├── IPhantomERC20__factory.ts │ ├── IPoolService.sol │ │ ├── IPoolServiceEvents__factory.ts │ │ ├── IPoolService__factory.ts │ │ └── index.ts │ ├── IPriceFeedAddress__factory.ts │ ├── IPriceFeedType__factory.ts │ ├── IPriceOracle.sol │ │ ├── IPriceOracleV2Events__factory.ts │ │ ├── IPriceOracleV2Exceptions__factory.ts │ │ ├── IPriceOracleV2Ext__factory.ts │ │ ├── IPriceOracleV2__factory.ts │ │ ├── IPriceOracle__factory.ts │ │ └── index.ts │ ├── ITokenTestSuite__factory.ts │ ├── IUniversalAdapter__factory.ts │ ├── IVersion__factory.ts │ ├── IWETHGateway__factory.ts │ ├── IWETH__factory.ts │ ├── Initializable__factory.ts │ ├── LPPriceFeed__factory.ts │ ├── LinearInterestRateModel__factory.ts │ ├── Ownable__factory.ts │ ├── Pausable__factory.ts │ ├── PauseMulticall__factory.ts │ ├── PhantomERC20__factory.ts │ ├── PoolDeployer__factory.ts │ ├── PoolFactory__factory.ts │ ├── PoolServiceTestSuite__factory.ts │ ├── PoolService__factory.ts │ ├── PriceFeedChecker__factory.ts │ ├── PriceOracle__factory.ts │ ├── StdStorage__factory.ts │ ├── TestPoolService__factory.ts │ ├── TokensTestSuiteHelper__factory.ts │ ├── TokensTestSuite__factory.ts │ ├── UniversalAdapter__factory.ts │ ├── WETHGateway__factory.ts │ ├── ZeroPriceFeed__factory.ts │ ├── cheatCodes.sol │ │ ├── CheatCodes__factory.ts │ │ └── index.ts │ ├── draft-IERC20Permit.sol │ │ ├── IERC20Permit__factory.ts │ │ └── index.ts │ └── index.ts └── index.ts └── yarn.lock /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"] 3 | } 4 | -------------------------------------------------------------------------------- /.github/workflows/lint_pr.yml: -------------------------------------------------------------------------------- 1 | name: "Lint PR" 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - reopened 8 | - edited 9 | - synchronize 10 | 11 | jobs: 12 | main: 13 | name: Validate PR title 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: amannn/action-semantic-pull-request@v4 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: Check PR 2 | 3 | on: 4 | pull_request: 5 | types: [opened, reopened, synchronize] 6 | 7 | env: 8 | HUSKY: 0 9 | CI: true 10 | 11 | jobs: 12 | checks: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v3 17 | 18 | - name: Setup node.js 19 | uses: actions/setup-node@v3 20 | with: 21 | cache: "yarn" 22 | node-version-file: ".nvmrc" 23 | 24 | - name: Install dependencies 25 | run: | 26 | yarn install --frozen-lockfile 27 | 28 | - name: Install Foundry 29 | uses: foundry-rs/foundry-toolchain@v1 30 | with: 31 | version: nightly 32 | 33 | - name: Run forge tests 34 | run: forge test 35 | 36 | - name: Perform checks 37 | run: | 38 | yarn prettier:ci 39 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | 8 | env: 9 | HUSKY: 0 10 | CI: true 11 | 12 | jobs: 13 | release: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - uses: actions/setup-node@v3 20 | with: 21 | cache: "yarn" 22 | node-version-file: ".nvmrc" 23 | 24 | # prepare script runs before publish, and it needs husky 25 | - name: Install dependencies 26 | run: | 27 | yarn install --frozen-lockfile 28 | 29 | - name: Install Foundry 30 | uses: foundry-rs/foundry-toolchain@v1 31 | with: 32 | version: nightly 33 | 34 | - name: Run forge build 35 | run: forge build 36 | timeout-minutes: 10 37 | 38 | - name: Generate typechain types 39 | run: | 40 | yarn types 41 | 42 | - name: Build lib 43 | run: | 44 | yarn build 45 | 46 | - name: Semantic Release 47 | uses: cycjimmy/semantic-release-action@v3 48 | env: 49 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 50 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .history/ 2 | .idea/ 3 | abi/ 4 | node_modules/ 5 | cache/ 6 | build/ 7 | typechain/ 8 | artifacts/ 9 | coverage* 10 | .env 11 | .verifier* 12 | .DS_Store 13 | /security/Peckshield.sol 14 | /security/ClickerAttackSolution.sol 15 | /security/TickerBombAttackSolution.sol 16 | /.env.local 17 | out/ 18 | forge-out/ 19 | .mainnet.test.cache 20 | *.log 21 | .eslintcache 22 | .eslint.local.json 23 | /lib -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | artifacts 3 | cache 4 | types 5 | forge-out 6 | lib -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "branches": ["main"], 3 | "plugins": [ 4 | "@semantic-release/commit-analyzer", 5 | "@semantic-release/release-notes-generator", 6 | "@semantic-release/npm", 7 | "@semantic-release/github" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "esbenp.prettier-vscode", 4 | "nomicfoundation.hardhat-solidity", 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[json]": { 3 | "editor.defaultFormatter": "esbenp.prettier-vscode" 4 | }, 5 | "[solidity]": { 6 | "editor.defaultFormatter": "esbenp.prettier-vscode" 7 | }, 8 | 9 | "editor.defaultFormatter": "esbenp.prettier-vscode", 10 | "editor.formatOnSave": true, 11 | "editor.tabSize": 2, 12 | "eslint.validate": ["javascript", "typescript"], 13 | "files.eol": "\n", 14 | "solidity.packageDefaultDependenciesContractsDirectory": "contracts", 15 | "solidity.packageDefaultDependenciesDirectory": "node_modules", 16 | "solidity.compileUsingRemoteVersion": "v0.8.10", 17 | "solidity.formatter": "prettier" 18 | } 19 | -------------------------------------------------------------------------------- /contracts/core/ACLTrait.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol"; 7 | import { AddressProvider } from "./AddressProvider.sol"; 8 | import { IACL } from "../interfaces/IACL.sol"; 9 | import { ZeroAddressException, CallerNotConfiguratorException, CallerNotPausableAdminException, CallerNotUnPausableAdminException } from "../interfaces/IErrors.sol"; 10 | 11 | /// @title ACL Trait 12 | /// @notice Utility class for ACL consumers 13 | abstract contract ACLTrait is Pausable { 14 | // ACL contract to check rights 15 | IACL public immutable _acl; 16 | 17 | /// @dev constructor 18 | /// @param addressProvider Address of address repository 19 | constructor(address addressProvider) { 20 | if (addressProvider == address(0)) revert ZeroAddressException(); // F:[AA-2] 21 | 22 | _acl = IACL(AddressProvider(addressProvider).getACL()); 23 | } 24 | 25 | /// @dev Reverts if msg.sender is not configurator 26 | modifier configuratorOnly() { 27 | if (!_acl.isConfigurator(msg.sender)) 28 | revert CallerNotConfiguratorException(); 29 | _; 30 | } 31 | 32 | ///@dev Pause contract 33 | function pause() external { 34 | if (!_acl.isPausableAdmin(msg.sender)) 35 | revert CallerNotPausableAdminException(); 36 | _pause(); 37 | } 38 | 39 | /// @dev Unpause contract 40 | function unpause() external { 41 | if (!_acl.isUnpausableAdmin(msg.sender)) 42 | revert CallerNotUnPausableAdminException(); 43 | 44 | _unpause(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /contracts/core/access/Claimable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 7 | 8 | /// @title Claimable 9 | /// @dev Implements logic for a two-step ownership transfer on top of Ownable 10 | contract Claimable is Ownable { 11 | /// @dev The new owner that has not claimed ownership yet 12 | address public pendingOwner; 13 | 14 | /// @dev A modifier that restricts the function to the pending owner only 15 | modifier onlyPendingOwner() { 16 | if (msg.sender != pendingOwner) { 17 | revert("Claimable: Sender is not pending owner"); 18 | } 19 | _; 20 | } 21 | 22 | /// @dev Sets pending owner to the new owner, but does not 23 | /// transfer ownership yet 24 | /// @param newOwner The address to become the future owner 25 | function transferOwnership(address newOwner) public override onlyOwner { 26 | require( 27 | newOwner != address(0), 28 | "Claimable: new owner is the zero address" 29 | ); 30 | pendingOwner = newOwner; 31 | } 32 | 33 | /// @dev Used by the pending owner to claim ownership after transferOwnership 34 | function claimOwnership() external onlyPendingOwner { 35 | _transferOwnership(pendingOwner); 36 | pendingOwner = address(0); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /contracts/factories/PoolFactory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way. 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | pragma abicoder v2; 6 | 7 | import { ContractsRegister } from "../core/ContractsRegister.sol"; 8 | 9 | import { LinearInterestRateModel } from "../pool/LinearInterestRateModel.sol"; 10 | import { PoolService } from "../pool/PoolService.sol"; 11 | 12 | import { ContractUpgrader } from "../support/ContractUpgrader.sol"; 13 | 14 | struct PoolOpts { 15 | address addressProvider; // address of addressProvider contract 16 | address underlying; // address of underlying token for pool and creditManager 17 | uint256 U_optimal; // linear interest model parameter 18 | uint256 R_base; // linear interest model parameter 19 | uint256 R_slope1; // linear interest model parameter 20 | uint256 R_slope2; // linear interest model parameter 21 | uint256 expectedLiquidityLimit; // linear interest model parameter 22 | uint256 withdrawFee; // withdrawFee 23 | } 24 | 25 | contract PoolFactory is ContractUpgrader { 26 | PoolService public immutable pool; 27 | uint256 public withdrawFee; 28 | 29 | constructor(PoolOpts memory opts) ContractUpgrader(opts.addressProvider) { 30 | LinearInterestRateModel linearModel = new LinearInterestRateModel( 31 | opts.U_optimal, 32 | opts.R_base, 33 | opts.R_slope1, 34 | opts.R_slope2 35 | ); // T:[PD-1] 36 | 37 | pool = new PoolService( 38 | opts.addressProvider, 39 | opts.underlying, 40 | address(linearModel), 41 | opts.expectedLiquidityLimit 42 | ); 43 | 44 | withdrawFee = opts.withdrawFee; 45 | } 46 | 47 | function _configure() internal override { 48 | ContractsRegister cr = ContractsRegister( 49 | addressProvider.getContractsRegister() 50 | ); 51 | 52 | pool.setWithdrawFee(withdrawFee); 53 | 54 | cr.addPool(address(pool)); // T:[PD-2] 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /contracts/interfaces/IACL.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IVersion } from "./IVersion.sol"; 6 | 7 | interface IACLExceptions { 8 | /// @dev Thrown when attempting to delete an address from a set that is not a pausable admin 9 | error AddressNotPausableAdminException(address addr); 10 | 11 | /// @dev Thrown when attempting to delete an address from a set that is not a unpausable admin 12 | error AddressNotUnpausableAdminException(address addr); 13 | } 14 | 15 | interface IACLEvents { 16 | /// @dev Emits when a new admin is added that can pause contracts 17 | event PausableAdminAdded(address indexed newAdmin); 18 | 19 | /// @dev Emits when a Pausable admin is removed 20 | event PausableAdminRemoved(address indexed admin); 21 | 22 | /// @dev Emits when a new admin is added that can unpause contracts 23 | event UnpausableAdminAdded(address indexed newAdmin); 24 | 25 | /// @dev Emits when an Unpausable admin is removed 26 | event UnpausableAdminRemoved(address indexed admin); 27 | } 28 | 29 | /// @title ACL interface 30 | interface IACL is IACLEvents, IACLExceptions, IVersion { 31 | /// @dev Returns true if the address is a pausable admin and false if not 32 | /// @param addr Address to check 33 | function isPausableAdmin(address addr) external view returns (bool); 34 | 35 | /// @dev Returns true if the address is unpausable admin and false if not 36 | /// @param addr Address to check 37 | function isUnpausableAdmin(address addr) external view returns (bool); 38 | 39 | /// @dev Returns true if an address has configurator rights 40 | /// @param account Address to check 41 | function isConfigurator(address account) external view returns (bool); 42 | 43 | /// @dev Returns address of configurator 44 | function owner() external view returns (address); 45 | } 46 | -------------------------------------------------------------------------------- /contracts/interfaces/IAddressProvider.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IVersion } from "./IVersion.sol"; 6 | 7 | interface IAddressProviderEvents { 8 | /// @dev Emits when an address is set for a contract role 9 | event AddressSet(bytes32 indexed service, address indexed newAddress); 10 | } 11 | 12 | /// @title Optimised for front-end Address Provider interface 13 | interface IAddressProvider is IAddressProviderEvents, IVersion { 14 | /// @return Address of ACL contract 15 | function getACL() external view returns (address); 16 | 17 | /// @return Address of ContractsRegister 18 | function getContractsRegister() external view returns (address); 19 | 20 | /// @return Address of AccountFactory 21 | function getAccountFactory() external view returns (address); 22 | 23 | /// @return Address of DataCompressor 24 | function getDataCompressor() external view returns (address); 25 | 26 | /// @return Address of GEAR token 27 | function getGearToken() external view returns (address); 28 | 29 | /// @return Address of WETH token 30 | function getWethToken() external view returns (address); 31 | 32 | /// @return Address of WETH Gateway 33 | function getWETHGateway() external view returns (address); 34 | 35 | /// @return Address of PriceOracle 36 | function getPriceOracle() external view returns (address); 37 | 38 | /// @return Address of DAO Treasury Multisig 39 | function getTreasuryContract() external view returns (address); 40 | 41 | /// @return Address of PathFinder 42 | function getLeveragedActions() external view returns (address); 43 | } 44 | -------------------------------------------------------------------------------- /contracts/interfaces/IAirdropDistributor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 5 | 6 | struct DistributionData { 7 | address account; 8 | uint8 campaignId; 9 | uint256 amount; 10 | } 11 | 12 | struct ClaimedData { 13 | address account; 14 | uint256 amount; 15 | } 16 | 17 | interface IAirdropDistributorEvents { 18 | /// @dev Emits when a user claims tokens 19 | event Claimed( 20 | address indexed account, 21 | uint256 amount, 22 | bool indexed historic 23 | ); 24 | 25 | /// @dev Emits when the owner replaces the merkle root 26 | event RootUpdated(bytes32 oldRoot, bytes32 indexed newRoot); 27 | 28 | /// @dev Emitted from a special function after updating the root to index allocations 29 | event TokenAllocated( 30 | address indexed account, 31 | uint8 indexed campaignId, 32 | uint256 amount 33 | ); 34 | } 35 | 36 | interface IAirdropDistributor is IAirdropDistributorEvents { 37 | /// @dev Returns the token distributed by this contract. 38 | function token() external view returns (IERC20); 39 | 40 | /// @dev Returns the current merkle root containing total claimable balances 41 | function merkleRoot() external view returns (bytes32); 42 | 43 | /// @dev Returns the total amount of token claimed by the user 44 | function claimed(address user) external view returns (uint256); 45 | 46 | // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. 47 | /// @dev Claims the given amount of the token for the account. Reverts if the inputs are not a leaf in the tree 48 | /// or the total claimed amount for the account is more than the leaf amount. 49 | function claim( 50 | uint256 index, 51 | address account, 52 | uint256 totalAmount, 53 | bytes32[] calldata merkleProof 54 | ) external; 55 | } 56 | -------------------------------------------------------------------------------- /contracts/interfaces/IContractsRegister.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IVersion } from "./IVersion.sol"; 6 | 7 | interface IContractsRegisterEvents { 8 | /// @dev Emits when a new pool is registered in the system 9 | event NewPoolAdded(address indexed pool); 10 | 11 | /// @dev Emits when a new Credit Manager is registered in the system 12 | event NewCreditManagerAdded(address indexed creditManager); 13 | } 14 | 15 | interface IContractsRegister is IContractsRegisterEvents, IVersion { 16 | // 17 | // POOLS 18 | // 19 | 20 | /// @dev Returns the array of registered pools 21 | function getPools() external view returns (address[] memory); 22 | 23 | /// @dev Returns a pool address from the list under the passed index 24 | /// @param i Index of the pool to retrieve 25 | function pools(uint256 i) external returns (address); 26 | 27 | /// @return Returns the number of registered pools 28 | function getPoolsCount() external view returns (uint256); 29 | 30 | /// @dev Returns true if the passed address is a pool 31 | function isPool(address) external view returns (bool); 32 | 33 | // 34 | // CREDIT MANAGERS 35 | // 36 | 37 | /// @dev Returns the array of registered Credit Managers 38 | function getCreditManagers() external view returns (address[] memory); 39 | 40 | /// @dev Returns a Credit Manager's address from the list under the passed index 41 | /// @param i Index of the Credit Manager to retrieve 42 | function creditManagers(uint256 i) external returns (address); 43 | 44 | /// @return Returns the number of registered Credit Managers 45 | function getCreditManagersCount() external view returns (uint256); 46 | 47 | /// @dev Returns true if the passed address is a Credit Manager 48 | function isCreditManager(address) external view returns (bool); 49 | } 50 | -------------------------------------------------------------------------------- /contracts/interfaces/IDegenDistributor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0; 3 | 4 | import { IDegenNFT } from "./IDegenNFT.sol"; 5 | 6 | interface IDegenDistributorEvents { 7 | /// @dev Emits when a user claims tokens 8 | event Claimed(address indexed account, uint256 amount); 9 | 10 | /// @dev Emits when the owner replaces the merkle root 11 | event RootUpdated(bytes32 oldRoot, bytes32 indexed newRoot); 12 | } 13 | 14 | interface IDegenDistributor is IDegenDistributorEvents { 15 | // Returns the address of the token distributed by this contract. 16 | function degenNFT() external view returns (IDegenNFT); 17 | 18 | // Returns the merkle root of the merkle tree containing account balances available to claim. 19 | function merkleRoot() external view returns (bytes32); 20 | 21 | /// @dev Returns the total amount of token claimed by the user 22 | function claimed(address user) external view returns (uint256); 23 | 24 | // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. 25 | /// @dev Claims the remaining unclaimed amount of the token for the account. Reverts if the inputs are not a leaf in the tree 26 | /// or the total claimed amount for the account is more than the leaf amount. 27 | function claim( 28 | uint256 index, 29 | address account, 30 | uint256 totalAmount, 31 | bytes32[] calldata merkleProof 32 | ) external; 33 | } 34 | -------------------------------------------------------------------------------- /contracts/interfaces/IDegenNFT.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IVersion } from "./IVersion.sol"; 6 | import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; 7 | 8 | interface IDegenNFTExceptions { 9 | /// @dev Thrown if an access-restricted function was called by non-CreditFacade 10 | error CreditFacadeOrConfiguratorOnlyException(); 11 | 12 | /// @dev Thrown if an access-restricted function was called by non-minter 13 | error MinterOnlyException(); 14 | 15 | /// @dev Thrown if trying to add a burner address that is not a correct Credit Facade 16 | error InvalidCreditFacadeException(); 17 | 18 | /// @dev Thrown if the account's balance is not sufficient for an action (usually a burn) 19 | error InsufficientBalanceException(); 20 | } 21 | 22 | interface IDegenNFTEvents { 23 | /// @dev Minted when new minter set 24 | event NewMinterSet(address indexed); 25 | 26 | /// @dev Minted each time when new credit facade added 27 | event NewCreditFacadeAdded(address indexed); 28 | 29 | /// @dev Minted each time when new credit facade added 30 | event NewCreditFacadeRemoved(address indexed); 31 | } 32 | 33 | interface IDegenNFT is 34 | IDegenNFTExceptions, 35 | IDegenNFTEvents, 36 | IVersion, 37 | IERC721Metadata 38 | { 39 | /// @dev address of the current minter 40 | function minter() external view returns (address); 41 | 42 | /// @dev Stores the total number of tokens on holder accounts 43 | function totalSupply() external view returns (uint256); 44 | 45 | /// @dev Stores the base URI for NFT metadata 46 | function baseURI() external view returns (string memory); 47 | 48 | /// @dev Mints a specified amount of tokens to the address 49 | /// @param to Address the tokens are minted to 50 | /// @param amount The number of tokens to mint 51 | function mint(address to, uint256 amount) external; 52 | 53 | /// @dev Burns a number of tokens from a specified address 54 | /// @param from The address a token will be burnt from 55 | /// @param amount The number of tokens to burn 56 | function burn(address from, uint256 amount) external; 57 | } 58 | -------------------------------------------------------------------------------- /contracts/interfaces/IDieselToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 6 | 7 | interface IDieselTokenExceptions { 8 | /// @dev Thrown if an access-restricted function was called by non-PoolService 9 | error PoolServiceOnlyException(); 10 | } 11 | 12 | interface IDieselToken is IERC20, IDieselTokenExceptions { 13 | /// @dev Returns the address of the pool this Diesel token belongs to 14 | function poolService() external view returns (address); 15 | } 16 | -------------------------------------------------------------------------------- /contracts/interfaces/IErrors.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /// @dev Common contract exceptions 7 | 8 | /// @dev Thrown on attempting to set an important address to zero address 9 | error ZeroAddressException(); 10 | 11 | /// @dev Thrown on attempting to call a non-implemented function 12 | error NotImplementedException(); 13 | 14 | /// @dev Thrown on attempting to set an EOA as an important contract in the system 15 | error AddressIsNotContractException(address); 16 | 17 | /// @dev Thrown on attempting to use a non-ERC20 contract or an EOA as a token 18 | error IncorrectTokenContractException(); 19 | 20 | /// @dev Thrown on attempting to set a token price feed to an address that is not a 21 | /// correct price feed 22 | error IncorrectPriceFeedException(); 23 | 24 | /// @dev Thrown on attempting to call an access restricted function as a non-Configurator 25 | error CallerNotConfiguratorException(); 26 | 27 | /// @dev Thrown on attempting to call an access restricted function as a non-Configurator 28 | error CallerNotControllerException(); 29 | 30 | /// @dev Thrown on attempting to pause a contract as a non-Pausable admin 31 | error CallerNotPausableAdminException(); 32 | 33 | /// @dev Thrown on attempting to pause a contract as a non-Unpausable admin 34 | error CallerNotUnPausableAdminException(); 35 | -------------------------------------------------------------------------------- /contracts/interfaces/IInterestRateModel.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IVersion } from "./IVersion.sol"; 6 | 7 | interface IInterestRateModel is IVersion { 8 | /// @dev Returns the borrow rate calculated based on expectedLiquidity and availableLiquidity 9 | /// @param expectedLiquidity Expected liquidity in the pool 10 | /// @param availableLiquidity Available liquidity in the pool 11 | /// @notice In RAY format 12 | function calcBorrowRate( 13 | uint256 expectedLiquidity, 14 | uint256 availableLiquidity 15 | ) external view returns (uint256); 16 | } 17 | -------------------------------------------------------------------------------- /contracts/interfaces/ILPPriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; 7 | import { IPriceFeedType } from "./IPriceFeedType.sol"; 8 | 9 | interface ILPPriceFeedEvents { 10 | /// @dev Emits on updating the virtual price bounds 11 | event NewLimiterParams(uint256 lowerBound, uint256 upperBound); 12 | } 13 | 14 | interface ILPPriceFeedExceptions { 15 | /// @dev Thrown on returning a value that violates the current bounds 16 | error ValueOutOfRangeException(); 17 | 18 | /// @dev Thrown on failing sanity checks when setting new bounds 19 | error IncorrectLimitsException(); 20 | } 21 | 22 | /// @title Interface for LP PriceFeeds with limiter 23 | interface ILPPriceFeed is 24 | AggregatorV3Interface, 25 | IPriceFeedType, 26 | ILPPriceFeedEvents, 27 | ILPPriceFeedExceptions 28 | { 29 | /// @dev Sets the lower and upper bounds for virtual price. 30 | /// @param _lowerBound The new lower bound 31 | /// @notice The upper bound is computed automatically 32 | function setLimiter(uint256 _lowerBound) external; 33 | 34 | /// @dev Returns the lower bound 35 | function lowerBound() external view returns (uint256); 36 | 37 | /// @dev Returns the upper bound 38 | function upperBound() external view returns (uint256); 39 | 40 | /// @dev Returns the pre-defined window between the lower and upper bounds 41 | /// @notice In bp format 42 | function delta() external view returns (uint256); 43 | } 44 | -------------------------------------------------------------------------------- /contracts/interfaces/IMerkleDistributor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.5.0; 3 | 4 | // Allows anyone to claim a token if they exist in a merkle root. 5 | interface IMerkleDistributor { 6 | // Returns the address of the token distributed by this contract. 7 | function token() external view returns (address); 8 | 9 | // Returns the merkle root of the merkle tree containing account balances available to claim. 10 | function merkleRoot() external view returns (bytes32); 11 | 12 | // Returns true if the index has been marked claimed. 13 | function isClaimed(uint256 index) external view returns (bool); 14 | 15 | // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. 16 | function claim( 17 | uint256 index, 18 | address account, 19 | uint256 amount, 20 | bytes32[] calldata merkleProof 21 | ) external; 22 | 23 | // This event is triggered whenever a call to #claim succeeds. 24 | event Claimed(uint256 index, address account, uint256 amount); 25 | } 26 | -------------------------------------------------------------------------------- /contracts/interfaces/IPausable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | interface IPausable { 7 | function pause() external; 8 | } 9 | -------------------------------------------------------------------------------- /contracts/interfaces/IPhantomERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; 6 | 7 | /// @title IPhantomERC20 8 | /// @dev Phantom tokens track balances in pools / contracts 9 | /// that do not mint an LP or a share token. Non-transferrabl. 10 | interface IPhantomERC20 is IERC20Metadata { 11 | /// @dev Returns the address of the token that is staked into the tracked position 12 | function underlying() external view returns (address); 13 | } 14 | -------------------------------------------------------------------------------- /contracts/interfaces/IPriceFeedAddress.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface IPriceFeedAddress { 5 | /// @dev Returns the number of decimals in the price feed's returned result 6 | function decimals() external view returns (uint8); 7 | 8 | /// @dev Returns the price feed descriptiom 9 | function description() external view returns (string memory); 10 | 11 | /// @dev Returns the price feed version 12 | function version() external view returns (uint256); 13 | 14 | /// @dev Returns the latest price feed value 15 | /// @notice Return type is according to Chainlink spec 16 | function latestRoundData(address creditAccount) 17 | external 18 | view 19 | returns ( 20 | uint80 roundId, 21 | int256 answer, 22 | uint256 startedAt, 23 | uint256 updatedAt, 24 | uint80 answeredInRound 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /contracts/interfaces/IPriceFeedType.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import { PriceFeedType } from "@gearbox-protocol/integration-types/contracts/PriceFeedType.sol"; 5 | 6 | interface IPriceFeedType { 7 | /// @dev Returns the price feed type 8 | function priceFeedType() external view returns (PriceFeedType); 9 | 10 | /// @dev Returns whether sanity checks on price feed result should be skipped 11 | function skipPriceCheck() external view returns (bool); 12 | } 13 | -------------------------------------------------------------------------------- /contracts/interfaces/IVersion.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /// @title IVersion 7 | /// @dev Declares a version function which returns the contract's version 8 | interface IVersion { 9 | /// @dev Returns contract version 10 | function version() external view returns (uint256); 11 | } 12 | -------------------------------------------------------------------------------- /contracts/interfaces/IWETHGateway.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | interface IWETHGateway { 7 | /// @dev Converts ETH to WETH and add liqudity to the pool 8 | /// @param pool Address of PoolService contract to add liquidity to. This pool must have WETH as an underlying. 9 | /// @param onBehalfOf The address that will receive the diesel token. 10 | /// @param referralCode Code used to log the transaction facilitator, for potential rewards. 0 if non-applicable. 11 | function addLiquidityETH( 12 | address pool, 13 | address onBehalfOf, 14 | uint16 referralCode 15 | ) external payable; 16 | 17 | /// @dev Removes liquidity from the pool and converts WETH to ETH 18 | /// - burns lp's diesel (LP) tokens 19 | /// - unwraps WETH to ETH and sends to the LP 20 | /// @param pool Address of PoolService contract to withdraw liquidity from. This pool must have WETH as an underlying. 21 | /// @param amount Amount of Diesel tokens to send. 22 | /// @param to Address to transfer ETH to. 23 | function removeLiquidityETH( 24 | address pool, 25 | uint256 amount, 26 | address payable to 27 | ) external; 28 | 29 | /// @dev Converts WETH to ETH, and sends to the passed address 30 | /// @param to Address to send ETH to 31 | /// @param amount Amount of WETH to unwrap 32 | function unwrapWETH(address to, uint256 amount) external; 33 | } 34 | -------------------------------------------------------------------------------- /contracts/interfaces/LICENSE: -------------------------------------------------------------------------------- 1 | (c) Gearbox Holdings, 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /contracts/interfaces/V1/IPriceOracle.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | pragma abicoder v1; 6 | 7 | /// @title Price oracle interface 8 | interface IPriceOracle { 9 | // Emits each time new configurator is set up 10 | event NewPriceFeed(address indexed token, address indexed priceFeed); 11 | 12 | /** 13 | * @dev Sets price feed if it doesn't exists 14 | * If pricefeed exists, it changes nothing 15 | * This logic is done to protect Gearbox from priceOracle attack 16 | * when potential attacker can get access to price oracle, change them to fraud ones 17 | * and then liquidate all funds 18 | * @param token Address of token 19 | * @param priceFeedToken Address of chainlink price feed token => Eth 20 | */ 21 | function addPriceFeed(address token, address priceFeedToken) external; 22 | 23 | /** 24 | * @dev Converts one asset into another using rate. Reverts if price feed doesn't exist 25 | * 26 | * @param amount Amount to convert 27 | * @param tokenFrom Token address converts from 28 | * @param tokenTo Token address - converts to 29 | * @return Amount converted to tokenTo asset 30 | */ 31 | function convert( 32 | uint256 amount, 33 | address tokenFrom, 34 | address tokenTo 35 | ) external view returns (uint256); 36 | 37 | /** 38 | * @dev Gets token rate with 18 decimals. Reverts if priceFeed doesn't exist 39 | * 40 | * @param tokenFrom Converts from token address 41 | * @param tokenTo Converts to token address 42 | * @return Rate in WAD format 43 | */ 44 | function getLastPrice(address tokenFrom, address tokenTo) 45 | external 46 | view 47 | returns (uint256); 48 | } 49 | -------------------------------------------------------------------------------- /contracts/interfaces/adapters/IAdapter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { AdapterType } from "@gearbox-protocol/integration-types/contracts/AdapterType.sol"; 7 | 8 | import { IACL } from "../IACL.sol"; 9 | import { IAddressProvider } from "../IAddressProvider.sol"; 10 | import { ICreditManagerV2 } from "../ICreditManagerV2.sol"; 11 | 12 | interface IAdapterExceptions { 13 | /// @notice Thrown when adapter tries to use a token that's not a collateral token of the connected Credit Manager 14 | error TokenNotAllowedException(); 15 | 16 | /// @notice Thrown when caller of a `creditFacadeOnly` function is not the Credit Facade 17 | error CreditFacadeOnlyException(); 18 | 19 | /// @notice Thrown when caller of a `configuratorOnly` function is not configurator 20 | error CallerNotConfiguratorException(); 21 | } 22 | 23 | interface IAdapter is IAdapterExceptions { 24 | /// @notice Credit Manager the adapter is connected to 25 | function creditManager() external view returns (ICreditManagerV2); 26 | 27 | /// @notice Address of the contract the adapter is interacting with 28 | function targetContract() external view returns (address); 29 | 30 | /// @notice Address provider 31 | function addressProvider() external view returns (IAddressProvider); 32 | 33 | /// @notice ACL contract to check rights 34 | function _acl() external view returns (IACL); 35 | 36 | /// @notice Adapter type 37 | function _gearboxAdapterType() external pure returns (AdapterType); 38 | 39 | /// @notice Adapter version 40 | function _gearboxAdapterVersion() external pure returns (uint16); 41 | } 42 | -------------------------------------------------------------------------------- /contracts/interfaces/adapters/IUniversalAdapter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { IAdapter } from "./IAdapter.sol"; 7 | 8 | struct RevocationPair { 9 | address spender; 10 | address token; 11 | } 12 | 13 | /// @title Universal adapter interface 14 | /// @notice Implements the initial version of universal adapter, which handles allowance revocations 15 | interface IUniversalAdapter is IAdapter { 16 | /// @notice Revokes allowances for specified spender/token pairs 17 | /// @param revocations Spender/token pairs to revoke allowances for 18 | function revokeAdapterAllowances(RevocationPair[] calldata revocations) 19 | external; 20 | } 21 | -------------------------------------------------------------------------------- /contracts/interfaces/external/IWETH.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.7.4; 4 | 5 | interface IWETH { 6 | /// @dev Deposits native ETH into the contract and mints WETH 7 | function deposit() external payable; 8 | 9 | /// @dev Transfers WETH to another account 10 | function transfer(address to, uint256 value) external returns (bool); 11 | 12 | /// @dev Burns WETH from msg.sender and send back native ETH 13 | function withdraw(uint256) external; 14 | } 15 | -------------------------------------------------------------------------------- /contracts/libraries/AddressList.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.10; 3 | 4 | library AddressList { 5 | function includes(address[] memory array, address item) 6 | internal 7 | pure 8 | returns (bool) 9 | { 10 | uint256 len = array.length; 11 | 12 | for (uint256 i; i < len; ) { 13 | if (array[i] == item) return true; 14 | unchecked { 15 | ++i; 16 | } 17 | } 18 | 19 | return false; 20 | } 21 | 22 | function trim(address[] memory array) 23 | internal 24 | pure 25 | returns (address[] memory trimmed) 26 | { 27 | uint256 len = array.length; 28 | 29 | if (len == 0) return array; 30 | 31 | uint256 foundLen; 32 | while (array[foundLen] != address(0)) { 33 | unchecked { 34 | ++foundLen; 35 | if (foundLen == len) return array; 36 | } 37 | } 38 | 39 | if (foundLen > 0) return copy(array, foundLen); 40 | } 41 | 42 | function copy(address[] memory array, uint256 len) 43 | internal 44 | pure 45 | returns (address[] memory res) 46 | { 47 | res = new address[](len); 48 | for (uint256 i; i < len; ) { 49 | res[i] = array[i]; 50 | unchecked { 51 | ++i; 52 | } 53 | } 54 | } 55 | 56 | function concat(address[] memory calls1, address[] memory calls2) 57 | internal 58 | pure 59 | returns (address[] memory res) 60 | { 61 | uint256 len1 = calls1.length; 62 | uint256 lenTotal = len1 + calls2.length; 63 | 64 | if (lenTotal == len1) return calls1; 65 | 66 | res = new address[](lenTotal); 67 | 68 | for (uint256 i; i < lenTotal; ) { 69 | res[i] = (i < len1) ? calls1[i] : calls2[i - len1]; 70 | unchecked { 71 | ++i; 72 | } 73 | } 74 | } 75 | 76 | function append(address[] memory addrs, address newAddr) 77 | internal 78 | pure 79 | returns (address[] memory res) 80 | { 81 | address[] memory newAddrArray = new address[](1); 82 | newAddrArray[0] = newAddr; 83 | return concat(addrs, newAddrArray); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /contracts/libraries/Constants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | // Denominations 7 | 8 | uint256 constant WAD = 1e18; 9 | uint256 constant RAY = 1e27; 10 | uint16 constant PERCENTAGE_FACTOR = 1e4; //percentage plus two decimals 11 | 12 | // 25% of type(uint256).max 13 | uint256 constant ALLOWANCE_THRESHOLD = type(uint96).max >> 3; 14 | 15 | // FEE = 50% 16 | uint16 constant DEFAULT_FEE_INTEREST = 50_00; // 50% 17 | 18 | // LIQUIDATION_FEE 1.5% 19 | uint16 constant DEFAULT_FEE_LIQUIDATION = 1_50; // 1.5% 20 | 21 | // LIQUIDATION PREMIUM 4% 22 | uint16 constant DEFAULT_LIQUIDATION_PREMIUM = 4_00; // 4% 23 | 24 | // LIQUIDATION_FEE_EXPIRED 2% 25 | uint16 constant DEFAULT_FEE_LIQUIDATION_EXPIRED = 1_00; // 2% 26 | 27 | // LIQUIDATION PREMIUM EXPIRED 2% 28 | uint16 constant DEFAULT_LIQUIDATION_PREMIUM_EXPIRED = 2_00; // 2% 29 | 30 | // DEFAULT PROPORTION OF MAX BORROWED PER BLOCK TO MAX BORROWED PER ACCOUNT 31 | uint16 constant DEFAULT_LIMIT_PER_BLOCK_MULTIPLIER = 2; 32 | 33 | // Seconds in a year 34 | uint256 constant SECONDS_PER_YEAR = 365 days; 35 | uint256 constant SECONDS_PER_ONE_AND_HALF_YEAR = (SECONDS_PER_YEAR * 3) / 2; 36 | 37 | // OPERATIONS 38 | 39 | // Leverage decimals - 100 is equal to 2x leverage (100% * collateral amount + 100% * borrowed amount) 40 | uint8 constant LEVERAGE_DECIMALS = 100; 41 | 42 | // Maximum withdraw fee for pool in PERCENTAGE_FACTOR format 43 | uint8 constant MAX_WITHDRAW_FEE = 100; 44 | 45 | uint256 constant EXACT_INPUT = 1; 46 | uint256 constant EXACT_OUTPUT = 2; 47 | 48 | address constant UNIVERSAL_CONTRACT = 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC; 49 | -------------------------------------------------------------------------------- /contracts/libraries/PercentageMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: agpl-3.0 2 | pragma solidity ^0.8.10; 3 | 4 | import { Errors } from "./Errors.sol"; 5 | import { PERCENTAGE_FACTOR } from "./Constants.sol"; 6 | 7 | uint256 constant HALF_PERCENT = PERCENTAGE_FACTOR / 2; 8 | 9 | /** 10 | * @title PercentageMath library 11 | * @author Aave 12 | * @notice Provides functions to perform percentage calculations 13 | * @dev Percentages are defined by default with 2 decimals of precision (100.00). The precision is indicated by PERCENTAGE_FACTOR 14 | * @dev Operations are rounded half up 15 | **/ 16 | 17 | library PercentageMath { 18 | /** 19 | * @dev Executes a percentage multiplication 20 | * @param value The value of which the percentage needs to be calculated 21 | * @param percentage The percentage of the value to be calculated 22 | * @return The percentage of value 23 | **/ 24 | function percentMul(uint256 value, uint256 percentage) 25 | internal 26 | pure 27 | returns (uint256) 28 | { 29 | if (value == 0 || percentage == 0) { 30 | return 0; // T:[PM-1] 31 | } 32 | 33 | // require( 34 | // value <= (type(uint256).max - HALF_PERCENT) / percentage, 35 | // Errors.MATH_MULTIPLICATION_OVERFLOW 36 | // ); // T:[PM-1] 37 | 38 | return (value * percentage + HALF_PERCENT) / PERCENTAGE_FACTOR; // T:[PM-1] 39 | } 40 | 41 | /** 42 | * @dev Executes a percentage division 43 | * @param value The value of which the percentage needs to be calculated 44 | * @param percentage The percentage of the value to be calculated 45 | * @return The value divided the percentage 46 | **/ 47 | function percentDiv(uint256 value, uint256 percentage) 48 | internal 49 | pure 50 | returns (uint256) 51 | { 52 | require(percentage != 0, Errors.MATH_DIVISION_BY_ZERO); // T:[PM-2] 53 | uint256 halfPercentage = percentage / 2; // T:[PM-2] 54 | 55 | // require( 56 | // value <= (type(uint256).max - halfPercentage) / PERCENTAGE_FACTOR, 57 | // Errors.MATH_MULTIPLICATION_OVERFLOW 58 | // ); // T:[PM-2] 59 | 60 | return (value * PERCENTAGE_FACTOR + halfPercentage) / percentage; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /contracts/oracles/PriceFeedChecker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { IPriceOracleV2Exceptions } from "../interfaces/IPriceOracle.sol"; 7 | 8 | /// @title Sanity checker for Chainlink price feed results 9 | contract PriceFeedChecker is IPriceOracleV2Exceptions { 10 | function _checkAnswer( 11 | uint80 roundID, 12 | int256 price, 13 | uint256 updatedAt, 14 | uint80 answeredInRound 15 | ) internal pure { 16 | if (price <= 0) revert ZeroPriceException(); // F:[PO-5] 17 | if (answeredInRound < roundID || updatedAt == 0) 18 | revert ChainPriceStaleException(); // F:[PO-5] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /contracts/oracles/ZeroPriceFeed.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; 7 | import { IPriceFeedType, PriceFeedType } from "../interfaces/IPriceFeedType.sol"; 8 | 9 | // EXCEPTIONS 10 | import { NotImplementedException } from "../interfaces/IErrors.sol"; 11 | 12 | /// @title Pricefeed which always returns 0 13 | /// @notice Used for collateral tokens that do not have a valid USD price feed 14 | contract ZeroPriceFeed is AggregatorV3Interface, IPriceFeedType { 15 | string public constant override description = "Zero pricefeed"; // F:[ZPF-1] 16 | 17 | uint8 public constant override decimals = 8; // F:[ZPF-1] 18 | 19 | uint256 public constant override version = 1; 20 | 21 | PriceFeedType public constant override priceFeedType = 22 | PriceFeedType.ZERO_ORACLE; 23 | 24 | bool public constant override skipPriceCheck = true; // F:[ZPF-1] 25 | 26 | /// @dev Not implemented, since Gearbox does not use historical data 27 | function getRoundData( 28 | uint80 //_roundId) 29 | ) 30 | external 31 | pure 32 | override 33 | returns ( 34 | uint80, // roundId, 35 | int256, //answer, 36 | uint256, // startedAt, 37 | uint256, // updatedAt, 38 | uint80 // answeredInRound 39 | ) 40 | { 41 | revert NotImplementedException(); // F:[ZPF-2] 42 | } 43 | 44 | /// @dev Returns the latest result according to Chainlink spec 45 | /// @notice 'answer' is always 0 46 | function latestRoundData() 47 | external 48 | view 49 | override 50 | returns ( 51 | uint80 roundId, 52 | int256 answer, 53 | uint256 startedAt, 54 | uint256 updatedAt, 55 | uint80 answeredInRound 56 | ) 57 | { 58 | roundId = 1; // F:[ZPF-3] 59 | answer = 0; // F:[ZPF-3] 60 | startedAt = block.timestamp; // F:[ZPF-3] 61 | updatedAt = block.timestamp; // F:[ZPF-3] 62 | answeredInRound = 1; // F:[ZPF-3] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /contracts/support/ContractUpgrader.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way. 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | pragma abicoder v2; 6 | 7 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 8 | 9 | import { AddressProvider } from "../core/AddressProvider.sol"; 10 | import { ACL } from "../core/ACL.sol"; 11 | 12 | abstract contract ContractUpgrader is Ownable { 13 | AddressProvider public immutable addressProvider; 14 | address public immutable root; 15 | 16 | error RootSelfDestoyException(); 17 | 18 | constructor(address _addressProvider) { 19 | addressProvider = AddressProvider(_addressProvider); 20 | 21 | root = ACL(addressProvider.getACL()).owner(); 22 | } 23 | 24 | function configure() external virtual onlyOwner { 25 | _configure(); 26 | _returnRootBack(); 27 | } 28 | 29 | function _configure() internal virtual; 30 | 31 | // Will be used in case of configure() revert 32 | function getRootBack() external onlyOwner { 33 | _returnRootBack(); 34 | } 35 | 36 | function _returnRootBack() internal { 37 | ACL acl = ACL(addressProvider.getACL()); // T:[PD-3] 38 | acl.transferOwnership(root); 39 | } 40 | 41 | function destoy() external onlyOwner { 42 | if (ACL(addressProvider.getACL()).owner() == address(this)) 43 | revert RootSelfDestoyException(); 44 | selfdestruct(payable(msg.sender)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /contracts/support/PauseMulticall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { ACLTrait } from "../core/ACLTrait.sol"; 6 | import { IAddressProvider } from "../interfaces/IAddressProvider.sol"; 7 | import { ACL } from "../core/ACL.sol"; 8 | import { ContractsRegister } from "../core/ContractsRegister.sol"; 9 | import { CallerNotPausableAdminException } from "../interfaces/IErrors.sol"; 10 | 11 | contract PauseMulticall is ACLTrait { 12 | ACL public immutable acl; 13 | ContractsRegister public immutable cr; 14 | 15 | modifier pausableAdminOnly() { 16 | if (!acl.isPausableAdmin(msg.sender)) 17 | revert CallerNotPausableAdminException(); // F:[PM-05] 18 | _; 19 | } 20 | 21 | constructor(address _addressProvider) ACLTrait(_addressProvider) { 22 | IAddressProvider ap = IAddressProvider(_addressProvider); 23 | acl = ACL(ap.getACL()); // F: [PM-01] 24 | 25 | cr = ContractsRegister(ap.getContractsRegister()); // F: [PM-01] 26 | } 27 | 28 | function pauseAllCreditManagers() 29 | external 30 | pausableAdminOnly // F:[PM-05] 31 | { 32 | // F: [PM-05] 33 | _pauseBatchOfContractrs(cr.getCreditManagers()); // F: [PM-02] 34 | } 35 | 36 | function pauseAllPools() 37 | external 38 | pausableAdminOnly // F:[PM-05] 39 | { 40 | _pauseBatchOfContractrs(cr.getPools()); // F: [PM-03] 41 | } 42 | 43 | function pauseAllContracts() 44 | external 45 | pausableAdminOnly // F:[PM-05] 46 | { 47 | _pauseBatchOfContractrs(cr.getPools()); // F: [PM-04] 48 | _pauseBatchOfContractrs(cr.getCreditManagers()); // F: [PM-04] 49 | } 50 | 51 | function _pauseBatchOfContractrs(address[] memory contractsToPause) 52 | internal 53 | { 54 | uint256 len = contractsToPause.length; 55 | for (uint256 i = 0; i < len; ) { 56 | // try-catch block to ignore some contracts which are already paused 57 | try ACLTrait(contractsToPause[i]).pause() {} catch {} 58 | unchecked { 59 | ++i; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /contracts/test/config/Tokens.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way. 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /// @dev c-Tokens and LUNA are added for unit test purposes 7 | enum Tokens { 8 | NO_TOKEN, 9 | DAI, 10 | USDC, 11 | WETH, 12 | LINK, 13 | USDT, 14 | STETH, 15 | CRV, 16 | CVX, 17 | LUNA, 18 | wstETH 19 | } 20 | -------------------------------------------------------------------------------- /contracts/test/helpers/CreditFacadeTestHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { TokensTestSuite } from "../suites/TokensTestSuite.sol"; 7 | import { CreditFacadeTestEngine } from "../helpers/CreditFacadeTestEngine.sol"; 8 | import "../lib/constants.sol"; 9 | import { Tokens } from "../config/Tokens.sol"; 10 | 11 | /// @title CreditManagerTestSuite 12 | /// @notice Deploys contract for unit testing of CreditManager.sol 13 | contract CreditFacadeTestHelper is CreditFacadeTestEngine { 14 | function expectTokenIsEnabled(Tokens t, bool expectedState) internal { 15 | expectTokenIsEnabled(t, expectedState, ""); 16 | } 17 | 18 | function expectTokenIsEnabled( 19 | Tokens t, 20 | bool expectedState, 21 | string memory reason 22 | ) internal { 23 | expectTokenIsEnabled( 24 | tokenTestSuite().addressOf(t), 25 | expectedState, 26 | reason 27 | ); 28 | } 29 | 30 | function addCollateral(Tokens t, uint256 amount) internal { 31 | tokenTestSuite().mint(t, USER, amount); 32 | tokenTestSuite().approve(t, USER, address(creditManager)); 33 | 34 | evm.startPrank(USER); 35 | creditFacade.addCollateral(USER, tokenTestSuite().addressOf(t), amount); 36 | evm.stopPrank(); 37 | } 38 | 39 | function tokenTestSuite() private view returns (TokensTestSuite) { 40 | return TokensTestSuite(payable(address(cft.tokenTestSuite()))); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /contracts/test/interfaces/ICreditConfig.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way. 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | import { ITokenTestSuite } from "./ITokenTestSuite.sol"; 6 | import { PriceFeedConfig } from "../../oracles/PriceOracle.sol"; 7 | import { CreditManagerOpts, CollateralToken } from "../../credit/CreditConfigurator.sol"; 8 | 9 | interface ICreditConfig { 10 | function getCreditOpts() external returns (CreditManagerOpts memory); 11 | 12 | function getCollateralTokens() 13 | external 14 | returns (CollateralToken[] memory collateralTokens); 15 | 16 | function getAccountAmount() external view returns (uint256); 17 | 18 | function getPriceFeeds() external view returns (PriceFeedConfig[] memory); 19 | 20 | function underlying() external view returns (address); 21 | 22 | function wethToken() external view returns (address); 23 | 24 | function tokenTestSuite() external view returns (ITokenTestSuite); 25 | 26 | function minBorrowedAmount() external view returns (uint128); 27 | 28 | function maxBorrowedAmount() external view returns (uint128); 29 | } 30 | -------------------------------------------------------------------------------- /contracts/test/interfaces/ITokenTestSuite.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way. 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | interface ITokenTestSuite { 7 | function wethToken() external view returns (address); 8 | 9 | function approve( 10 | address token, 11 | address holder, 12 | address targetContract 13 | ) external; 14 | 15 | function approve( 16 | address token, 17 | address holder, 18 | address targetContract, 19 | uint256 amount 20 | ) external; 21 | 22 | // function approve( 23 | // Tokens t, 24 | // address holder, 25 | // address targetContract 26 | // ) external; 27 | 28 | // function approve( 29 | // Tokens t, 30 | // address holder, 31 | // address targetContract, 32 | // uint256 amount 33 | // ) external; 34 | 35 | function topUpWETH() external payable; 36 | 37 | function topUpWETH(address onBehalfOf, uint256 value) external; 38 | 39 | function balanceOf(address token, address holder) 40 | external 41 | view 42 | returns (uint256 balance); 43 | 44 | function mint( 45 | address token, 46 | address to, 47 | uint256 amount 48 | ) external; 49 | 50 | function burn( 51 | address token, 52 | address from, 53 | uint256 amount 54 | ) external; 55 | 56 | // function mint( 57 | // Tokens t, 58 | // address to, 59 | // uint256 amount 60 | // ) external; 61 | } 62 | -------------------------------------------------------------------------------- /contracts/test/lib/MathUtil.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | library MathUtil { 7 | function min(uint256 a, uint256 b) internal pure returns (uint256) { 8 | return a < b ? a : b; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /contracts/test/lib/ParseLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; 7 | import { StringUtils } from "./StringUtils.sol"; 8 | import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; 9 | 10 | /// @notice Designed for test purposes only 11 | library ParseLib { 12 | using Strings for uint256; 13 | using StringUtils for string; 14 | 15 | function add( 16 | string memory init, 17 | string memory name, 18 | address addr 19 | ) internal pure returns (string memory) { 20 | return init.concat(name, uint256(uint160(addr)).toHexString(20)); 21 | } 22 | 23 | function add( 24 | string memory init, 25 | string memory name, 26 | uint256 value 27 | ) internal pure returns (string memory) { 28 | return init.concat(name, value.toString()); 29 | } 30 | 31 | function add_amount_decimals( 32 | string memory init, 33 | string memory name, 34 | uint256 value, 35 | uint8 decimals 36 | ) internal pure returns (string memory) { 37 | return init.concat(name, toFixString(value, decimals)); 38 | } 39 | 40 | function add_amount_token( 41 | string memory init, 42 | string memory name, 43 | uint256 value, 44 | address token 45 | ) internal view returns (string memory) { 46 | return 47 | add_amount_decimals( 48 | init, 49 | name, 50 | value, 51 | IERC20Metadata(token).decimals() 52 | ); 53 | } 54 | 55 | function add_token( 56 | string memory init, 57 | string memory name, 58 | address addr 59 | ) internal view returns (string memory) { 60 | return init.concat(name, IERC20Metadata(addr).symbol()); 61 | } 62 | 63 | function toFixString(uint256 value, uint8 decimals) 64 | internal 65 | pure 66 | returns (string memory) 67 | { 68 | uint8 divider = (decimals > 4) ? 4 : decimals; 69 | uint256 biggerPart = value / (10**(decimals)); 70 | uint256 smallerPart = value * 71 | (10**divider) - 72 | biggerPart * 73 | (10**(decimals + divider)); 74 | return biggerPart.toString().concat(".", smallerPart.toString()); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /contracts/test/lib/StringUtils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /// @notice Designed for test purposes only 7 | library StringUtils { 8 | function memcmp(bytes memory a, bytes memory b) 9 | internal 10 | pure 11 | returns (bool) 12 | { 13 | return (a.length == b.length) && (keccak256(a) == keccak256(b)); 14 | } 15 | 16 | function eq(string memory a, string memory b) internal pure returns (bool) { 17 | return memcmp(bytes(a), bytes(b)); 18 | } 19 | 20 | function concat(string memory s1, string memory s2) 21 | internal 22 | pure 23 | returns (string memory res) 24 | { 25 | res = string(abi.encodePacked(bytes(s1), bytes(s2))); 26 | } 27 | 28 | function concat( 29 | string memory s1, 30 | string memory s2, 31 | string memory s3 32 | ) internal pure returns (string memory res) { 33 | res = string(abi.encodePacked(bytes(s1), bytes(s2), bytes(s3))); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /contracts/test/mocks/adapters/TargetContractMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /// @title Target Contract Mock 7 | contract TargetContractMock { 8 | bytes public callData; 9 | 10 | constructor() {} 11 | 12 | fallback() external { 13 | callData = msg.data; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /contracts/test/mocks/core/ACLTraitTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { ACLTrait } from "../../../core/ACLTrait.sol"; 7 | 8 | /** 9 | * @title Pausable Trait Test 10 | * @notice this contract is used to test how poolOnly modifier works 11 | */ 12 | contract ACLTraitTest is ACLTrait { 13 | constructor(address addressProvider) ACLTrait(addressProvider) {} 14 | 15 | function accessWhenNotPaused() external view whenNotPaused {} 16 | 17 | function accessWhenPaused() external view whenPaused {} 18 | 19 | function accessConfiguratorOnly() external view configuratorOnly {} 20 | } 21 | -------------------------------------------------------------------------------- /contracts/test/mocks/core/AddressProviderACLMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /** 7 | * @title Address Provider that returns ACL and isConfigurator 8 | * @notice this contract is used to test LPPriceFeeds 9 | */ 10 | contract AddressProviderACLMock { 11 | address public owner; 12 | 13 | address public getACL; 14 | mapping(address => bool) public isConfigurator; 15 | 16 | address public getPriceOracle; 17 | mapping(address => address) public priceFeeds; 18 | 19 | constructor() { 20 | owner = msg.sender; 21 | getACL = address(this); 22 | getPriceOracle = address(this); 23 | isConfigurator[msg.sender] = true; 24 | } 25 | 26 | function setPriceFeed(address token, address feed) external { 27 | priceFeeds[token] = feed; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /contracts/test/mocks/dao/TreasuryMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | /** 7 | * @title TreasuryMock 8 | * @notice Just keeps money, used for test purpodes only 9 | * @author Gearbox 10 | */ 11 | contract TreasuryMock { 12 | // emits each time when money come 13 | event NewDonation(uint256 amount); 14 | 15 | receive() external payable { 16 | emit NewDonation(msg.value); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /contracts/test/mocks/oracles/LPPriceFeedMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { PriceFeedType } from "../../../interfaces/IPriceFeedType.sol"; 7 | import { LPPriceFeed } from "../../../oracles/LPPriceFeed.sol"; 8 | 9 | // EXCEPTIONS 10 | 11 | /// @title PPriceFeedMock pricefeed adapter 12 | contract LPPriceFeedMock is LPPriceFeed { 13 | PriceFeedType public constant override priceFeedType = 14 | PriceFeedType.YEARN_ORACLE; 15 | uint256 public constant override version = 1; 16 | 17 | // This pricefeed doesn't need sanity check, cause we check priceFeed for underlying token and set bounds for pricePerShare value 18 | bool public constant override skipPriceCheck = true; 19 | 20 | constructor( 21 | address addressProvider, 22 | uint256 range, 23 | string memory descrition 24 | ) 25 | LPPriceFeed( 26 | addressProvider, 27 | range, // F:[LPF-1] 28 | descrition 29 | ) 30 | {} 31 | 32 | function latestRoundData() 33 | external 34 | view 35 | override 36 | returns ( 37 | uint80 roundId, 38 | int256 answer, 39 | uint256 startedAt, 40 | uint256 updatedAt, 41 | uint80 answeredInRound 42 | ) 43 | { 44 | roundId = 1; 45 | answer = 0; 46 | startedAt = block.timestamp; 47 | updatedAt = block.timestamp; 48 | answeredInRound = 1; 49 | } 50 | 51 | function checkAndUpperBoundValue(uint256 value) 52 | external 53 | view 54 | returns (uint256) 55 | { 56 | return _checkAndUpperBoundValue(value); 57 | } 58 | 59 | function _checkCurrentValueInBounds(uint256, uint256) 60 | internal 61 | pure 62 | override 63 | returns (bool) 64 | { 65 | return true; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /contracts/test/mocks/pool/CreditManagerMockForPoolTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { IPoolService } from "../../../interfaces/IPoolService.sol"; 7 | import "../../lib/constants.sol"; 8 | 9 | contract CreditManagerMockForPoolTest { 10 | address public poolService; 11 | address public underlying; 12 | 13 | address public creditAccount = DUMB_ADDRESS; 14 | 15 | constructor(address _poolService) { 16 | poolService = _poolService; 17 | } 18 | 19 | function changePoolService(address newPool) external { 20 | poolService = newPool; 21 | } 22 | 23 | /** 24 | * @dev Transfers money from the pool to credit account 25 | * and updates the pool parameters 26 | * @param borrowedAmount Borrowed amount for credit account 27 | * @param ca Credit account address 28 | */ 29 | function lendCreditAccount(uint256 borrowedAmount, address ca) external { 30 | IPoolService(poolService).lendCreditAccount(borrowedAmount, ca); 31 | } 32 | 33 | /** 34 | * @dev Recalculates total borrowed & borrowRate 35 | * mints/burns diesel tokens 36 | */ 37 | function repayCreditAccount( 38 | uint256 borrowedAmount, 39 | uint256 profit, 40 | uint256 loss 41 | ) external { 42 | IPoolService(poolService).repayCreditAccount( 43 | borrowedAmount, 44 | profit, 45 | loss 46 | ); 47 | } 48 | 49 | function getCreditAccountOrRevert(address) 50 | public 51 | view 52 | returns (address result) 53 | { 54 | result = creditAccount; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /contracts/test/mocks/pool/TestPoolService.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { IPoolService } from "../../../interfaces/IPoolService.sol"; 7 | 8 | import { PoolService } from "../../../pool/PoolService.sol"; 9 | 10 | /** 11 | * @title Pool Service Test implementation 12 | * @notice Used for testing Pool Service. Implements some functions to set internal parameters 13 | * @author Gearbox 14 | */ 15 | contract TestPoolService is IPoolService, PoolService { 16 | /** 17 | * @dev Constructor 18 | * @param addressProvider Address Repository for upgradable contract model 19 | * @param _underlying Address of underlying token 20 | * @param interestRateModelAddress Address of interest rate model 21 | */ 22 | constructor( 23 | address addressProvider, 24 | address _underlying, 25 | address interestRateModelAddress, 26 | uint256 _expectedLiquidityLimit 27 | ) 28 | PoolService( 29 | addressProvider, 30 | _underlying, 31 | interestRateModelAddress, 32 | _expectedLiquidityLimit 33 | ) 34 | {} 35 | 36 | /** 37 | * @dev Mock function to set _totalLiquidity manually 38 | * used for test purposes only 39 | */ 40 | 41 | function setExpectedLiquidity(uint256 newExpectedLiquidity) external { 42 | _expectedLiquidityLU = newExpectedLiquidity; 43 | } 44 | 45 | function getCumulativeIndex_RAY() external view returns (uint256) { 46 | return _cumulativeIndex_RAY; 47 | } 48 | 49 | function getTimestampLU() external view returns (uint256) { 50 | return _timestampLU; 51 | } 52 | 53 | function getExpectedLU() external view returns (uint256) { 54 | return _expectedLiquidityLU; 55 | } 56 | 57 | function updateBorrowRate() external { 58 | _updateBorrowRate(0); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC20ApproveRestricted.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 7 | import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 8 | 9 | contract ERC20ApproveRestrictedRevert is ERC20, Ownable { 10 | constructor() ERC20("", "") {} 11 | 12 | function approve(address user, uint256 amount) 13 | public 14 | override 15 | returns (bool) 16 | { 17 | if ((allowance(msg.sender, user) > 0) && (amount != 0)) { 18 | revert("Try to change allowance from non-zero to non-zero"); 19 | } 20 | _approve(msg.sender, user, amount); 21 | return true; 22 | } 23 | } 24 | 25 | contract ERC20ApproveRestrictedFalse is ERC20, Ownable { 26 | constructor() ERC20("", "") {} 27 | 28 | function approve(address user, uint256 amount) 29 | public 30 | override 31 | returns (bool) 32 | { 33 | if ((allowance(msg.sender, user) > 0) && (amount != 0)) { 34 | return false; 35 | } 36 | _approve(msg.sender, user, amount); 37 | return true; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC20Blacklistable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 7 | import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 8 | 9 | contract ERC20BlacklistableMock is ERC20, Ownable { 10 | uint8 private immutable _decimals; 11 | mapping(address => bool) public isBlacklisted; 12 | mapping(address => bool) public isBlackListed; 13 | 14 | constructor( 15 | string memory name_, 16 | string memory symbol_, 17 | uint8 decimals_ 18 | ) ERC20(name_, symbol_) { 19 | _decimals = decimals_; 20 | } 21 | 22 | function decimals() public view override returns (uint8) { 23 | return _decimals; 24 | } 25 | 26 | function mint(address to, uint256 amount) 27 | external 28 | onlyOwner 29 | returns (bool) 30 | { 31 | _mint(to, amount); 32 | return true; 33 | } 34 | 35 | function transfer(address recipient, uint256 amount) 36 | public 37 | override 38 | returns (bool) 39 | { 40 | if (isBlacklisted[msg.sender] || isBlacklisted[recipient]) { 41 | revert("Token transaction with blacklisted address"); 42 | } 43 | 44 | _transfer(_msgSender(), recipient, amount); 45 | 46 | return true; 47 | } 48 | 49 | function transferFrom( 50 | address from, 51 | address to, 52 | uint256 amount 53 | ) public override returns (bool) { 54 | if (isBlacklisted[from] || isBlacklisted[to]) { 55 | revert("Token transaction with blacklisted address"); 56 | } 57 | 58 | address spender = _msgSender(); 59 | _spendAllowance(from, spender, amount); 60 | _transfer(from, to, amount); 61 | return true; 62 | } 63 | 64 | function setBlacklisted(address account, bool status) external { 65 | isBlacklisted[account] = status; 66 | } 67 | 68 | function setBlackListed(address account, bool status) external { 69 | isBlackListed[account] = status; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC20Blocking.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 7 | import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 8 | 9 | contract ERC20BlockingMock is ERC20, Ownable { 10 | bool public isBlocked; 11 | 12 | constructor(string memory name_, string memory symbol_) 13 | ERC20(name_, symbol_) 14 | { 15 | _mint(msg.sender, 1e24); 16 | isBlocked = false; 17 | } 18 | 19 | function blockToken() external { 20 | isBlocked = true; 21 | } 22 | 23 | function mint(address to, uint256 amount) external onlyOwner { 24 | _mint(to, amount); 25 | } 26 | 27 | function transfer(address recipient, uint256 amount) 28 | public 29 | override 30 | returns (bool) 31 | { 32 | _transfer(_msgSender(), recipient, amount); 33 | return !isBlocked; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC20Fee.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 7 | import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 8 | import { PERCENTAGE_FACTOR } from "../../../libraries/PercentageMath.sol"; 9 | 10 | contract TokenFeeMock is ERC20, Ownable { 11 | uint256 public fee; 12 | 13 | constructor( 14 | string memory name_, 15 | string memory symbol_, 16 | uint256 fee_ 17 | ) ERC20(name_, symbol_) { 18 | _mint(msg.sender, 1e24); 19 | fee = fee_; 20 | require(fee < PERCENTAGE_FACTOR, "Incorrect fee"); 21 | } 22 | 23 | function mint(address to, uint256 amount) external onlyOwner { 24 | _mint(to, amount); 25 | } 26 | 27 | function transfer(address recipient, uint256 amount) 28 | public 29 | virtual 30 | override 31 | returns (bool) 32 | { 33 | _transfer( 34 | _msgSender(), 35 | recipient, 36 | (amount * (PERCENTAGE_FACTOR - fee)) / (PERCENTAGE_FACTOR) 37 | ); 38 | return true; 39 | } 40 | 41 | function transferFrom( 42 | address sender, 43 | address recipient, 44 | uint256 amount 45 | ) public virtual override returns (bool) { 46 | amount = (amount * (PERCENTAGE_FACTOR - fee)) / (PERCENTAGE_FACTOR); 47 | 48 | return ERC20.transferFrom(sender, recipient, amount); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC20Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; 7 | import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 8 | 9 | contract ERC20Mock is ERC20, Ownable { 10 | uint8 private immutable _decimals; 11 | address public minter; 12 | 13 | constructor( 14 | string memory name_, 15 | string memory symbol_, 16 | uint8 decimals_ 17 | ) ERC20(name_, symbol_) { 18 | _decimals = decimals_; 19 | minter = msg.sender; 20 | // _mint(msg.sender, 1e24); 21 | } 22 | 23 | modifier minterOnly() { 24 | require(msg.sender == minter, "Minter calls only"); 25 | _; 26 | } 27 | 28 | function decimals() public view override returns (uint8) { 29 | return _decimals; 30 | } 31 | 32 | function mint(address to, uint256 amount) 33 | external 34 | minterOnly 35 | returns (bool) 36 | { 37 | _mint(to, amount); 38 | return true; 39 | } 40 | 41 | function burnFrom(address to, uint256 amount) 42 | external 43 | minterOnly 44 | returns (bool) 45 | { 46 | _burn(to, amount); 47 | return true; 48 | } 49 | 50 | function burn(address to, uint256 amount) external returns (bool) { 51 | _burn(to, amount); 52 | return true; 53 | } 54 | 55 | function set_minter(address _minter) external { 56 | minter = _minter; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC20NonCompliant.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.10; 2 | 3 | //Non ERC20 compliant token which do not have a return value on approve/transfer (e.g. TUSD, OMG) 4 | contract NonCompliantERC20 { 5 | function approve(address, uint256) external pure returns (bool) { 6 | return false; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/ERC721ReceiverMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.10; 3 | 4 | interface IERC721Receiver { 5 | function onERC721Received( 6 | address operator, 7 | address from, 8 | uint256 tokenId, 9 | bytes calldata data 10 | ) external returns (bytes4); 11 | } 12 | 13 | contract ERC721ReceiverMock is IERC721Receiver { 14 | function onERC721Received( 15 | address, // operator, 16 | address, // from, 17 | uint256, // tokenId, 18 | bytes calldata // data 19 | ) external pure returns (bytes4) { 20 | return IERC721Receiver.onERC721Received.selector; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /contracts/test/mocks/token/WETHMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.10; 3 | import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 4 | 5 | contract WETHMock is IERC20 { 6 | string public name = "Wrapped Ether"; 7 | string public symbol = "WETH"; 8 | uint8 public decimals = 18; 9 | 10 | // event Approval(address indexed src, address indexed guy, uint256 wad); 11 | // event Transfer(address indexed src, address indexed dst, uint256 wad); 12 | event Deposit(address indexed dst, uint256 wad); 13 | event Withdrawal(address indexed src, uint256 wad); 14 | 15 | mapping(address => uint256) public balanceOf; 16 | mapping(address => mapping(address => uint256)) public allowance; 17 | 18 | function mint(address to, uint256 amount) external { 19 | balanceOf[to] += amount; 20 | } 21 | 22 | receive() external payable { 23 | deposit(); // T:[WM-1] 24 | } 25 | 26 | function deposit() public payable { 27 | balanceOf[msg.sender] += msg.value; // T:[WM-1] 28 | emit Deposit(msg.sender, msg.value); // T:[WM-1] 29 | } 30 | 31 | function withdraw(uint256 wad) public { 32 | require(balanceOf[msg.sender] >= wad); // T:[WM-2] 33 | balanceOf[msg.sender] -= wad; // T:[WM-2] 34 | payable(msg.sender).transfer(wad); // T:[WM-3] 35 | emit Withdrawal(msg.sender, wad); // T:[WM-4] 36 | } 37 | 38 | function totalSupply() public view returns (uint256) { 39 | return address(this).balance; // T:[WM-1, 2] 40 | } 41 | 42 | function approve(address guy, uint256 wad) public returns (bool) { 43 | allowance[msg.sender][guy] = wad; // T:[WM-3] 44 | emit Approval(msg.sender, guy, wad); // T:[WM-3] 45 | return true; 46 | } 47 | 48 | function transfer(address dst, uint256 wad) public returns (bool) { 49 | return transferFrom(msg.sender, dst, wad); // T:[WM-4,5,6] 50 | } 51 | 52 | function transferFrom( 53 | address src, 54 | address dst, 55 | uint256 wad 56 | ) public returns (bool) { 57 | require(balanceOf[src] >= wad); // T:[WM-4] 58 | 59 | if ( 60 | src != msg.sender && allowance[src][msg.sender] != type(uint256).max 61 | ) { 62 | require(allowance[src][msg.sender] >= wad); // T:[WM-4] 63 | allowance[src][msg.sender] -= wad; // T:[WM-7] 64 | } 65 | 66 | balanceOf[src] -= wad; // T:[WM-5] 67 | balanceOf[dst] += wad; // T:[WM-5] 68 | 69 | emit Transfer(src, dst, wad); // T:[WM-6] 70 | 71 | return true; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /contracts/test/suites/TokensTestSuiteHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way. 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 7 | 8 | import { IWETH } from "../../interfaces/external/IWETH.sol"; 9 | 10 | import { ITokenTestSuite } from "../interfaces/ITokenTestSuite.sol"; 11 | 12 | // MOCKS 13 | import { ERC20Mock } from "../mocks/token/ERC20Mock.sol"; 14 | import "../lib/constants.sol"; 15 | 16 | contract TokensTestSuiteHelper is DSTest, ITokenTestSuite { 17 | CheatCodes evm = CheatCodes(HEVM_ADDRESS); 18 | address public wethToken; 19 | 20 | function topUpWETH() public payable override { 21 | IWETH(wethToken).deposit{ value: msg.value }(); 22 | } 23 | 24 | function topUpWETH(address onBehalfOf, uint256 value) public override { 25 | evm.prank(onBehalfOf); 26 | IWETH(wethToken).deposit{ value: value }(); 27 | } 28 | 29 | function mint( 30 | address token, 31 | address to, 32 | uint256 amount 33 | ) public virtual override { 34 | if (token == wethToken) { 35 | evm.deal(address(this), amount); 36 | IWETH(wethToken).deposit{ value: amount }(); 37 | } else { 38 | ERC20Mock(token).mint(address(this), amount); 39 | } 40 | IERC20(token).transfer(to, amount); 41 | } 42 | 43 | function balanceOf(address token, address holder) 44 | public 45 | view 46 | override 47 | returns (uint256 balance) 48 | { 49 | balance = IERC20(token).balanceOf(holder); 50 | } 51 | 52 | function approve( 53 | address token, 54 | address holder, 55 | address targetContract 56 | ) public override { 57 | approve(token, holder, targetContract, type(uint256).max); 58 | } 59 | 60 | function approve( 61 | address token, 62 | address holder, 63 | address targetContract, 64 | uint256 amount 65 | ) public override { 66 | evm.prank(holder); 67 | IERC20(token).approve(targetContract, amount); 68 | } 69 | 70 | function burn( 71 | address token, 72 | address from, 73 | uint256 amount 74 | ) public override { 75 | ERC20Mock(token).burn(from, amount); 76 | } 77 | 78 | receive() external payable {} 79 | } 80 | -------------------------------------------------------------------------------- /contracts/tokens/DieselToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 7 | import { IDieselToken } from "../interfaces/IDieselToken.sol"; 8 | 9 | /// @dev DieselToken is LP token for Gearbox pools 10 | contract DieselToken is ERC20, IDieselToken { 11 | uint8 private immutable _decimals; 12 | address public immutable poolService; 13 | 14 | modifier onlyPoolService() { 15 | if (msg.sender != poolService) { 16 | revert PoolServiceOnlyException(); 17 | } 18 | _; 19 | } 20 | 21 | constructor( 22 | string memory name_, 23 | string memory symbol_, 24 | uint8 decimals_ 25 | ) ERC20(name_, symbol_) { 26 | _decimals = decimals_; 27 | poolService = msg.sender; 28 | } 29 | 30 | function mint(address to, uint256 amount) external onlyPoolService { 31 | _mint(to, amount); 32 | } 33 | 34 | function burn(address to, uint256 amount) external onlyPoolService { 35 | _burn(to, amount); 36 | } 37 | 38 | function decimals() public view override returns (uint8) { 39 | return _decimals; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /contracts/tokens/LICENSE: -------------------------------------------------------------------------------- 1 | The 3-Clause BSD License 2 | 3 | Copyright 2020 Compound Labs, Inc. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | -------------------------------------------------------------------------------- /contracts/tokens/PhantomERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | // Gearbox Protocol. Generalized leverage for DeFi protocols 3 | // (c) Gearbox Holdings, 2022 4 | pragma solidity ^0.8.10; 5 | 6 | import { IPhantomERC20 } from "../interfaces/IPhantomERC20.sol"; 7 | 8 | /// @dev PhantomERC20 is a pseudo-ERC20 that only implements totalSupply and balanceOf 9 | /// @notice Used to track positions that do not issue an explicit share token 10 | /// This is an abstract contract and balanceOf is implemented by concrete instances 11 | abstract contract PhantomERC20 is IPhantomERC20 { 12 | address public immutable underlying; 13 | 14 | string public override symbol; 15 | string public override name; 16 | uint8 public immutable override decimals; 17 | 18 | constructor( 19 | address _underlying, 20 | string memory _name, 21 | string memory _symbol, 22 | uint8 _decimals 23 | ) { 24 | symbol = _symbol; 25 | name = _name; 26 | decimals = _decimals; 27 | underlying = _underlying; 28 | } 29 | 30 | function totalSupply() external view virtual override returns (uint256) { 31 | return IPhantomERC20(underlying).totalSupply(); 32 | } 33 | 34 | function transfer(address, uint256) external pure override returns (bool) { 35 | return false; 36 | } 37 | 38 | function allowance(address, address) 39 | external 40 | pure 41 | override 42 | returns (uint256) 43 | { 44 | return 0; 45 | } 46 | 47 | function approve(address, uint256) external pure override returns (bool) { 48 | return false; 49 | } 50 | 51 | function transferFrom( 52 | address, 53 | address, 54 | uint256 55 | ) external pure override returns (bool) { 56 | return false; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | libs = ['lib'] 3 | out = 'forge-out' 4 | solc_version = '0.8.10' 5 | src = 'contracts' 6 | optimizer_runs = 1000000 7 | 8 | # See more config options https://github.com/gakonst/foundry/tree/master/config 9 | block_number = 120000 10 | block_timestamp = 16400000 11 | gas_limit = 9223372036854775807 # the gas limit in tests 12 | block_base_fee_per_gas = 100 13 | fs_permissions = [{ access = "read-write", path = "./"}] 14 | evm_version="shanghai" -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gearbox-protocol/core-v2", 3 | "description": "Core smart contracts of Gearbox V2", 4 | "version": "1.0.1", 5 | "homepage": "https://gearbox.fi", 6 | "main": "./lib/index.js", 7 | "types": "./lib/index.d.ts", 8 | "files": [ 9 | "contracts", 10 | "scripts", 11 | "types", 12 | "lib" 13 | ], 14 | "keywords": [ 15 | "gearbox" 16 | ], 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/Gearbox-protocol/core-v2" 20 | }, 21 | "license": "BUSL-1.1", 22 | "scripts": { 23 | "types": "rm -rf ./types && typechain --target ethers-v5 --discriminate-types --out-dir types \"./forge-out/**/!(*.t|test|*Mock).sol/!(*.abi).json\" && rm -rf ./forge-out", 24 | "prepare": "husky install", 25 | "prettier": "prettier --write .", 26 | "prettier:ci": "npx prettier --check .", 27 | "build": "tsc --p tsconfig.build.json" 28 | }, 29 | "devDependencies": { 30 | "@chainlink/contracts": "^0.4.0", 31 | "@commitlint/cli": "^17.1.2", 32 | "@commitlint/config-conventional": "^17.1.0", 33 | "@gearbox-protocol/integration-types": "^1.2.0", 34 | "@gearbox-protocol/prettier-config": "^1.5.0", 35 | "@openzeppelin/contracts": "^4.4.2", 36 | "ethers": "v5", 37 | "husky": "^8.0.1", 38 | "lint-staged": "^13.0.3", 39 | "prettier": "^2.7.1", 40 | "prettier-plugin-solidity": "^1.0.0-beta.24", 41 | "typechain": "^8.1.1" 42 | }, 43 | "prettier": "@gearbox-protocol/prettier-config", 44 | "lint-staged": { 45 | "*.{sol,json,md}": "prettier --write" 46 | }, 47 | "dependencies": { 48 | "@typechain/ethers-v5": "^10.2.1" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | @chainlink/=node_modules/@chainlink/ 2 | @openzeppelin/=node_modules/@openzeppelin/ 3 | @gearbox-protocol/=node_modules/@gearbox-protocol/ 4 | -------------------------------------------------------------------------------- /scripts/abigen.sh: -------------------------------------------------------------------------------- 1 | for f in ./abi/*.json; do 2 | echo "Processing $f file.."; 3 | GO_NAME=${f/json/go} 4 | DIR=./abi/ 5 | GO_PKG=${GO_NAME/$DIR/""} 6 | GO_PKG=${GO_PKG/.go/""} 7 | GO_PKG_FL="$(tr [A-Z] [a-z] <<< "${GO_PKG:0:1}")" 8 | GO_PKG=${GO_PKG_FL}${GO_PKG:1} 9 | OUT_DIR=../gearscan/artifacts/${GO_PKG} 10 | 11 | # Create dir if not exists 12 | [ ! -d $OUT_DIR ] && mkdir $OUT_DIR 13 | 14 | # Export file 15 | OUT_FILE=${OUT_DIR}/abi.go 16 | rm -rf ./gearscan/artifacts/* 17 | abigen --abi $f --pkg $GO_PKG --out $OUT_FILE 18 | done 19 | -------------------------------------------------------------------------------- /scripts/trimport.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script tries to remove imports one by one while making sure that the 3 | # project can still be compiled, so that the minimum number of imports is used. 4 | # This approach is really inefficient, but good enough given that it can just 5 | # be run once in a while to unclutter imports. 6 | set -e 7 | set -u 8 | 9 | compile(){ 10 | echo Compiling... 11 | forge clean 12 | forge b >/dev/null 2>&1 13 | } 14 | 15 | echo "This script will run on the following files:" 16 | find 'contracts' -iname '*.sol' 17 | echo "Continue? [y/N]" 18 | 19 | read -r answer 20 | if [ "$answer" != "y" ]; then 21 | exit 2 22 | fi 23 | 24 | 25 | echo "Compiling once with original files as a sanity check" 26 | compile || exit 3 27 | 28 | tmp="$(mktemp)" 29 | 30 | find 'contracts' -type f -iname '*.sol' |\ 31 | while read -r f ; do 32 | grep -n '^ *import' "$f" | cut -d':' -f1 |\ 33 | while read -r line; do 34 | cp "$f" "$tmp" 35 | if [[ "$OSTYPE" == "darwin"* ]]; then 36 | gsed -i "$line"'s/.*//' "$f" || (echo "Install gnu-sed for macOS: brew install gnu-sed" && exit 4) 37 | else 38 | sed -i "$line"'s/.*//' "$f" 39 | fi 40 | compile || cp "$tmp" "$f" 41 | done 42 | done 43 | 44 | exit 0 -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["**/*.spec.ts", "node_modules"] 4 | } 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "commonjs", 5 | "lib": ["esnext"], 6 | "declaration": true, 7 | "strict": true, 8 | "noUnusedParameters": true, 9 | "noImplicitReturns": true, 10 | "resolveJsonModule": true, 11 | "moduleResolution": "node", 12 | "allowSyntheticDefaultImports": true, 13 | "esModuleInterop": true, 14 | "skipLibCheck": true, 15 | "outDir": "./lib/", 16 | "types": [] 17 | }, 18 | "include": ["types"], 19 | "exclude": ["node_modules", "lib"] 20 | } 21 | -------------------------------------------------------------------------------- /types/Balances.sol/BalanceOps.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface BalanceOpsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface BalanceOps extends BaseContract { 21 | contractName: "BalanceOps"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: BalanceOpsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/Balances.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { BalanceOps } from "./BalanceOps"; 5 | -------------------------------------------------------------------------------- /types/BlacklistHelper.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { BlacklistHelper } from "./BlacklistHelper"; 5 | export type { IBlacklistableUSDC } from "./IBlacklistableUSDC"; 6 | export type { IBlacklistableUSDT } from "./IBlacklistableUSDT"; 7 | -------------------------------------------------------------------------------- /types/BoundedPriceFeed.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { BoundedPriceFeed } from "./BoundedPriceFeed"; 5 | export type { ChainlinkReadableAggregator } from "./ChainlinkReadableAggregator"; 6 | -------------------------------------------------------------------------------- /types/Constants.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { Roles } from "./Roles"; 5 | -------------------------------------------------------------------------------- /types/ERC20ApproveRestricted.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ERC20ApproveRestrictedFalse } from "./ERC20ApproveRestrictedFalse"; 5 | export type { ERC20ApproveRestrictedRevert } from "./ERC20ApproveRestrictedRevert"; 6 | -------------------------------------------------------------------------------- /types/ERC20Blacklistable.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ERC20BlacklistableMock } from "./ERC20BlacklistableMock"; 5 | -------------------------------------------------------------------------------- /types/ERC20Blocking.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ERC20BlockingMock } from "./ERC20BlockingMock"; 5 | -------------------------------------------------------------------------------- /types/ERC20Fee.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { TokenFeeMock } from "./TokenFeeMock"; 5 | -------------------------------------------------------------------------------- /types/ERC20NonCompliant.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { NonCompliantERC20 } from "./NonCompliantERC20"; 5 | -------------------------------------------------------------------------------- /types/IACL.sol/IACLExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IACLExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IACLExceptions extends BaseContract { 21 | contractName: "IACLExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IACLExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IACL.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IACL } from "./IACL"; 5 | export type { IACLEvents } from "./IACLEvents"; 6 | export type { IACLExceptions } from "./IACLExceptions"; 7 | -------------------------------------------------------------------------------- /types/IAccountFactory.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IAccountFactory } from "./IAccountFactory"; 5 | export type { IAccountFactoryEvents } from "./IAccountFactoryEvents"; 6 | export type { IAccountFactoryGetters } from "./IAccountFactoryGetters"; 7 | -------------------------------------------------------------------------------- /types/IAdapter.sol/IAdapterExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IAdapterExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IAdapterExceptions extends BaseContract { 21 | contractName: "IAdapterExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IAdapterExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IAdapter.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IAdapter } from "./IAdapter"; 5 | export type { IAdapterExceptions } from "./IAdapterExceptions"; 6 | -------------------------------------------------------------------------------- /types/IAddressProvider.sol/IAddressProviderEvents.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, BytesLike, Signer, utils } from "ethers"; 5 | import type { EventFragment } from "@ethersproject/abi"; 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | PromiseOrValue, 13 | } from "../common"; 14 | 15 | export interface IAddressProviderEventsInterface extends utils.Interface { 16 | functions: {}; 17 | 18 | events: { 19 | "AddressSet(bytes32,address)": EventFragment; 20 | }; 21 | 22 | getEvent(nameOrSignatureOrTopic: "AddressSet"): EventFragment; 23 | } 24 | 25 | export interface AddressSetEventObject { 26 | service: string; 27 | newAddress: string; 28 | } 29 | export type AddressSetEvent = TypedEvent< 30 | [string, string], 31 | AddressSetEventObject 32 | >; 33 | 34 | export type AddressSetEventFilter = TypedEventFilter; 35 | 36 | export interface IAddressProviderEvents extends BaseContract { 37 | contractName: "IAddressProviderEvents"; 38 | 39 | connect(signerOrProvider: Signer | Provider | string): this; 40 | attach(addressOrName: string): this; 41 | deployed(): Promise; 42 | 43 | interface: IAddressProviderEventsInterface; 44 | 45 | queryFilter( 46 | event: TypedEventFilter, 47 | fromBlockOrBlockhash?: string | number | undefined, 48 | toBlock?: string | number | undefined 49 | ): Promise>; 50 | 51 | listeners( 52 | eventFilter?: TypedEventFilter 53 | ): Array>; 54 | listeners(eventName?: string): Array; 55 | removeAllListeners( 56 | eventFilter: TypedEventFilter 57 | ): this; 58 | removeAllListeners(eventName?: string): this; 59 | off: OnEvent; 60 | on: OnEvent; 61 | once: OnEvent; 62 | removeListener: OnEvent; 63 | 64 | functions: {}; 65 | 66 | callStatic: {}; 67 | 68 | filters: { 69 | "AddressSet(bytes32,address)"( 70 | service?: PromiseOrValue | null, 71 | newAddress?: PromiseOrValue | null 72 | ): AddressSetEventFilter; 73 | AddressSet( 74 | service?: PromiseOrValue | null, 75 | newAddress?: PromiseOrValue | null 76 | ): AddressSetEventFilter; 77 | }; 78 | 79 | estimateGas: {}; 80 | 81 | populateTransaction: {}; 82 | } 83 | -------------------------------------------------------------------------------- /types/IAddressProvider.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IAddressProvider } from "./IAddressProvider"; 5 | export type { IAddressProviderEvents } from "./IAddressProviderEvents"; 6 | -------------------------------------------------------------------------------- /types/IAirdropDistributor.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IAirdropDistributor } from "./IAirdropDistributor"; 5 | export type { IAirdropDistributorEvents } from "./IAirdropDistributorEvents"; 6 | -------------------------------------------------------------------------------- /types/IBlacklistHelper.sol/IBlacklistHelperExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IBlacklistHelperExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IBlacklistHelperExceptions extends BaseContract { 21 | contractName: "IBlacklistHelperExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IBlacklistHelperExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IBlacklistHelper.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IBlacklistHelper } from "./IBlacklistHelper"; 5 | export type { IBlacklistHelperEvents } from "./IBlacklistHelperEvents"; 6 | export type { IBlacklistHelperExceptions } from "./IBlacklistHelperExceptions"; 7 | -------------------------------------------------------------------------------- /types/IContractsRegister.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IContractsRegister } from "./IContractsRegister"; 5 | export type { IContractsRegisterEvents } from "./IContractsRegisterEvents"; 6 | -------------------------------------------------------------------------------- /types/ICreditAccount.sol/ICrediAccountExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface ICrediAccountExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface ICrediAccountExceptions extends BaseContract { 21 | contractName: "ICrediAccountExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: ICrediAccountExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/ICreditAccount.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ICrediAccountExceptions } from "./ICrediAccountExceptions"; 5 | export type { ICreditAccount } from "./ICreditAccount"; 6 | -------------------------------------------------------------------------------- /types/ICreditConfigurator.sol/ICreditConfiguratorExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface ICreditConfiguratorExceptionsInterface 15 | extends utils.Interface { 16 | functions: {}; 17 | 18 | events: {}; 19 | } 20 | 21 | export interface ICreditConfiguratorExceptions extends BaseContract { 22 | contractName: "ICreditConfiguratorExceptions"; 23 | 24 | connect(signerOrProvider: Signer | Provider | string): this; 25 | attach(addressOrName: string): this; 26 | deployed(): Promise; 27 | 28 | interface: ICreditConfiguratorExceptionsInterface; 29 | 30 | queryFilter( 31 | event: TypedEventFilter, 32 | fromBlockOrBlockhash?: string | number | undefined, 33 | toBlock?: string | number | undefined 34 | ): Promise>; 35 | 36 | listeners( 37 | eventFilter?: TypedEventFilter 38 | ): Array>; 39 | listeners(eventName?: string): Array; 40 | removeAllListeners( 41 | eventFilter: TypedEventFilter 42 | ): this; 43 | removeAllListeners(eventName?: string): this; 44 | off: OnEvent; 45 | on: OnEvent; 46 | once: OnEvent; 47 | removeListener: OnEvent; 48 | 49 | functions: {}; 50 | 51 | callStatic: {}; 52 | 53 | filters: {}; 54 | 55 | estimateGas: {}; 56 | 57 | populateTransaction: {}; 58 | } 59 | -------------------------------------------------------------------------------- /types/ICreditConfigurator.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ICreditConfigurator } from "./ICreditConfigurator"; 5 | export type { ICreditConfiguratorEvents } from "./ICreditConfiguratorEvents"; 6 | export type { ICreditConfiguratorExceptions } from "./ICreditConfiguratorExceptions"; 7 | -------------------------------------------------------------------------------- /types/ICreditFacade.sol/ICreditFacadeExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface ICreditFacadeExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface ICreditFacadeExceptions extends BaseContract { 21 | contractName: "ICreditFacadeExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: ICreditFacadeExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/ICreditFacade.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ICreditFacade } from "./ICreditFacade"; 5 | export type { ICreditFacadeEvents } from "./ICreditFacadeEvents"; 6 | export type { ICreditFacadeExceptions } from "./ICreditFacadeExceptions"; 7 | export type { ICreditFacadeExtended } from "./ICreditFacadeExtended"; 8 | export type { ICreditFacadeV2 } from "./ICreditFacadeV2"; 9 | -------------------------------------------------------------------------------- /types/ICreditManagerV2.sol/ICreditManagerV2Exceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface ICreditManagerV2ExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface ICreditManagerV2Exceptions extends BaseContract { 21 | contractName: "ICreditManagerV2Exceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: ICreditManagerV2ExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/ICreditManagerV2.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ICreditManagerV2 } from "./ICreditManagerV2"; 5 | export type { ICreditManagerV2Events } from "./ICreditManagerV2Events"; 6 | export type { ICreditManagerV2Exceptions } from "./ICreditManagerV2Exceptions"; 7 | -------------------------------------------------------------------------------- /types/IDataCompressor.sol/IDataCompressorExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IDataCompressorExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IDataCompressorExceptions extends BaseContract { 21 | contractName: "IDataCompressorExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IDataCompressorExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IDataCompressor.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IDataCompressor } from "./IDataCompressor"; 5 | export type { IDataCompressorExceptions } from "./IDataCompressorExceptions"; 6 | -------------------------------------------------------------------------------- /types/IDegenDistributor.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IDegenDistributor } from "./IDegenDistributor"; 5 | export type { IDegenDistributorEvents } from "./IDegenDistributorEvents"; 6 | -------------------------------------------------------------------------------- /types/IDegenNFT.sol/IDegenNFTExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IDegenNFTExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IDegenNFTExceptions extends BaseContract { 21 | contractName: "IDegenNFTExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IDegenNFTExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IDegenNFT.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IDegenNFT } from "./IDegenNFT"; 5 | export type { IDegenNFTEvents } from "./IDegenNFTEvents"; 6 | export type { IDegenNFTExceptions } from "./IDegenNFTExceptions"; 7 | -------------------------------------------------------------------------------- /types/IDieselToken.sol/IDieselTokenExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IDieselTokenExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IDieselTokenExceptions extends BaseContract { 21 | contractName: "IDieselTokenExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IDieselTokenExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IDieselToken.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IDieselToken } from "./IDieselToken"; 5 | export type { IDieselTokenExceptions } from "./IDieselTokenExceptions"; 6 | -------------------------------------------------------------------------------- /types/ILPPriceFeed.sol/ILPPriceFeedEvents.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, BigNumber, Signer, utils } from "ethers"; 5 | import type { EventFragment } from "@ethersproject/abi"; 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface ILPPriceFeedEventsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: { 18 | "NewLimiterParams(uint256,uint256)": EventFragment; 19 | }; 20 | 21 | getEvent(nameOrSignatureOrTopic: "NewLimiterParams"): EventFragment; 22 | } 23 | 24 | export interface NewLimiterParamsEventObject { 25 | lowerBound: BigNumber; 26 | upperBound: BigNumber; 27 | } 28 | export type NewLimiterParamsEvent = TypedEvent< 29 | [BigNumber, BigNumber], 30 | NewLimiterParamsEventObject 31 | >; 32 | 33 | export type NewLimiterParamsEventFilter = 34 | TypedEventFilter; 35 | 36 | export interface ILPPriceFeedEvents extends BaseContract { 37 | contractName: "ILPPriceFeedEvents"; 38 | 39 | connect(signerOrProvider: Signer | Provider | string): this; 40 | attach(addressOrName: string): this; 41 | deployed(): Promise; 42 | 43 | interface: ILPPriceFeedEventsInterface; 44 | 45 | queryFilter( 46 | event: TypedEventFilter, 47 | fromBlockOrBlockhash?: string | number | undefined, 48 | toBlock?: string | number | undefined 49 | ): Promise>; 50 | 51 | listeners( 52 | eventFilter?: TypedEventFilter 53 | ): Array>; 54 | listeners(eventName?: string): Array; 55 | removeAllListeners( 56 | eventFilter: TypedEventFilter 57 | ): this; 58 | removeAllListeners(eventName?: string): this; 59 | off: OnEvent; 60 | on: OnEvent; 61 | once: OnEvent; 62 | removeListener: OnEvent; 63 | 64 | functions: {}; 65 | 66 | callStatic: {}; 67 | 68 | filters: { 69 | "NewLimiterParams(uint256,uint256)"( 70 | lowerBound?: null, 71 | upperBound?: null 72 | ): NewLimiterParamsEventFilter; 73 | NewLimiterParams( 74 | lowerBound?: null, 75 | upperBound?: null 76 | ): NewLimiterParamsEventFilter; 77 | }; 78 | 79 | estimateGas: {}; 80 | 81 | populateTransaction: {}; 82 | } 83 | -------------------------------------------------------------------------------- /types/ILPPriceFeed.sol/ILPPriceFeedExceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface ILPPriceFeedExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface ILPPriceFeedExceptions extends BaseContract { 21 | contractName: "ILPPriceFeedExceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: ILPPriceFeedExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/ILPPriceFeed.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { ILPPriceFeed } from "./ILPPriceFeed"; 5 | export type { ILPPriceFeedEvents } from "./ILPPriceFeedEvents"; 6 | export type { ILPPriceFeedExceptions } from "./ILPPriceFeedExceptions"; 7 | -------------------------------------------------------------------------------- /types/IPoolService.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IPoolService } from "./IPoolService"; 5 | export type { IPoolServiceEvents } from "./IPoolServiceEvents"; 6 | -------------------------------------------------------------------------------- /types/IPriceOracle.sol/IPriceOracleV2Events.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | import type { EventFragment } from "@ethersproject/abi"; 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | PromiseOrValue, 13 | } from "../common"; 14 | 15 | export interface IPriceOracleV2EventsInterface extends utils.Interface { 16 | functions: {}; 17 | 18 | events: { 19 | "NewPriceFeed(address,address)": EventFragment; 20 | }; 21 | 22 | getEvent(nameOrSignatureOrTopic: "NewPriceFeed"): EventFragment; 23 | } 24 | 25 | export interface NewPriceFeedEventObject { 26 | token: string; 27 | priceFeed: string; 28 | } 29 | export type NewPriceFeedEvent = TypedEvent< 30 | [string, string], 31 | NewPriceFeedEventObject 32 | >; 33 | 34 | export type NewPriceFeedEventFilter = TypedEventFilter; 35 | 36 | export interface IPriceOracleV2Events extends BaseContract { 37 | contractName: "IPriceOracleV2Events"; 38 | 39 | connect(signerOrProvider: Signer | Provider | string): this; 40 | attach(addressOrName: string): this; 41 | deployed(): Promise; 42 | 43 | interface: IPriceOracleV2EventsInterface; 44 | 45 | queryFilter( 46 | event: TypedEventFilter, 47 | fromBlockOrBlockhash?: string | number | undefined, 48 | toBlock?: string | number | undefined 49 | ): Promise>; 50 | 51 | listeners( 52 | eventFilter?: TypedEventFilter 53 | ): Array>; 54 | listeners(eventName?: string): Array; 55 | removeAllListeners( 56 | eventFilter: TypedEventFilter 57 | ): this; 58 | removeAllListeners(eventName?: string): this; 59 | off: OnEvent; 60 | on: OnEvent; 61 | once: OnEvent; 62 | removeListener: OnEvent; 63 | 64 | functions: {}; 65 | 66 | callStatic: {}; 67 | 68 | filters: { 69 | "NewPriceFeed(address,address)"( 70 | token?: PromiseOrValue | null, 71 | priceFeed?: PromiseOrValue | null 72 | ): NewPriceFeedEventFilter; 73 | NewPriceFeed( 74 | token?: PromiseOrValue | null, 75 | priceFeed?: PromiseOrValue | null 76 | ): NewPriceFeedEventFilter; 77 | }; 78 | 79 | estimateGas: {}; 80 | 81 | populateTransaction: {}; 82 | } 83 | -------------------------------------------------------------------------------- /types/IPriceOracle.sol/IPriceOracleV2Exceptions.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "../common"; 13 | 14 | export interface IPriceOracleV2ExceptionsInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface IPriceOracleV2Exceptions extends BaseContract { 21 | contractName: "IPriceOracleV2Exceptions"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: IPriceOracleV2ExceptionsInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/IPriceOracle.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IPriceOracle } from "./IPriceOracle"; 5 | export type { IPriceOracleV2 } from "./IPriceOracleV2"; 6 | export type { IPriceOracleV2Events } from "./IPriceOracleV2Events"; 7 | export type { IPriceOracleV2Exceptions } from "./IPriceOracleV2Exceptions"; 8 | export type { IPriceOracleV2Ext } from "./IPriceOracleV2Ext"; 9 | -------------------------------------------------------------------------------- /types/IVersion.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { 5 | BaseContract, 6 | BigNumber, 7 | BytesLike, 8 | CallOverrides, 9 | PopulatedTransaction, 10 | Signer, 11 | utils, 12 | } from "ethers"; 13 | import type { FunctionFragment, Result } from "@ethersproject/abi"; 14 | import type { Listener, Provider } from "@ethersproject/providers"; 15 | import type { 16 | TypedEventFilter, 17 | TypedEvent, 18 | TypedListener, 19 | OnEvent, 20 | } from "./common"; 21 | 22 | export interface IVersionInterface extends utils.Interface { 23 | functions: { 24 | "version()": FunctionFragment; 25 | }; 26 | 27 | getFunction(nameOrSignatureOrTopic: "version"): FunctionFragment; 28 | 29 | encodeFunctionData(functionFragment: "version", values?: undefined): string; 30 | 31 | decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; 32 | 33 | events: {}; 34 | } 35 | 36 | export interface IVersion extends BaseContract { 37 | contractName: "IVersion"; 38 | 39 | connect(signerOrProvider: Signer | Provider | string): this; 40 | attach(addressOrName: string): this; 41 | deployed(): Promise; 42 | 43 | interface: IVersionInterface; 44 | 45 | queryFilter( 46 | event: TypedEventFilter, 47 | fromBlockOrBlockhash?: string | number | undefined, 48 | toBlock?: string | number | undefined 49 | ): Promise>; 50 | 51 | listeners( 52 | eventFilter?: TypedEventFilter 53 | ): Array>; 54 | listeners(eventName?: string): Array; 55 | removeAllListeners( 56 | eventFilter: TypedEventFilter 57 | ): this; 58 | removeAllListeners(eventName?: string): this; 59 | off: OnEvent; 60 | on: OnEvent; 61 | once: OnEvent; 62 | removeListener: OnEvent; 63 | 64 | functions: { 65 | version(overrides?: CallOverrides): Promise<[BigNumber]>; 66 | }; 67 | 68 | version(overrides?: CallOverrides): Promise; 69 | 70 | callStatic: { 71 | version(overrides?: CallOverrides): Promise; 72 | }; 73 | 74 | filters: {}; 75 | 76 | estimateGas: { 77 | version(overrides?: CallOverrides): Promise; 78 | }; 79 | 80 | populateTransaction: { 81 | version(overrides?: CallOverrides): Promise; 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /types/Initializable.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | import type { EventFragment } from "@ethersproject/abi"; 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "./common"; 13 | 14 | export interface InitializableInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: { 18 | "Initialized(uint8)": EventFragment; 19 | }; 20 | 21 | getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment; 22 | } 23 | 24 | export interface InitializedEventObject { 25 | version: number; 26 | } 27 | export type InitializedEvent = TypedEvent<[number], InitializedEventObject>; 28 | 29 | export type InitializedEventFilter = TypedEventFilter; 30 | 31 | export interface Initializable extends BaseContract { 32 | contractName: "Initializable"; 33 | 34 | connect(signerOrProvider: Signer | Provider | string): this; 35 | attach(addressOrName: string): this; 36 | deployed(): Promise; 37 | 38 | interface: InitializableInterface; 39 | 40 | queryFilter( 41 | event: TypedEventFilter, 42 | fromBlockOrBlockhash?: string | number | undefined, 43 | toBlock?: string | number | undefined 44 | ): Promise>; 45 | 46 | listeners( 47 | eventFilter?: TypedEventFilter 48 | ): Array>; 49 | listeners(eventName?: string): Array; 50 | removeAllListeners( 51 | eventFilter: TypedEventFilter 52 | ): this; 53 | removeAllListeners(eventName?: string): this; 54 | off: OnEvent; 55 | on: OnEvent; 56 | once: OnEvent; 57 | removeListener: OnEvent; 58 | 59 | functions: {}; 60 | 61 | callStatic: {}; 62 | 63 | filters: { 64 | "Initialized(uint8)"(version?: null): InitializedEventFilter; 65 | Initialized(version?: null): InitializedEventFilter; 66 | }; 67 | 68 | estimateGas: {}; 69 | 70 | populateTransaction: {}; 71 | } 72 | -------------------------------------------------------------------------------- /types/PriceFeedChecker.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { BaseContract, Signer, utils } from "ethers"; 5 | 6 | import type { Listener, Provider } from "@ethersproject/providers"; 7 | import type { 8 | TypedEventFilter, 9 | TypedEvent, 10 | TypedListener, 11 | OnEvent, 12 | } from "./common"; 13 | 14 | export interface PriceFeedCheckerInterface extends utils.Interface { 15 | functions: {}; 16 | 17 | events: {}; 18 | } 19 | 20 | export interface PriceFeedChecker extends BaseContract { 21 | contractName: "PriceFeedChecker"; 22 | 23 | connect(signerOrProvider: Signer | Provider | string): this; 24 | attach(addressOrName: string): this; 25 | deployed(): Promise; 26 | 27 | interface: PriceFeedCheckerInterface; 28 | 29 | queryFilter( 30 | event: TypedEventFilter, 31 | fromBlockOrBlockhash?: string | number | undefined, 32 | toBlock?: string | number | undefined 33 | ): Promise>; 34 | 35 | listeners( 36 | eventFilter?: TypedEventFilter 37 | ): Array>; 38 | listeners(eventName?: string): Array; 39 | removeAllListeners( 40 | eventFilter: TypedEventFilter 41 | ): this; 42 | removeAllListeners(eventName?: string): this; 43 | off: OnEvent; 44 | on: OnEvent; 45 | once: OnEvent; 46 | removeListener: OnEvent; 47 | 48 | functions: {}; 49 | 50 | callStatic: {}; 51 | 52 | filters: {}; 53 | 54 | estimateGas: {}; 55 | 56 | populateTransaction: {}; 57 | } 58 | -------------------------------------------------------------------------------- /types/cheatCodes.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { CheatCodes } from "./CheatCodes"; 5 | -------------------------------------------------------------------------------- /types/common.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import type { Listener } from "@ethersproject/providers"; 5 | import type { Event, EventFilter } from "ethers"; 6 | 7 | export interface TypedEvent< 8 | TArgsArray extends Array = any, 9 | TArgsObject = any 10 | > extends Event { 11 | args: TArgsArray & TArgsObject; 12 | } 13 | 14 | export interface TypedEventFilter<_TEvent extends TypedEvent> 15 | extends EventFilter {} 16 | 17 | export interface TypedListener { 18 | (...listenerArg: [...__TypechainArgsArray, TEvent]): void; 19 | } 20 | 21 | type __TypechainArgsArray = T extends TypedEvent ? U : never; 22 | 23 | export interface OnEvent { 24 | ( 25 | eventFilter: TypedEventFilter, 26 | listener: TypedListener 27 | ): TRes; 28 | (eventName: string, listener: Listener): TRes; 29 | } 30 | 31 | export type MinEthersFactory = { 32 | deploy(...a: ARGS[]): Promise; 33 | }; 34 | 35 | export type GetContractTypeFromFactory = F extends MinEthersFactory< 36 | infer C, 37 | any 38 | > 39 | ? C 40 | : never; 41 | 42 | export type GetARGsTypeFromFactory = F extends MinEthersFactory 43 | ? Parameters 44 | : never; 45 | 46 | export type PromiseOrValue = T | Promise; 47 | -------------------------------------------------------------------------------- /types/draft-IERC20Permit.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { IERC20Permit } from "./IERC20Permit"; 5 | -------------------------------------------------------------------------------- /types/factories/ACLTrait__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { ACLTrait, ACLTraitInterface } from "../ACLTrait"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [], 12 | name: "CallerNotPausableAdminException", 13 | type: "error", 14 | }, 15 | { 16 | inputs: [], 17 | name: "CallerNotUnPausableAdminException", 18 | type: "error", 19 | }, 20 | { 21 | inputs: [], 22 | name: "ZeroAddressException", 23 | type: "error", 24 | }, 25 | { 26 | anonymous: false, 27 | inputs: [ 28 | { 29 | indexed: false, 30 | internalType: "address", 31 | name: "account", 32 | type: "address", 33 | }, 34 | ], 35 | name: "Paused", 36 | type: "event", 37 | }, 38 | { 39 | anonymous: false, 40 | inputs: [ 41 | { 42 | indexed: false, 43 | internalType: "address", 44 | name: "account", 45 | type: "address", 46 | }, 47 | ], 48 | name: "Unpaused", 49 | type: "event", 50 | }, 51 | { 52 | inputs: [], 53 | name: "_acl", 54 | outputs: [ 55 | { 56 | internalType: "contract IACL", 57 | name: "", 58 | type: "address", 59 | }, 60 | ], 61 | stateMutability: "view", 62 | type: "function", 63 | }, 64 | { 65 | inputs: [], 66 | name: "pause", 67 | outputs: [], 68 | stateMutability: "nonpayable", 69 | type: "function", 70 | }, 71 | { 72 | inputs: [], 73 | name: "paused", 74 | outputs: [ 75 | { 76 | internalType: "bool", 77 | name: "", 78 | type: "bool", 79 | }, 80 | ], 81 | stateMutability: "view", 82 | type: "function", 83 | }, 84 | { 85 | inputs: [], 86 | name: "unpause", 87 | outputs: [], 88 | stateMutability: "nonpayable", 89 | type: "function", 90 | }, 91 | ] as const; 92 | 93 | export class ACLTrait__factory { 94 | static readonly abi = _abi; 95 | static createInterface(): ACLTraitInterface { 96 | return new utils.Interface(_abi) as ACLTraitInterface; 97 | } 98 | static connect( 99 | address: string, 100 | signerOrProvider: Signer | Provider 101 | ): ACLTrait { 102 | return new Contract(address, _abi, signerOrProvider) as ACLTrait; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /types/factories/Balances.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { BalanceOps__factory } from "./BalanceOps__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/BlacklistHelper.sol/IBlacklistableUSDC__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IBlacklistableUSDC, 9 | IBlacklistableUSDCInterface, 10 | } from "../../BlacklistHelper.sol/IBlacklistableUSDC"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "address", 17 | name: "_account", 18 | type: "address", 19 | }, 20 | ], 21 | name: "isBlacklisted", 22 | outputs: [ 23 | { 24 | internalType: "bool", 25 | name: "", 26 | type: "bool", 27 | }, 28 | ], 29 | stateMutability: "view", 30 | type: "function", 31 | }, 32 | ] as const; 33 | 34 | export class IBlacklistableUSDC__factory { 35 | static readonly abi = _abi; 36 | static createInterface(): IBlacklistableUSDCInterface { 37 | return new utils.Interface(_abi) as IBlacklistableUSDCInterface; 38 | } 39 | static connect( 40 | address: string, 41 | signerOrProvider: Signer | Provider 42 | ): IBlacklistableUSDC { 43 | return new Contract(address, _abi, signerOrProvider) as IBlacklistableUSDC; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/factories/BlacklistHelper.sol/IBlacklistableUSDT__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IBlacklistableUSDT, 9 | IBlacklistableUSDTInterface, 10 | } from "../../BlacklistHelper.sol/IBlacklistableUSDT"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "address", 17 | name: "_account", 18 | type: "address", 19 | }, 20 | ], 21 | name: "isBlackListed", 22 | outputs: [ 23 | { 24 | internalType: "bool", 25 | name: "", 26 | type: "bool", 27 | }, 28 | ], 29 | stateMutability: "view", 30 | type: "function", 31 | }, 32 | ] as const; 33 | 34 | export class IBlacklistableUSDT__factory { 35 | static readonly abi = _abi; 36 | static createInterface(): IBlacklistableUSDTInterface { 37 | return new utils.Interface(_abi) as IBlacklistableUSDTInterface; 38 | } 39 | static connect( 40 | address: string, 41 | signerOrProvider: Signer | Provider 42 | ): IBlacklistableUSDT { 43 | return new Contract(address, _abi, signerOrProvider) as IBlacklistableUSDT; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/factories/BlacklistHelper.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { BlacklistHelper__factory } from "./BlacklistHelper__factory"; 5 | export { IBlacklistableUSDC__factory } from "./IBlacklistableUSDC__factory"; 6 | export { IBlacklistableUSDT__factory } from "./IBlacklistableUSDT__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/BoundedPriceFeed.sol/ChainlinkReadableAggregator__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ChainlinkReadableAggregator, 9 | ChainlinkReadableAggregatorInterface, 10 | } from "../../BoundedPriceFeed.sol/ChainlinkReadableAggregator"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "aggregator", 16 | outputs: [ 17 | { 18 | internalType: "address", 19 | name: "", 20 | type: "address", 21 | }, 22 | ], 23 | stateMutability: "view", 24 | type: "function", 25 | }, 26 | { 27 | inputs: [ 28 | { 29 | internalType: "uint16", 30 | name: "idx", 31 | type: "uint16", 32 | }, 33 | ], 34 | name: "phaseAggregators", 35 | outputs: [ 36 | { 37 | internalType: "contract AggregatorV2V3Interface", 38 | name: "", 39 | type: "address", 40 | }, 41 | ], 42 | stateMutability: "view", 43 | type: "function", 44 | }, 45 | { 46 | inputs: [], 47 | name: "phaseId", 48 | outputs: [ 49 | { 50 | internalType: "uint16", 51 | name: "", 52 | type: "uint16", 53 | }, 54 | ], 55 | stateMutability: "view", 56 | type: "function", 57 | }, 58 | ] as const; 59 | 60 | export class ChainlinkReadableAggregator__factory { 61 | static readonly abi = _abi; 62 | static createInterface(): ChainlinkReadableAggregatorInterface { 63 | return new utils.Interface(_abi) as ChainlinkReadableAggregatorInterface; 64 | } 65 | static connect( 66 | address: string, 67 | signerOrProvider: Signer | Provider 68 | ): ChainlinkReadableAggregator { 69 | return new Contract( 70 | address, 71 | _abi, 72 | signerOrProvider 73 | ) as ChainlinkReadableAggregator; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /types/factories/BoundedPriceFeed.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { BoundedPriceFeed__factory } from "./BoundedPriceFeed__factory"; 5 | export { ChainlinkReadableAggregator__factory } from "./ChainlinkReadableAggregator__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/Constants.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { Roles__factory } from "./Roles__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/ERC165__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { ERC165, ERC165Interface } from "../ERC165"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes4", 14 | name: "interfaceId", 15 | type: "bytes4", 16 | }, 17 | ], 18 | name: "supportsInterface", 19 | outputs: [ 20 | { 21 | internalType: "bool", 22 | name: "", 23 | type: "bool", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ] as const; 30 | 31 | export class ERC165__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): ERC165Interface { 34 | return new utils.Interface(_abi) as ERC165Interface; 35 | } 36 | static connect(address: string, signerOrProvider: Signer | Provider): ERC165 { 37 | return new Contract(address, _abi, signerOrProvider) as ERC165; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /types/factories/ERC20ApproveRestricted.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ERC20ApproveRestrictedFalse__factory } from "./ERC20ApproveRestrictedFalse__factory"; 5 | export { ERC20ApproveRestrictedRevert__factory } from "./ERC20ApproveRestrictedRevert__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/ERC20Blacklistable.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ERC20BlacklistableMock__factory } from "./ERC20BlacklistableMock__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/ERC20Blocking.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ERC20BlockingMock__factory } from "./ERC20BlockingMock__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/ERC20Fee.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { TokenFeeMock__factory } from "./TokenFeeMock__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/ERC20NonCompliant.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { NonCompliantERC20__factory } from "./NonCompliantERC20__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/IACL.sol/IACLEvents__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IACLEvents, 9 | IACLEventsInterface, 10 | } from "../../IACL.sol/IACLEvents"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "newAdmin", 20 | type: "address", 21 | }, 22 | ], 23 | name: "PausableAdminAdded", 24 | type: "event", 25 | }, 26 | { 27 | anonymous: false, 28 | inputs: [ 29 | { 30 | indexed: true, 31 | internalType: "address", 32 | name: "admin", 33 | type: "address", 34 | }, 35 | ], 36 | name: "PausableAdminRemoved", 37 | type: "event", 38 | }, 39 | { 40 | anonymous: false, 41 | inputs: [ 42 | { 43 | indexed: true, 44 | internalType: "address", 45 | name: "newAdmin", 46 | type: "address", 47 | }, 48 | ], 49 | name: "UnpausableAdminAdded", 50 | type: "event", 51 | }, 52 | { 53 | anonymous: false, 54 | inputs: [ 55 | { 56 | indexed: true, 57 | internalType: "address", 58 | name: "admin", 59 | type: "address", 60 | }, 61 | ], 62 | name: "UnpausableAdminRemoved", 63 | type: "event", 64 | }, 65 | ] as const; 66 | 67 | export class IACLEvents__factory { 68 | static readonly abi = _abi; 69 | static createInterface(): IACLEventsInterface { 70 | return new utils.Interface(_abi) as IACLEventsInterface; 71 | } 72 | static connect( 73 | address: string, 74 | signerOrProvider: Signer | Provider 75 | ): IACLEvents { 76 | return new Contract(address, _abi, signerOrProvider) as IACLEvents; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /types/factories/IACL.sol/IACLExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IACLExceptions, 9 | IACLExceptionsInterface, 10 | } from "../../IACL.sol/IACLExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "address", 17 | name: "addr", 18 | type: "address", 19 | }, 20 | ], 21 | name: "AddressNotPausableAdminException", 22 | type: "error", 23 | }, 24 | { 25 | inputs: [ 26 | { 27 | internalType: "address", 28 | name: "addr", 29 | type: "address", 30 | }, 31 | ], 32 | name: "AddressNotUnpausableAdminException", 33 | type: "error", 34 | }, 35 | ] as const; 36 | 37 | export class IACLExceptions__factory { 38 | static readonly abi = _abi; 39 | static createInterface(): IACLExceptionsInterface { 40 | return new utils.Interface(_abi) as IACLExceptionsInterface; 41 | } 42 | static connect( 43 | address: string, 44 | signerOrProvider: Signer | Provider 45 | ): IACLExceptions { 46 | return new Contract(address, _abi, signerOrProvider) as IACLExceptions; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /types/factories/IACL.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IACL__factory } from "./IACL__factory"; 5 | export { IACLEvents__factory } from "./IACLEvents__factory"; 6 | export { IACLExceptions__factory } from "./IACLExceptions__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/IAccountFactory.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IAccountFactory__factory } from "./IAccountFactory__factory"; 5 | export { IAccountFactoryEvents__factory } from "./IAccountFactoryEvents__factory"; 6 | export { IAccountFactoryGetters__factory } from "./IAccountFactoryGetters__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/IAdapter.sol/IAdapterExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IAdapterExceptions, 9 | IAdapterExceptionsInterface, 10 | } from "../../IAdapter.sol/IAdapterExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "CallerNotConfiguratorException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "CreditFacadeOnlyException", 21 | type: "error", 22 | }, 23 | { 24 | inputs: [], 25 | name: "TokenNotAllowedException", 26 | type: "error", 27 | }, 28 | ] as const; 29 | 30 | export class IAdapterExceptions__factory { 31 | static readonly abi = _abi; 32 | static createInterface(): IAdapterExceptionsInterface { 33 | return new utils.Interface(_abi) as IAdapterExceptionsInterface; 34 | } 35 | static connect( 36 | address: string, 37 | signerOrProvider: Signer | Provider 38 | ): IAdapterExceptions { 39 | return new Contract(address, _abi, signerOrProvider) as IAdapterExceptions; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /types/factories/IAdapter.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IAdapter__factory } from "./IAdapter__factory"; 5 | export { IAdapterExceptions__factory } from "./IAdapterExceptions__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IAddressProvider.sol/IAddressProviderEvents__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IAddressProviderEvents, 9 | IAddressProviderEventsInterface, 10 | } from "../../IAddressProvider.sol/IAddressProviderEvents"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "bytes32", 19 | name: "service", 20 | type: "bytes32", 21 | }, 22 | { 23 | indexed: true, 24 | internalType: "address", 25 | name: "newAddress", 26 | type: "address", 27 | }, 28 | ], 29 | name: "AddressSet", 30 | type: "event", 31 | }, 32 | ] as const; 33 | 34 | export class IAddressProviderEvents__factory { 35 | static readonly abi = _abi; 36 | static createInterface(): IAddressProviderEventsInterface { 37 | return new utils.Interface(_abi) as IAddressProviderEventsInterface; 38 | } 39 | static connect( 40 | address: string, 41 | signerOrProvider: Signer | Provider 42 | ): IAddressProviderEvents { 43 | return new Contract( 44 | address, 45 | _abi, 46 | signerOrProvider 47 | ) as IAddressProviderEvents; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /types/factories/IAddressProvider.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IAddressProvider__factory } from "./IAddressProvider__factory"; 5 | export { IAddressProviderEvents__factory } from "./IAddressProviderEvents__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IAirdropDistributor.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IAirdropDistributor__factory } from "./IAirdropDistributor__factory"; 5 | export { IAirdropDistributorEvents__factory } from "./IAirdropDistributorEvents__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IBlacklistHelper.sol/IBlacklistHelperExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IBlacklistHelperExceptions, 9 | IBlacklistHelperExceptionsInterface, 10 | } from "../../IBlacklistHelper.sol/IBlacklistHelperExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "CreditFacadeNonBlacklistable", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "CreditFacadeOnlyException", 21 | type: "error", 22 | }, 23 | { 24 | inputs: [], 25 | name: "NothingToClaimException", 26 | type: "error", 27 | }, 28 | ] as const; 29 | 30 | export class IBlacklistHelperExceptions__factory { 31 | static readonly abi = _abi; 32 | static createInterface(): IBlacklistHelperExceptionsInterface { 33 | return new utils.Interface(_abi) as IBlacklistHelperExceptionsInterface; 34 | } 35 | static connect( 36 | address: string, 37 | signerOrProvider: Signer | Provider 38 | ): IBlacklistHelperExceptions { 39 | return new Contract( 40 | address, 41 | _abi, 42 | signerOrProvider 43 | ) as IBlacklistHelperExceptions; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/factories/IBlacklistHelper.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IBlacklistHelper__factory } from "./IBlacklistHelper__factory"; 5 | export { IBlacklistHelperEvents__factory } from "./IBlacklistHelperEvents__factory"; 6 | export { IBlacklistHelperExceptions__factory } from "./IBlacklistHelperExceptions__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/IContractsRegister.sol/IContractsRegisterEvents__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IContractsRegisterEvents, 9 | IContractsRegisterEventsInterface, 10 | } from "../../IContractsRegister.sol/IContractsRegisterEvents"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "creditManager", 20 | type: "address", 21 | }, 22 | ], 23 | name: "NewCreditManagerAdded", 24 | type: "event", 25 | }, 26 | { 27 | anonymous: false, 28 | inputs: [ 29 | { 30 | indexed: true, 31 | internalType: "address", 32 | name: "pool", 33 | type: "address", 34 | }, 35 | ], 36 | name: "NewPoolAdded", 37 | type: "event", 38 | }, 39 | ] as const; 40 | 41 | export class IContractsRegisterEvents__factory { 42 | static readonly abi = _abi; 43 | static createInterface(): IContractsRegisterEventsInterface { 44 | return new utils.Interface(_abi) as IContractsRegisterEventsInterface; 45 | } 46 | static connect( 47 | address: string, 48 | signerOrProvider: Signer | Provider 49 | ): IContractsRegisterEvents { 50 | return new Contract( 51 | address, 52 | _abi, 53 | signerOrProvider 54 | ) as IContractsRegisterEvents; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /types/factories/IContractsRegister.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IContractsRegister__factory } from "./IContractsRegister__factory"; 5 | export { IContractsRegisterEvents__factory } from "./IContractsRegisterEvents__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/ICreditAccount.sol/ICrediAccountExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ICrediAccountExceptions, 9 | ICrediAccountExceptionsInterface, 10 | } from "../../ICreditAccount.sol/ICrediAccountExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "CallerNotCreditManagerException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "CallerNotFactoryException", 21 | type: "error", 22 | }, 23 | ] as const; 24 | 25 | export class ICrediAccountExceptions__factory { 26 | static readonly abi = _abi; 27 | static createInterface(): ICrediAccountExceptionsInterface { 28 | return new utils.Interface(_abi) as ICrediAccountExceptionsInterface; 29 | } 30 | static connect( 31 | address: string, 32 | signerOrProvider: Signer | Provider 33 | ): ICrediAccountExceptions { 34 | return new Contract( 35 | address, 36 | _abi, 37 | signerOrProvider 38 | ) as ICrediAccountExceptions; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /types/factories/ICreditAccount.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ICrediAccountExceptions__factory } from "./ICrediAccountExceptions__factory"; 5 | export { ICreditAccount__factory } from "./ICreditAccount__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/ICreditConfigurator.sol/ICreditConfiguratorExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ICreditConfiguratorExceptions, 9 | ICreditConfiguratorExceptionsInterface, 10 | } from "../../ICreditConfigurator.sol/ICreditConfiguratorExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "AdapterUsedTwiceException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "ContractIsNotAnAllowedAdapterException", 21 | type: "error", 22 | }, 23 | { 24 | inputs: [], 25 | name: "CreditManagerOrFacadeUsedAsTargetContractsException", 26 | type: "error", 27 | }, 28 | { 29 | inputs: [], 30 | name: "IncompatibleContractException", 31 | type: "error", 32 | }, 33 | { 34 | inputs: [], 35 | name: "IncorrectExpirationDateException", 36 | type: "error", 37 | }, 38 | { 39 | inputs: [], 40 | name: "IncorrectFeesException", 41 | type: "error", 42 | }, 43 | { 44 | inputs: [], 45 | name: "IncorrectLimitsException", 46 | type: "error", 47 | }, 48 | { 49 | inputs: [], 50 | name: "IncorrectLiquidationThresholdException", 51 | type: "error", 52 | }, 53 | { 54 | inputs: [], 55 | name: "SetLTForUnderlyingException", 56 | type: "error", 57 | }, 58 | ] as const; 59 | 60 | export class ICreditConfiguratorExceptions__factory { 61 | static readonly abi = _abi; 62 | static createInterface(): ICreditConfiguratorExceptionsInterface { 63 | return new utils.Interface(_abi) as ICreditConfiguratorExceptionsInterface; 64 | } 65 | static connect( 66 | address: string, 67 | signerOrProvider: Signer | Provider 68 | ): ICreditConfiguratorExceptions { 69 | return new Contract( 70 | address, 71 | _abi, 72 | signerOrProvider 73 | ) as ICreditConfiguratorExceptions; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /types/factories/ICreditConfigurator.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ICreditConfigurator__factory } from "./ICreditConfigurator__factory"; 5 | export { ICreditConfiguratorEvents__factory } from "./ICreditConfiguratorEvents__factory"; 6 | export { ICreditConfiguratorExceptions__factory } from "./ICreditConfiguratorExceptions__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/ICreditFacade.sol/ICreditFacadeV2__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ICreditFacadeV2, 9 | ICreditFacadeV2Interface, 10 | } from "../../ICreditFacade.sol/ICreditFacadeV2"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "params", 16 | outputs: [ 17 | { 18 | internalType: "uint128", 19 | name: "maxBorrowedAmountPerBlock", 20 | type: "uint128", 21 | }, 22 | { 23 | internalType: "bool", 24 | name: "isIncreaseDebtForbidden", 25 | type: "bool", 26 | }, 27 | { 28 | internalType: "uint40", 29 | name: "expirationDate", 30 | type: "uint40", 31 | }, 32 | ], 33 | stateMutability: "view", 34 | type: "function", 35 | }, 36 | ] as const; 37 | 38 | export class ICreditFacadeV2__factory { 39 | static readonly abi = _abi; 40 | static createInterface(): ICreditFacadeV2Interface { 41 | return new utils.Interface(_abi) as ICreditFacadeV2Interface; 42 | } 43 | static connect( 44 | address: string, 45 | signerOrProvider: Signer | Provider 46 | ): ICreditFacadeV2 { 47 | return new Contract(address, _abi, signerOrProvider) as ICreditFacadeV2; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /types/factories/ICreditFacade.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ICreditFacade__factory } from "./ICreditFacade__factory"; 5 | export { ICreditFacadeEvents__factory } from "./ICreditFacadeEvents__factory"; 6 | export { ICreditFacadeExceptions__factory } from "./ICreditFacadeExceptions__factory"; 7 | export { ICreditFacadeExtended__factory } from "./ICreditFacadeExtended__factory"; 8 | export { ICreditFacadeV2__factory } from "./ICreditFacadeV2__factory"; 9 | -------------------------------------------------------------------------------- /types/factories/ICreditManagerV2.sol/ICreditManagerV2Events__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ICreditManagerV2Events, 9 | ICreditManagerV2EventsInterface, 10 | } from "../../ICreditManagerV2.sol/ICreditManagerV2Events"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "borrower", 20 | type: "address", 21 | }, 22 | { 23 | indexed: true, 24 | internalType: "address", 25 | name: "target", 26 | type: "address", 27 | }, 28 | ], 29 | name: "ExecuteOrder", 30 | type: "event", 31 | }, 32 | { 33 | anonymous: false, 34 | inputs: [ 35 | { 36 | indexed: true, 37 | internalType: "address", 38 | name: "newConfigurator", 39 | type: "address", 40 | }, 41 | ], 42 | name: "NewConfigurator", 43 | type: "event", 44 | }, 45 | ] as const; 46 | 47 | export class ICreditManagerV2Events__factory { 48 | static readonly abi = _abi; 49 | static createInterface(): ICreditManagerV2EventsInterface { 50 | return new utils.Interface(_abi) as ICreditManagerV2EventsInterface; 51 | } 52 | static connect( 53 | address: string, 54 | signerOrProvider: Signer | Provider 55 | ): ICreditManagerV2Events { 56 | return new Contract( 57 | address, 58 | _abi, 59 | signerOrProvider 60 | ) as ICreditManagerV2Events; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /types/factories/ICreditManagerV2.sol/ICreditManagerV2Exceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ICreditManagerV2Exceptions, 9 | ICreditManagerV2ExceptionsInterface, 10 | } from "../../ICreditManagerV2.sol/ICreditManagerV2Exceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "AdaptersOrCreditFacadeOnlyException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "AllowanceFailedException", 21 | type: "error", 22 | }, 23 | { 24 | inputs: [], 25 | name: "CreditConfiguratorOnlyException", 26 | type: "error", 27 | }, 28 | { 29 | inputs: [], 30 | name: "CreditFacadeOnlyException", 31 | type: "error", 32 | }, 33 | { 34 | inputs: [], 35 | name: "HasNoOpenedAccountException", 36 | type: "error", 37 | }, 38 | { 39 | inputs: [], 40 | name: "NotEnoughCollateralException", 41 | type: "error", 42 | }, 43 | { 44 | inputs: [], 45 | name: "ReentrancyLockException", 46 | type: "error", 47 | }, 48 | { 49 | inputs: [], 50 | name: "TargetContractNotAllowedException", 51 | type: "error", 52 | }, 53 | { 54 | inputs: [], 55 | name: "TokenAlreadyAddedException", 56 | type: "error", 57 | }, 58 | { 59 | inputs: [], 60 | name: "TokenNotAllowedException", 61 | type: "error", 62 | }, 63 | { 64 | inputs: [], 65 | name: "TooManyEnabledTokensException", 66 | type: "error", 67 | }, 68 | { 69 | inputs: [], 70 | name: "TooManyTokensException", 71 | type: "error", 72 | }, 73 | { 74 | inputs: [], 75 | name: "ZeroAddressOrUserAlreadyHasAccountException", 76 | type: "error", 77 | }, 78 | ] as const; 79 | 80 | export class ICreditManagerV2Exceptions__factory { 81 | static readonly abi = _abi; 82 | static createInterface(): ICreditManagerV2ExceptionsInterface { 83 | return new utils.Interface(_abi) as ICreditManagerV2ExceptionsInterface; 84 | } 85 | static connect( 86 | address: string, 87 | signerOrProvider: Signer | Provider 88 | ): ICreditManagerV2Exceptions { 89 | return new Contract( 90 | address, 91 | _abi, 92 | signerOrProvider 93 | ) as ICreditManagerV2Exceptions; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /types/factories/ICreditManagerV2.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ICreditManagerV2__factory } from "./ICreditManagerV2__factory"; 5 | export { ICreditManagerV2Events__factory } from "./ICreditManagerV2Events__factory"; 6 | export { ICreditManagerV2Exceptions__factory } from "./ICreditManagerV2Exceptions__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/IDataCompressor.sol/IDataCompressorExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IDataCompressorExceptions, 9 | IDataCompressorExceptionsInterface, 10 | } from "../../IDataCompressor.sol/IDataCompressorExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "NotCreditManagerException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "NotPoolException", 21 | type: "error", 22 | }, 23 | ] as const; 24 | 25 | export class IDataCompressorExceptions__factory { 26 | static readonly abi = _abi; 27 | static createInterface(): IDataCompressorExceptionsInterface { 28 | return new utils.Interface(_abi) as IDataCompressorExceptionsInterface; 29 | } 30 | static connect( 31 | address: string, 32 | signerOrProvider: Signer | Provider 33 | ): IDataCompressorExceptions { 34 | return new Contract( 35 | address, 36 | _abi, 37 | signerOrProvider 38 | ) as IDataCompressorExceptions; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /types/factories/IDataCompressor.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IDataCompressor__factory } from "./IDataCompressor__factory"; 5 | export { IDataCompressorExceptions__factory } from "./IDataCompressorExceptions__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IDegenDistributor.sol/IDegenDistributorEvents__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IDegenDistributorEvents, 9 | IDegenDistributorEventsInterface, 10 | } from "../../IDegenDistributor.sol/IDegenDistributorEvents"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "account", 20 | type: "address", 21 | }, 22 | { 23 | indexed: false, 24 | internalType: "uint256", 25 | name: "amount", 26 | type: "uint256", 27 | }, 28 | ], 29 | name: "Claimed", 30 | type: "event", 31 | }, 32 | { 33 | anonymous: false, 34 | inputs: [ 35 | { 36 | indexed: false, 37 | internalType: "bytes32", 38 | name: "oldRoot", 39 | type: "bytes32", 40 | }, 41 | { 42 | indexed: true, 43 | internalType: "bytes32", 44 | name: "newRoot", 45 | type: "bytes32", 46 | }, 47 | ], 48 | name: "RootUpdated", 49 | type: "event", 50 | }, 51 | ] as const; 52 | 53 | export class IDegenDistributorEvents__factory { 54 | static readonly abi = _abi; 55 | static createInterface(): IDegenDistributorEventsInterface { 56 | return new utils.Interface(_abi) as IDegenDistributorEventsInterface; 57 | } 58 | static connect( 59 | address: string, 60 | signerOrProvider: Signer | Provider 61 | ): IDegenDistributorEvents { 62 | return new Contract( 63 | address, 64 | _abi, 65 | signerOrProvider 66 | ) as IDegenDistributorEvents; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /types/factories/IDegenDistributor.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IDegenDistributor__factory } from "./IDegenDistributor__factory"; 5 | export { IDegenDistributorEvents__factory } from "./IDegenDistributorEvents__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IDegenNFT.sol/IDegenNFTEvents__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IDegenNFTEvents, 9 | IDegenNFTEventsInterface, 10 | } from "../../IDegenNFT.sol/IDegenNFTEvents"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "", 20 | type: "address", 21 | }, 22 | ], 23 | name: "NewCreditFacadeAdded", 24 | type: "event", 25 | }, 26 | { 27 | anonymous: false, 28 | inputs: [ 29 | { 30 | indexed: true, 31 | internalType: "address", 32 | name: "", 33 | type: "address", 34 | }, 35 | ], 36 | name: "NewCreditFacadeRemoved", 37 | type: "event", 38 | }, 39 | { 40 | anonymous: false, 41 | inputs: [ 42 | { 43 | indexed: true, 44 | internalType: "address", 45 | name: "", 46 | type: "address", 47 | }, 48 | ], 49 | name: "NewMinterSet", 50 | type: "event", 51 | }, 52 | ] as const; 53 | 54 | export class IDegenNFTEvents__factory { 55 | static readonly abi = _abi; 56 | static createInterface(): IDegenNFTEventsInterface { 57 | return new utils.Interface(_abi) as IDegenNFTEventsInterface; 58 | } 59 | static connect( 60 | address: string, 61 | signerOrProvider: Signer | Provider 62 | ): IDegenNFTEvents { 63 | return new Contract(address, _abi, signerOrProvider) as IDegenNFTEvents; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /types/factories/IDegenNFT.sol/IDegenNFTExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IDegenNFTExceptions, 9 | IDegenNFTExceptionsInterface, 10 | } from "../../IDegenNFT.sol/IDegenNFTExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "CreditFacadeOrConfiguratorOnlyException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "InsufficientBalanceException", 21 | type: "error", 22 | }, 23 | { 24 | inputs: [], 25 | name: "InvalidCreditFacadeException", 26 | type: "error", 27 | }, 28 | { 29 | inputs: [], 30 | name: "MinterOnlyException", 31 | type: "error", 32 | }, 33 | ] as const; 34 | 35 | export class IDegenNFTExceptions__factory { 36 | static readonly abi = _abi; 37 | static createInterface(): IDegenNFTExceptionsInterface { 38 | return new utils.Interface(_abi) as IDegenNFTExceptionsInterface; 39 | } 40 | static connect( 41 | address: string, 42 | signerOrProvider: Signer | Provider 43 | ): IDegenNFTExceptions { 44 | return new Contract(address, _abi, signerOrProvider) as IDegenNFTExceptions; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /types/factories/IDegenNFT.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IDegenNFT__factory } from "./IDegenNFT__factory"; 5 | export { IDegenNFTEvents__factory } from "./IDegenNFTEvents__factory"; 6 | export { IDegenNFTExceptions__factory } from "./IDegenNFTExceptions__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/IDieselToken.sol/IDieselTokenExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IDieselTokenExceptions, 9 | IDieselTokenExceptionsInterface, 10 | } from "../../IDieselToken.sol/IDieselTokenExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "PoolServiceOnlyException", 16 | type: "error", 17 | }, 18 | ] as const; 19 | 20 | export class IDieselTokenExceptions__factory { 21 | static readonly abi = _abi; 22 | static createInterface(): IDieselTokenExceptionsInterface { 23 | return new utils.Interface(_abi) as IDieselTokenExceptionsInterface; 24 | } 25 | static connect( 26 | address: string, 27 | signerOrProvider: Signer | Provider 28 | ): IDieselTokenExceptions { 29 | return new Contract( 30 | address, 31 | _abi, 32 | signerOrProvider 33 | ) as IDieselTokenExceptions; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /types/factories/IDieselToken.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IDieselToken__factory } from "./IDieselToken__factory"; 5 | export { IDieselTokenExceptions__factory } from "./IDieselTokenExceptions__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IERC165__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { IERC165, IERC165Interface } from "../IERC165"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "bytes4", 14 | name: "interfaceId", 15 | type: "bytes4", 16 | }, 17 | ], 18 | name: "supportsInterface", 19 | outputs: [ 20 | { 21 | internalType: "bool", 22 | name: "", 23 | type: "bool", 24 | }, 25 | ], 26 | stateMutability: "view", 27 | type: "function", 28 | }, 29 | ] as const; 30 | 31 | export class IERC165__factory { 32 | static readonly abi = _abi; 33 | static createInterface(): IERC165Interface { 34 | return new utils.Interface(_abi) as IERC165Interface; 35 | } 36 | static connect( 37 | address: string, 38 | signerOrProvider: Signer | Provider 39 | ): IERC165 { 40 | return new Contract(address, _abi, signerOrProvider) as IERC165; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /types/factories/IERC721Receiver__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IERC721Receiver, 9 | IERC721ReceiverInterface, 10 | } from "../IERC721Receiver"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "address", 17 | name: "operator", 18 | type: "address", 19 | }, 20 | { 21 | internalType: "address", 22 | name: "from", 23 | type: "address", 24 | }, 25 | { 26 | internalType: "uint256", 27 | name: "tokenId", 28 | type: "uint256", 29 | }, 30 | { 31 | internalType: "bytes", 32 | name: "data", 33 | type: "bytes", 34 | }, 35 | ], 36 | name: "onERC721Received", 37 | outputs: [ 38 | { 39 | internalType: "bytes4", 40 | name: "", 41 | type: "bytes4", 42 | }, 43 | ], 44 | stateMutability: "nonpayable", 45 | type: "function", 46 | }, 47 | ] as const; 48 | 49 | export class IERC721Receiver__factory { 50 | static readonly abi = _abi; 51 | static createInterface(): IERC721ReceiverInterface { 52 | return new utils.Interface(_abi) as IERC721ReceiverInterface; 53 | } 54 | static connect( 55 | address: string, 56 | signerOrProvider: Signer | Provider 57 | ): IERC721Receiver { 58 | return new Contract(address, _abi, signerOrProvider) as IERC721Receiver; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /types/factories/IInterestRateModel__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IInterestRateModel, 9 | IInterestRateModelInterface, 10 | } from "../IInterestRateModel"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [ 15 | { 16 | internalType: "uint256", 17 | name: "expectedLiquidity", 18 | type: "uint256", 19 | }, 20 | { 21 | internalType: "uint256", 22 | name: "availableLiquidity", 23 | type: "uint256", 24 | }, 25 | ], 26 | name: "calcBorrowRate", 27 | outputs: [ 28 | { 29 | internalType: "uint256", 30 | name: "", 31 | type: "uint256", 32 | }, 33 | ], 34 | stateMutability: "view", 35 | type: "function", 36 | }, 37 | { 38 | inputs: [], 39 | name: "version", 40 | outputs: [ 41 | { 42 | internalType: "uint256", 43 | name: "", 44 | type: "uint256", 45 | }, 46 | ], 47 | stateMutability: "view", 48 | type: "function", 49 | }, 50 | ] as const; 51 | 52 | export class IInterestRateModel__factory { 53 | static readonly abi = _abi; 54 | static createInterface(): IInterestRateModelInterface { 55 | return new utils.Interface(_abi) as IInterestRateModelInterface; 56 | } 57 | static connect( 58 | address: string, 59 | signerOrProvider: Signer | Provider 60 | ): IInterestRateModel { 61 | return new Contract(address, _abi, signerOrProvider) as IInterestRateModel; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /types/factories/ILPPriceFeed.sol/ILPPriceFeedEvents__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ILPPriceFeedEvents, 9 | ILPPriceFeedEventsInterface, 10 | } from "../../ILPPriceFeed.sol/ILPPriceFeedEvents"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: false, 18 | internalType: "uint256", 19 | name: "lowerBound", 20 | type: "uint256", 21 | }, 22 | { 23 | indexed: false, 24 | internalType: "uint256", 25 | name: "upperBound", 26 | type: "uint256", 27 | }, 28 | ], 29 | name: "NewLimiterParams", 30 | type: "event", 31 | }, 32 | ] as const; 33 | 34 | export class ILPPriceFeedEvents__factory { 35 | static readonly abi = _abi; 36 | static createInterface(): ILPPriceFeedEventsInterface { 37 | return new utils.Interface(_abi) as ILPPriceFeedEventsInterface; 38 | } 39 | static connect( 40 | address: string, 41 | signerOrProvider: Signer | Provider 42 | ): ILPPriceFeedEvents { 43 | return new Contract(address, _abi, signerOrProvider) as ILPPriceFeedEvents; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/factories/ILPPriceFeed.sol/ILPPriceFeedExceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | ILPPriceFeedExceptions, 9 | ILPPriceFeedExceptionsInterface, 10 | } from "../../ILPPriceFeed.sol/ILPPriceFeedExceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "IncorrectLimitsException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "ValueOutOfRangeException", 21 | type: "error", 22 | }, 23 | ] as const; 24 | 25 | export class ILPPriceFeedExceptions__factory { 26 | static readonly abi = _abi; 27 | static createInterface(): ILPPriceFeedExceptionsInterface { 28 | return new utils.Interface(_abi) as ILPPriceFeedExceptionsInterface; 29 | } 30 | static connect( 31 | address: string, 32 | signerOrProvider: Signer | Provider 33 | ): ILPPriceFeedExceptions { 34 | return new Contract( 35 | address, 36 | _abi, 37 | signerOrProvider 38 | ) as ILPPriceFeedExceptions; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /types/factories/ILPPriceFeed.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { ILPPriceFeed__factory } from "./ILPPriceFeed__factory"; 5 | export { ILPPriceFeedEvents__factory } from "./ILPPriceFeedEvents__factory"; 6 | export { ILPPriceFeedExceptions__factory } from "./ILPPriceFeedExceptions__factory"; 7 | -------------------------------------------------------------------------------- /types/factories/IPausable__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { IPausable, IPausableInterface } from "../IPausable"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [], 12 | name: "pause", 13 | outputs: [], 14 | stateMutability: "nonpayable", 15 | type: "function", 16 | }, 17 | ] as const; 18 | 19 | export class IPausable__factory { 20 | static readonly abi = _abi; 21 | static createInterface(): IPausableInterface { 22 | return new utils.Interface(_abi) as IPausableInterface; 23 | } 24 | static connect( 25 | address: string, 26 | signerOrProvider: Signer | Provider 27 | ): IPausable { 28 | return new Contract(address, _abi, signerOrProvider) as IPausable; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /types/factories/IPoolService.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IPoolService__factory } from "./IPoolService__factory"; 5 | export { IPoolServiceEvents__factory } from "./IPoolServiceEvents__factory"; 6 | -------------------------------------------------------------------------------- /types/factories/IPriceFeedAddress__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IPriceFeedAddress, 9 | IPriceFeedAddressInterface, 10 | } from "../IPriceFeedAddress"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "decimals", 16 | outputs: [ 17 | { 18 | internalType: "uint8", 19 | name: "", 20 | type: "uint8", 21 | }, 22 | ], 23 | stateMutability: "view", 24 | type: "function", 25 | }, 26 | { 27 | inputs: [], 28 | name: "description", 29 | outputs: [ 30 | { 31 | internalType: "string", 32 | name: "", 33 | type: "string", 34 | }, 35 | ], 36 | stateMutability: "view", 37 | type: "function", 38 | }, 39 | { 40 | inputs: [ 41 | { 42 | internalType: "address", 43 | name: "creditAccount", 44 | type: "address", 45 | }, 46 | ], 47 | name: "latestRoundData", 48 | outputs: [ 49 | { 50 | internalType: "uint80", 51 | name: "roundId", 52 | type: "uint80", 53 | }, 54 | { 55 | internalType: "int256", 56 | name: "answer", 57 | type: "int256", 58 | }, 59 | { 60 | internalType: "uint256", 61 | name: "startedAt", 62 | type: "uint256", 63 | }, 64 | { 65 | internalType: "uint256", 66 | name: "updatedAt", 67 | type: "uint256", 68 | }, 69 | { 70 | internalType: "uint80", 71 | name: "answeredInRound", 72 | type: "uint80", 73 | }, 74 | ], 75 | stateMutability: "view", 76 | type: "function", 77 | }, 78 | { 79 | inputs: [], 80 | name: "version", 81 | outputs: [ 82 | { 83 | internalType: "uint256", 84 | name: "", 85 | type: "uint256", 86 | }, 87 | ], 88 | stateMutability: "view", 89 | type: "function", 90 | }, 91 | ] as const; 92 | 93 | export class IPriceFeedAddress__factory { 94 | static readonly abi = _abi; 95 | static createInterface(): IPriceFeedAddressInterface { 96 | return new utils.Interface(_abi) as IPriceFeedAddressInterface; 97 | } 98 | static connect( 99 | address: string, 100 | signerOrProvider: Signer | Provider 101 | ): IPriceFeedAddress { 102 | return new Contract(address, _abi, signerOrProvider) as IPriceFeedAddress; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /types/factories/IPriceFeedType__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IPriceFeedType, 9 | IPriceFeedTypeInterface, 10 | } from "../IPriceFeedType"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "priceFeedType", 16 | outputs: [ 17 | { 18 | internalType: "enum PriceFeedType", 19 | name: "", 20 | type: "uint8", 21 | }, 22 | ], 23 | stateMutability: "view", 24 | type: "function", 25 | }, 26 | { 27 | inputs: [], 28 | name: "skipPriceCheck", 29 | outputs: [ 30 | { 31 | internalType: "bool", 32 | name: "", 33 | type: "bool", 34 | }, 35 | ], 36 | stateMutability: "view", 37 | type: "function", 38 | }, 39 | ] as const; 40 | 41 | export class IPriceFeedType__factory { 42 | static readonly abi = _abi; 43 | static createInterface(): IPriceFeedTypeInterface { 44 | return new utils.Interface(_abi) as IPriceFeedTypeInterface; 45 | } 46 | static connect( 47 | address: string, 48 | signerOrProvider: Signer | Provider 49 | ): IPriceFeedType { 50 | return new Contract(address, _abi, signerOrProvider) as IPriceFeedType; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /types/factories/IPriceOracle.sol/IPriceOracleV2Events__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IPriceOracleV2Events, 9 | IPriceOracleV2EventsInterface, 10 | } from "../../IPriceOracle.sol/IPriceOracleV2Events"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "token", 20 | type: "address", 21 | }, 22 | { 23 | indexed: true, 24 | internalType: "address", 25 | name: "priceFeed", 26 | type: "address", 27 | }, 28 | ], 29 | name: "NewPriceFeed", 30 | type: "event", 31 | }, 32 | ] as const; 33 | 34 | export class IPriceOracleV2Events__factory { 35 | static readonly abi = _abi; 36 | static createInterface(): IPriceOracleV2EventsInterface { 37 | return new utils.Interface(_abi) as IPriceOracleV2EventsInterface; 38 | } 39 | static connect( 40 | address: string, 41 | signerOrProvider: Signer | Provider 42 | ): IPriceOracleV2Events { 43 | return new Contract( 44 | address, 45 | _abi, 46 | signerOrProvider 47 | ) as IPriceOracleV2Events; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /types/factories/IPriceOracle.sol/IPriceOracleV2Exceptions__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IPriceOracleV2Exceptions, 9 | IPriceOracleV2ExceptionsInterface, 10 | } from "../../IPriceOracle.sol/IPriceOracleV2Exceptions"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "ChainPriceStaleException", 16 | type: "error", 17 | }, 18 | { 19 | inputs: [], 20 | name: "PriceOracleNotExistsException", 21 | type: "error", 22 | }, 23 | { 24 | inputs: [], 25 | name: "ZeroPriceException", 26 | type: "error", 27 | }, 28 | ] as const; 29 | 30 | export class IPriceOracleV2Exceptions__factory { 31 | static readonly abi = _abi; 32 | static createInterface(): IPriceOracleV2ExceptionsInterface { 33 | return new utils.Interface(_abi) as IPriceOracleV2ExceptionsInterface; 34 | } 35 | static connect( 36 | address: string, 37 | signerOrProvider: Signer | Provider 38 | ): IPriceOracleV2Exceptions { 39 | return new Contract( 40 | address, 41 | _abi, 42 | signerOrProvider 43 | ) as IPriceOracleV2Exceptions; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/factories/IPriceOracle.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IPriceOracle__factory } from "./IPriceOracle__factory"; 5 | export { IPriceOracleV2__factory } from "./IPriceOracleV2__factory"; 6 | export { IPriceOracleV2Events__factory } from "./IPriceOracleV2Events__factory"; 7 | export { IPriceOracleV2Exceptions__factory } from "./IPriceOracleV2Exceptions__factory"; 8 | export { IPriceOracleV2Ext__factory } from "./IPriceOracleV2Ext__factory"; 9 | -------------------------------------------------------------------------------- /types/factories/IVersion__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { IVersion, IVersionInterface } from "../IVersion"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [], 12 | name: "version", 13 | outputs: [ 14 | { 15 | internalType: "uint256", 16 | name: "", 17 | type: "uint256", 18 | }, 19 | ], 20 | stateMutability: "view", 21 | type: "function", 22 | }, 23 | ] as const; 24 | 25 | export class IVersion__factory { 26 | static readonly abi = _abi; 27 | static createInterface(): IVersionInterface { 28 | return new utils.Interface(_abi) as IVersionInterface; 29 | } 30 | static connect( 31 | address: string, 32 | signerOrProvider: Signer | Provider 33 | ): IVersion { 34 | return new Contract(address, _abi, signerOrProvider) as IVersion; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /types/factories/IWETHGateway__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { IWETHGateway, IWETHGatewayInterface } from "../IWETHGateway"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [ 12 | { 13 | internalType: "address", 14 | name: "pool", 15 | type: "address", 16 | }, 17 | { 18 | internalType: "address", 19 | name: "onBehalfOf", 20 | type: "address", 21 | }, 22 | { 23 | internalType: "uint16", 24 | name: "referralCode", 25 | type: "uint16", 26 | }, 27 | ], 28 | name: "addLiquidityETH", 29 | outputs: [], 30 | stateMutability: "payable", 31 | type: "function", 32 | }, 33 | { 34 | inputs: [ 35 | { 36 | internalType: "address", 37 | name: "pool", 38 | type: "address", 39 | }, 40 | { 41 | internalType: "uint256", 42 | name: "amount", 43 | type: "uint256", 44 | }, 45 | { 46 | internalType: "address payable", 47 | name: "to", 48 | type: "address", 49 | }, 50 | ], 51 | name: "removeLiquidityETH", 52 | outputs: [], 53 | stateMutability: "nonpayable", 54 | type: "function", 55 | }, 56 | { 57 | inputs: [ 58 | { 59 | internalType: "address", 60 | name: "to", 61 | type: "address", 62 | }, 63 | { 64 | internalType: "uint256", 65 | name: "amount", 66 | type: "uint256", 67 | }, 68 | ], 69 | name: "unwrapWETH", 70 | outputs: [], 71 | stateMutability: "nonpayable", 72 | type: "function", 73 | }, 74 | ] as const; 75 | 76 | export class IWETHGateway__factory { 77 | static readonly abi = _abi; 78 | static createInterface(): IWETHGatewayInterface { 79 | return new utils.Interface(_abi) as IWETHGatewayInterface; 80 | } 81 | static connect( 82 | address: string, 83 | signerOrProvider: Signer | Provider 84 | ): IWETHGateway { 85 | return new Contract(address, _abi, signerOrProvider) as IWETHGateway; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /types/factories/IWETH__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { IWETH, IWETHInterface } from "../IWETH"; 8 | 9 | const _abi = [ 10 | { 11 | inputs: [], 12 | name: "deposit", 13 | outputs: [], 14 | stateMutability: "payable", 15 | type: "function", 16 | }, 17 | { 18 | inputs: [ 19 | { 20 | internalType: "address", 21 | name: "to", 22 | type: "address", 23 | }, 24 | { 25 | internalType: "uint256", 26 | name: "value", 27 | type: "uint256", 28 | }, 29 | ], 30 | name: "transfer", 31 | outputs: [ 32 | { 33 | internalType: "bool", 34 | name: "", 35 | type: "bool", 36 | }, 37 | ], 38 | stateMutability: "nonpayable", 39 | type: "function", 40 | }, 41 | { 42 | inputs: [ 43 | { 44 | internalType: "uint256", 45 | name: "", 46 | type: "uint256", 47 | }, 48 | ], 49 | name: "withdraw", 50 | outputs: [], 51 | stateMutability: "nonpayable", 52 | type: "function", 53 | }, 54 | ] as const; 55 | 56 | export class IWETH__factory { 57 | static readonly abi = _abi; 58 | static createInterface(): IWETHInterface { 59 | return new utils.Interface(_abi) as IWETHInterface; 60 | } 61 | static connect(address: string, signerOrProvider: Signer | Provider): IWETH { 62 | return new Contract(address, _abi, signerOrProvider) as IWETH; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /types/factories/Initializable__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { Initializable, InitializableInterface } from "../Initializable"; 8 | 9 | const _abi = [ 10 | { 11 | anonymous: false, 12 | inputs: [ 13 | { 14 | indexed: false, 15 | internalType: "uint8", 16 | name: "version", 17 | type: "uint8", 18 | }, 19 | ], 20 | name: "Initialized", 21 | type: "event", 22 | }, 23 | ] as const; 24 | 25 | export class Initializable__factory { 26 | static readonly abi = _abi; 27 | static createInterface(): InitializableInterface { 28 | return new utils.Interface(_abi) as InitializableInterface; 29 | } 30 | static connect( 31 | address: string, 32 | signerOrProvider: Signer | Provider 33 | ): Initializable { 34 | return new Contract(address, _abi, signerOrProvider) as Initializable; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /types/factories/Ownable__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { Ownable, OwnableInterface } from "../Ownable"; 8 | 9 | const _abi = [ 10 | { 11 | anonymous: false, 12 | inputs: [ 13 | { 14 | indexed: true, 15 | internalType: "address", 16 | name: "previousOwner", 17 | type: "address", 18 | }, 19 | { 20 | indexed: true, 21 | internalType: "address", 22 | name: "newOwner", 23 | type: "address", 24 | }, 25 | ], 26 | name: "OwnershipTransferred", 27 | type: "event", 28 | }, 29 | { 30 | inputs: [], 31 | name: "owner", 32 | outputs: [ 33 | { 34 | internalType: "address", 35 | name: "", 36 | type: "address", 37 | }, 38 | ], 39 | stateMutability: "view", 40 | type: "function", 41 | }, 42 | { 43 | inputs: [], 44 | name: "renounceOwnership", 45 | outputs: [], 46 | stateMutability: "nonpayable", 47 | type: "function", 48 | }, 49 | { 50 | inputs: [ 51 | { 52 | internalType: "address", 53 | name: "newOwner", 54 | type: "address", 55 | }, 56 | ], 57 | name: "transferOwnership", 58 | outputs: [], 59 | stateMutability: "nonpayable", 60 | type: "function", 61 | }, 62 | ] as const; 63 | 64 | export class Ownable__factory { 65 | static readonly abi = _abi; 66 | static createInterface(): OwnableInterface { 67 | return new utils.Interface(_abi) as OwnableInterface; 68 | } 69 | static connect( 70 | address: string, 71 | signerOrProvider: Signer | Provider 72 | ): Ownable { 73 | return new Contract(address, _abi, signerOrProvider) as Ownable; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /types/factories/Pausable__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { Pausable, PausableInterface } from "../Pausable"; 8 | 9 | const _abi = [ 10 | { 11 | anonymous: false, 12 | inputs: [ 13 | { 14 | indexed: false, 15 | internalType: "address", 16 | name: "account", 17 | type: "address", 18 | }, 19 | ], 20 | name: "Paused", 21 | type: "event", 22 | }, 23 | { 24 | anonymous: false, 25 | inputs: [ 26 | { 27 | indexed: false, 28 | internalType: "address", 29 | name: "account", 30 | type: "address", 31 | }, 32 | ], 33 | name: "Unpaused", 34 | type: "event", 35 | }, 36 | { 37 | inputs: [], 38 | name: "paused", 39 | outputs: [ 40 | { 41 | internalType: "bool", 42 | name: "", 43 | type: "bool", 44 | }, 45 | ], 46 | stateMutability: "view", 47 | type: "function", 48 | }, 49 | ] as const; 50 | 51 | export class Pausable__factory { 52 | static readonly abi = _abi; 53 | static createInterface(): PausableInterface { 54 | return new utils.Interface(_abi) as PausableInterface; 55 | } 56 | static connect( 57 | address: string, 58 | signerOrProvider: Signer | Provider 59 | ): Pausable { 60 | return new Contract(address, _abi, signerOrProvider) as Pausable; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /types/factories/cheatCodes.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { CheatCodes__factory } from "./CheatCodes__factory"; 5 | -------------------------------------------------------------------------------- /types/factories/draft-IERC20Permit.sol/IERC20Permit__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import type { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IERC20Permit, 9 | IERC20PermitInterface, 10 | } from "../../draft-IERC20Permit.sol/IERC20Permit"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "DOMAIN_SEPARATOR", 16 | outputs: [ 17 | { 18 | internalType: "bytes32", 19 | name: "", 20 | type: "bytes32", 21 | }, 22 | ], 23 | stateMutability: "view", 24 | type: "function", 25 | }, 26 | { 27 | inputs: [ 28 | { 29 | internalType: "address", 30 | name: "owner", 31 | type: "address", 32 | }, 33 | ], 34 | name: "nonces", 35 | outputs: [ 36 | { 37 | internalType: "uint256", 38 | name: "", 39 | type: "uint256", 40 | }, 41 | ], 42 | stateMutability: "view", 43 | type: "function", 44 | }, 45 | { 46 | inputs: [ 47 | { 48 | internalType: "address", 49 | name: "owner", 50 | type: "address", 51 | }, 52 | { 53 | internalType: "address", 54 | name: "spender", 55 | type: "address", 56 | }, 57 | { 58 | internalType: "uint256", 59 | name: "value", 60 | type: "uint256", 61 | }, 62 | { 63 | internalType: "uint256", 64 | name: "deadline", 65 | type: "uint256", 66 | }, 67 | { 68 | internalType: "uint8", 69 | name: "v", 70 | type: "uint8", 71 | }, 72 | { 73 | internalType: "bytes32", 74 | name: "r", 75 | type: "bytes32", 76 | }, 77 | { 78 | internalType: "bytes32", 79 | name: "s", 80 | type: "bytes32", 81 | }, 82 | ], 83 | name: "permit", 84 | outputs: [], 85 | stateMutability: "nonpayable", 86 | type: "function", 87 | }, 88 | ] as const; 89 | 90 | export class IERC20Permit__factory { 91 | static readonly abi = _abi; 92 | static createInterface(): IERC20PermitInterface { 93 | return new utils.Interface(_abi) as IERC20PermitInterface; 94 | } 95 | static connect( 96 | address: string, 97 | signerOrProvider: Signer | Provider 98 | ): IERC20Permit { 99 | return new Contract(address, _abi, signerOrProvider) as IERC20Permit; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /types/factories/draft-IERC20Permit.sol/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export { IERC20Permit__factory } from "./IERC20Permit__factory"; 5 | --------------------------------------------------------------------------------