@gearbox-protocol/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/gearbox-sdk.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.prettierrc +10 -0
- package/README.md +4 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +4 -0
- package/lib/core/constants.d.ts +17 -0
- package/lib/core/constants.js +36 -0
- package/lib/core/contracts.d.ts +64 -0
- package/lib/core/contracts.js +104 -0
- package/lib/core/contractsRegister.d.ts +2 -0
- package/lib/core/contractsRegister.js +43 -0
- package/lib/core/creditAccount.d.ts +35 -0
- package/lib/core/creditAccount.js +98 -0
- package/lib/core/creditCard.d.ts +13 -0
- package/lib/core/creditCard.js +2 -0
- package/lib/core/creditManager.d.ts +37 -0
- package/lib/core/creditManager.js +118 -0
- package/lib/core/creditOperation.d.ts +9 -0
- package/lib/core/creditOperation.js +2 -0
- package/lib/core/creditSession.d.ts +26 -0
- package/lib/core/creditSession.js +44 -0
- package/lib/core/errors.d.ts +26 -0
- package/lib/core/errors.js +74 -0
- package/lib/core/event.d.ts +42 -0
- package/lib/core/event.js +2 -0
- package/lib/core/eventOrTx.d.ts +36 -0
- package/lib/core/eventOrTx.js +97 -0
- package/lib/core/events.d.ts +369 -0
- package/lib/core/events.js +730 -0
- package/lib/core/history.d.ts +42 -0
- package/lib/core/history.js +2 -0
- package/lib/core/operations.d.ts +22 -0
- package/lib/core/operations.js +20 -0
- package/lib/core/oracles.d.ts +6 -0
- package/lib/core/oracles.js +2 -0
- package/lib/core/pool.d.ts +28 -0
- package/lib/core/pool.js +32 -0
- package/lib/core/swap.d.ts +4 -0
- package/lib/core/swap.js +8 -0
- package/lib/core/token.d.ts +3 -0
- package/lib/core/token.js +229 -0
- package/lib/core/tokenData.d.ts +28 -0
- package/lib/core/tokenData.js +58 -0
- package/lib/core/tokenDistributor.d.ts +12 -0
- package/lib/core/tokenDistributor.js +9 -0
- package/lib/core/trade.d.ts +35 -0
- package/lib/core/trade.js +62 -0
- package/lib/core/transactions.d.ts +127 -0
- package/lib/core/transactions.js +306 -0
- package/lib/index.d.ts +33 -0
- package/lib/index.js +47 -0
- package/lib/payload/creditAccount.d.ts +26 -0
- package/lib/payload/creditAccount.js +2 -0
- package/lib/payload/creditManager.d.ts +43 -0
- package/lib/payload/creditManager.js +2 -0
- package/lib/payload/creditSession.d.ts +23 -0
- package/lib/payload/creditSession.js +2 -0
- package/lib/payload/graphPayload.d.ts +9 -0
- package/lib/payload/graphPayload.js +2 -0
- package/lib/payload/pool.d.ts +17 -0
- package/lib/payload/pool.js +3 -0
- package/lib/payload/token.d.ts +5 -0
- package/lib/payload/token.js +2 -0
- package/lib/types/ACL.d.ts +491 -0
- package/lib/types/ACLTrait.d.ts +148 -0
- package/lib/types/ACLTraitTest.d.ts +209 -0
- package/lib/types/AbstractAccountMiner.d.ts +143 -0
- package/lib/types/AccountFactory.d.ts +716 -0
- package/lib/types/AccountMinerAuction.d.ts +391 -0
- package/lib/types/AccountMinerMock.d.ts +241 -0
- package/lib/types/AccountMinerNonReceivableTest.d.ts +127 -0
- package/lib/types/AccountMinerOwnFunds.d.ts +218 -0
- package/lib/types/AccountMining.d.ts +222 -0
- package/lib/types/AdaptersDeployer.d.ts +262 -0
- package/lib/types/AddressProvider.d.ts +912 -0
- package/lib/types/AggregatorV3Interface.d.ts +234 -0
- package/lib/types/ChainlinkPriceFeedMock.d.ts +215 -0
- package/lib/types/ContractsRegister.d.ts +398 -0
- package/lib/types/CoreDeployer.d.ts +394 -0
- package/lib/types/CreditAccount.d.ts +443 -0
- package/lib/types/CreditFilter.d.ts +1609 -0
- package/lib/types/CreditFilterMock.d.ts +1687 -0
- package/lib/types/CreditManager.d.ts +1285 -0
- package/lib/types/CreditManagerMockForFilter.d.ts +605 -0
- package/lib/types/CreditManagerMockForPoolTest.d.ts +204 -0
- package/lib/types/CurveMock.d.ts +298 -0
- package/lib/types/CurveV1Adapter.d.ts +349 -0
- package/lib/types/DataCompressor.d.ts +1331 -0
- package/lib/types/Deployer.d.ts +224 -0
- package/lib/types/DieselToken.d.ts +567 -0
- package/lib/types/ERC165.d.ts +116 -0
- package/lib/types/ERC20.d.ts +411 -0
- package/lib/types/ERC20BlockingMock.d.ts +568 -0
- package/lib/types/ERC721.d.ts +625 -0
- package/lib/types/Errors.d.ts +1854 -0
- package/lib/types/ExecutorMock.d.ts +140 -0
- package/lib/types/FlashLoanAttacker.d.ts +170 -0
- package/lib/types/FuzzHarness.d.ts +124 -0
- package/lib/types/GearBeta.d.ts +745 -0
- package/lib/types/GearToken.d.ts +888 -0
- package/lib/types/GenesisDeployer.d.ts +282 -0
- package/lib/types/IAccountFactory.d.ts +317 -0
- package/lib/types/IAccountMiner.d.ts +124 -0
- package/lib/types/IAppAddressProvider.d.ts +198 -0
- package/lib/types/IAppCreditManager.d.ts +408 -0
- package/lib/types/IAppERC20.d.ts +309 -0
- package/lib/types/IAppPoolService.d.ts +166 -0
- package/lib/types/ICreditAccount.d.ts +430 -0
- package/lib/types/ICreditAccountData.d.ts +347 -0
- package/lib/types/ICreditFilter.d.ts +1162 -0
- package/lib/types/ICreditManager.d.ts +971 -0
- package/lib/types/ICurvePool.d.ts +298 -0
- package/lib/types/IDataCompressor.d.ts +1231 -0
- package/lib/types/IERC165.d.ts +116 -0
- package/lib/types/IERC20.d.ts +294 -0
- package/lib/types/IERC721.d.ts +472 -0
- package/lib/types/IERC721Enumerable.d.ts +564 -0
- package/lib/types/IERC721Metadata.d.ts +523 -0
- package/lib/types/IERC721Receiver.d.ts +132 -0
- package/lib/types/IGearToken.d.ts +527 -0
- package/lib/types/IInterestRateModel.d.ts +121 -0
- package/lib/types/IMerkleDistributor.d.ts +190 -0
- package/lib/types/IPoolService.d.ts +772 -0
- package/lib/types/IPriceOracle.d.ts +211 -0
- package/lib/types/IQuoter.d.ts +269 -0
- package/lib/types/ISwapRouter.d.ts +404 -0
- package/lib/types/IUniswapV2Migrator.d.ts +134 -0
- package/lib/types/IUniswapV2Router01.d.ts +1119 -0
- package/lib/types/IUniswapV2Router02.d.ts +1432 -0
- package/lib/types/IUniswapV3SwapCallback.d.ts +127 -0
- package/lib/types/IWETH.d.ts +169 -0
- package/lib/types/IWETHGateway.d.ts +335 -0
- package/lib/types/IYVault.d.ts +558 -0
- package/lib/types/LeveragedActions.d.ts +772 -0
- package/lib/types/LinearInterestRateModel.d.ts +279 -0
- package/lib/types/MockPoolService.d.ts +1271 -0
- package/lib/types/Multicall2.d.ts +449 -0
- package/lib/types/Ownable.d.ts +169 -0
- package/lib/types/PathFinder.d.ts +379 -0
- package/lib/types/Pausable.d.ts +105 -0
- package/lib/types/PercentageMathTest.d.ts +154 -0
- package/lib/types/PoolDeployer.d.ts +282 -0
- package/lib/types/PoolService.d.ts +1174 -0
- package/lib/types/PriceOracle.d.ts +387 -0
- package/lib/types/Proxy.d.ts +78 -0
- package/lib/types/StepVesting.d.ts +411 -0
- package/lib/types/TestPoolService.d.ts +1294 -0
- package/lib/types/TokenDistributor.d.ts +640 -0
- package/lib/types/TokenFeeMock.d.ts +544 -0
- package/lib/types/TokenMock.d.ts +531 -0
- package/lib/types/TreasuryMock.d.ts +86 -0
- package/lib/types/UniswapRouterMock.d.ts +1520 -0
- package/lib/types/UniswapV2Adapter.d.ts +1463 -0
- package/lib/types/UniswapV3Adapter.d.ts +455 -0
- package/lib/types/VestingDeployer.d.ts +247 -0
- package/lib/types/WETHGateway.d.ts +376 -0
- package/lib/types/WETHMock.d.ts +433 -0
- package/lib/types/WadRayMathTest.d.ts +316 -0
- package/lib/types/YearnAdapter.d.ts +609 -0
- package/lib/types/YearnMock.d.ts +795 -0
- package/lib/types/YearnPriceFeed.d.ts +399 -0
- package/lib/types/commons.d.ts +16 -0
- package/lib/types/commons.js +5 -0
- package/lib/types/factories/ACLTraitTest__factory.d.ts +52 -0
- package/lib/types/factories/ACLTraitTest__factory.js +138 -0
- package/lib/types/factories/ACLTrait__factory.d.ts +31 -0
- package/lib/types/factories/ACLTrait__factory.js +75 -0
- package/lib/types/factories/ACL__factory.d.ts +45 -0
- package/lib/types/factories/ACL__factory.js +317 -0
- package/lib/types/factories/AbstractAccountMiner__factory.d.ts +30 -0
- package/lib/types/factories/AbstractAccountMiner__factory.js +61 -0
- package/lib/types/factories/AccountFactory__factory.d.ts +72 -0
- package/lib/types/factories/AccountFactory__factory.js +508 -0
- package/lib/types/factories/AccountMinerAuction__factory.js +304 -0
- package/lib/types/factories/AccountMinerMock__factory.js +196 -0
- package/lib/types/factories/AccountMinerNonReceivableTest__factory.js +84 -0
- package/lib/types/factories/AccountMinerOwnFunds__factory.js +181 -0
- package/lib/types/factories/AccountMining__factory.d.ts +56 -0
- package/lib/types/factories/AccountMining__factory.js +192 -0
- package/lib/types/factories/AdaptersDeployer__factory.d.ts +85 -0
- package/lib/types/factories/AdaptersDeployer__factory.js +202 -0
- package/lib/types/factories/AddressProvider__factory.d.ts +52 -0
- package/lib/types/factories/AddressProvider__factory.js +582 -0
- package/lib/types/factories/AggregatorV3Interface__factory.d.ts +22 -0
- package/lib/types/factories/AggregatorV3Interface__factory.js +133 -0
- package/lib/types/factories/ChainlinkPriceFeedMock__factory.d.ts +42 -0
- package/lib/types/factories/ChainlinkPriceFeedMock__factory.js +193 -0
- package/lib/types/factories/ContractsRegister__factory.d.ts +56 -0
- package/lib/types/factories/ContractsRegister__factory.js +310 -0
- package/lib/types/factories/CoreDeployer__factory.js +331 -0
- package/lib/types/factories/CreditAccount__factory.d.ts +32 -0
- package/lib/types/factories/CreditAccount__factory.js +262 -0
- package/lib/types/factories/CreditFilterMock__factory.d.ts +56 -0
- package/lib/types/factories/CreditFilterMock__factory.js +1083 -0
- package/lib/types/factories/CreditFilter__factory.d.ts +56 -0
- package/lib/types/factories/CreditFilter__factory.js +1047 -0
- package/lib/types/factories/CreditManagerMockForFilter__factory.d.ts +38 -0
- package/lib/types/factories/CreditManagerMockForFilter__factory.js +324 -0
- package/lib/types/factories/CreditManagerMockForPoolTest__factory.d.ts +48 -0
- package/lib/types/factories/CreditManagerMockForPoolTest__factory.js +131 -0
- package/lib/types/factories/CreditManager__factory.d.ts +77 -0
- package/lib/types/factories/CreditManager__factory.js +1030 -0
- package/lib/types/factories/CurveMock__factory.d.ts +42 -0
- package/lib/types/factories/CurveMock__factory.js +210 -0
- package/lib/types/factories/CurveV1Adapter__factory.d.ts +42 -0
- package/lib/types/factories/CurveV1Adapter__factory.js +254 -0
- package/lib/types/factories/DataCompressor__factory.d.ts +71 -0
- package/lib/types/factories/DataCompressor__factory.js +944 -0
- package/lib/types/factories/Deployer__factory.js +248 -0
- package/lib/types/factories/DieselToken__factory.d.ts +56 -0
- package/lib/types/factories/DieselToken__factory.js +432 -0
- package/lib/types/factories/ERC165__factory.d.ts +22 -0
- package/lib/types/factories/ERC165__factory.js +41 -0
- package/lib/types/factories/ERC20BlockingMock__factory.d.ts +56 -0
- package/lib/types/factories/ERC20BlockingMock__factory.js +429 -0
- package/lib/types/factories/ERC20__factory.d.ts +56 -0
- package/lib/types/factories/ERC20__factory.js +339 -0
- package/lib/types/factories/ERC721__factory.d.ts +56 -0
- package/lib/types/factories/ERC721__factory.js +468 -0
- package/lib/types/factories/Errors__factory.d.ts +28 -0
- package/lib/types/factories/Errors__factory.js +1015 -0
- package/lib/types/factories/ExecutorMock__factory.d.ts +38 -0
- package/lib/types/factories/ExecutorMock__factory.js +103 -0
- package/lib/types/factories/FlashLoanAttacker__factory.d.ts +48 -0
- package/lib/types/factories/FlashLoanAttacker__factory.js +117 -0
- package/lib/types/factories/FuzzHarness__factory.d.ts +38 -0
- package/lib/types/factories/FuzzHarness__factory.js +92 -0
- package/lib/types/factories/GearBeta__factory.d.ts +52 -0
- package/lib/types/factories/GearBeta__factory.js +527 -0
- package/lib/types/factories/GearToken__factory.d.ts +56 -0
- package/lib/types/factories/GearToken__factory.js +708 -0
- package/lib/types/factories/GenesisDeployer__factory.d.ts +108 -0
- package/lib/types/factories/GenesisDeployer__factory.js +231 -0
- package/lib/types/factories/IAccountFactory__factory.d.ts +35 -0
- package/lib/types/factories/IAccountFactory__factory.js +226 -0
- package/lib/types/factories/IAccountMiner__factory.d.ts +28 -0
- package/lib/types/factories/IAccountMiner__factory.js +48 -0
- package/lib/types/factories/IAppAddressProvider__factory.d.ts +18 -0
- package/lib/types/factories/IAppAddressProvider__factory.js +100 -0
- package/lib/types/factories/IAppCreditManager__factory.d.ts +42 -0
- package/lib/types/factories/IAppCreditManager__factory.js +204 -0
- package/lib/types/factories/IAppERC20__factory.d.ts +22 -0
- package/lib/types/factories/IAppERC20__factory.js +194 -0
- package/lib/types/factories/IAppPoolService__factory.d.ts +22 -0
- package/lib/types/factories/IAppPoolService__factory.js +69 -0
- package/lib/types/factories/ICreditAccountData__factory.d.ts +35 -0
- package/lib/types/factories/ICreditAccountData__factory.js +216 -0
- package/lib/types/factories/ICreditAccount__factory.d.ts +22 -0
- package/lib/types/factories/ICreditAccount__factory.js +218 -0
- package/lib/types/factories/ICreditFilter__factory.d.ts +35 -0
- package/lib/types/factories/ICreditFilter__factory.js +700 -0
- package/lib/types/factories/ICreditManager__factory.d.ts +56 -0
- package/lib/types/factories/ICreditManager__factory.js +720 -0
- package/lib/types/factories/ICurvePool__factory.d.ts +22 -0
- package/lib/types/factories/ICurvePool__factory.js +168 -0
- package/lib/types/factories/IDataCompressor__factory.d.ts +51 -0
- package/lib/types/factories/IDataCompressor__factory.js +826 -0
- package/lib/types/factories/IERC165__factory.d.ts +22 -0
- package/lib/types/factories/IERC165__factory.js +41 -0
- package/lib/types/factories/IERC20__factory.d.ts +35 -0
- package/lib/types/factories/IERC20__factory.js +205 -0
- package/lib/types/factories/IERC721Enumerable__factory.d.ts +35 -0
- package/lib/types/factories/IERC721Enumerable__factory.js +363 -0
- package/lib/types/factories/IERC721Metadata__factory.d.ts +35 -0
- package/lib/types/factories/IERC721Metadata__factory.js +352 -0
- package/lib/types/factories/IERC721Receiver__factory.d.ts +22 -0
- package/lib/types/factories/IERC721Receiver__factory.js +56 -0
- package/lib/types/factories/IERC721__factory.d.ts +35 -0
- package/lib/types/factories/IERC721__factory.js +307 -0
- package/lib/types/factories/IGearToken__factory.d.ts +35 -0
- package/lib/types/factories/IGearToken__factory.js +342 -0
- package/lib/types/factories/IInterestRateModel__factory.d.ts +22 -0
- package/lib/types/factories/IInterestRateModel__factory.js +46 -0
- package/lib/types/factories/IMerkleDistributor__factory.d.ts +35 -0
- package/lib/types/factories/IMerkleDistributor__factory.js +109 -0
- package/lib/types/factories/IPoolService__factory.d.ts +35 -0
- package/lib/types/factories/IPoolService__factory.js +580 -0
- package/lib/types/factories/IPriceOracle__factory.d.ts +35 -0
- package/lib/types/factories/IPriceOracle__factory.js +112 -0
- package/lib/types/factories/IQuoter__factory.d.ts +22 -0
- package/lib/types/factories/IQuoter__factory.js +148 -0
- package/lib/types/factories/ISwapRouter__factory.d.ts +27 -0
- package/lib/types/factories/ISwapRouter__factory.js +236 -0
- package/lib/types/factories/IUniswapV2Migrator__factory.d.ts +18 -0
- package/lib/types/factories/IUniswapV2Migrator__factory.js +55 -0
- package/lib/types/factories/IUniswapV2Router01__factory.d.ts +22 -0
- package/lib/types/factories/IUniswapV2Router01__factory.js +771 -0
- package/lib/types/factories/IUniswapV2Router02__factory.d.ts +22 -0
- package/lib/types/factories/IUniswapV2Router02__factory.js +973 -0
- package/lib/types/factories/IUniswapV3SwapCallback__factory.d.ts +18 -0
- package/lib/types/factories/IUniswapV3SwapCallback__factory.js +45 -0
- package/lib/types/factories/IWETHGateway__factory.d.ts +18 -0
- package/lib/types/factories/IWETHGateway__factory.js +150 -0
- package/lib/types/factories/IWETH__factory.d.ts +22 -0
- package/lib/types/factories/IWETH__factory.js +66 -0
- package/lib/types/factories/IYVault__factory.d.ts +35 -0
- package/lib/types/factories/IYVault__factory.js +411 -0
- package/lib/types/factories/LeveragedActions__factory.d.ts +84 -0
- package/lib/types/factories/LeveragedActions__factory.js +569 -0
- package/lib/types/factories/LinearInterestRateModel__factory.d.ts +42 -0
- package/lib/types/factories/LinearInterestRateModel__factory.js +209 -0
- package/lib/types/factories/MockPoolService__factory.d.ts +56 -0
- package/lib/types/factories/MockPoolService__factory.js +889 -0
- package/lib/types/factories/Multicall2__factory.d.ts +52 -0
- package/lib/types/factories/Multicall2__factory.js +364 -0
- package/lib/types/factories/Ownable__factory.d.ts +42 -0
- package/lib/types/factories/Ownable__factory.js +74 -0
- package/lib/types/factories/PathFinder__factory.d.ts +61 -0
- package/lib/types/factories/PathFinder__factory.js +302 -0
- package/lib/types/factories/Pausable__factory.d.ts +31 -0
- package/lib/types/factories/Pausable__factory.js +61 -0
- package/lib/types/factories/PercentageMathTest__factory.d.ts +32 -0
- package/lib/types/factories/PercentageMathTest__factory.js +101 -0
- package/lib/types/factories/PoolDeployer__factory.d.ts +113 -0
- package/lib/types/factories/PoolDeployer__factory.js +257 -0
- package/lib/types/factories/PoolService__factory.d.ts +56 -0
- package/lib/types/factories/PoolService__factory.js +873 -0
- package/lib/types/factories/PriceOracle__factory.d.ts +56 -0
- package/lib/types/factories/PriceOracle__factory.js +290 -0
- package/lib/types/factories/Proxy__factory.d.ts +13 -0
- package/lib/types/factories/Proxy__factory.js +30 -0
- package/lib/types/factories/StepVesting__factory.d.ts +52 -0
- package/lib/types/factories/StepVesting__factory.js +296 -0
- package/lib/types/factories/TestPoolService__factory.d.ts +56 -0
- package/lib/types/factories/TestPoolService__factory.js +932 -0
- package/lib/types/factories/TokenDistributor__factory.d.ts +82 -0
- package/lib/types/factories/TokenDistributor__factory.js +481 -0
- package/lib/types/factories/TokenFeeMock__factory.d.ts +56 -0
- package/lib/types/factories/TokenFeeMock__factory.js +427 -0
- package/lib/types/factories/TokenMock__factory.d.ts +56 -0
- package/lib/types/factories/TokenMock__factory.js +409 -0
- package/lib/types/factories/TreasuryMock__factory.d.ts +35 -0
- package/lib/types/factories/TreasuryMock__factory.js +70 -0
- package/lib/types/factories/UniswapRouterMock__factory.d.ts +32 -0
- package/lib/types/factories/UniswapRouterMock__factory.js +1046 -0
- package/lib/types/factories/UniswapV2Adapter__factory.d.ts +42 -0
- package/lib/types/factories/UniswapV2Adapter__factory.js +1059 -0
- package/lib/types/factories/UniswapV3Adapter__factory.d.ts +47 -0
- package/lib/types/factories/UniswapV3Adapter__factory.js +322 -0
- package/lib/types/factories/VestingDeployer__factory.js +216 -0
- package/lib/types/factories/WETHGateway__factory.d.ts +70 -0
- package/lib/types/factories/WETHGateway__factory.js +241 -0
- package/lib/types/factories/WETHMock__factory.d.ts +52 -0
- package/lib/types/factories/WETHMock__factory.js +355 -0
- package/lib/types/factories/WadRayMathTest__factory.d.ts +32 -0
- package/lib/types/factories/WadRayMathTest__factory.js +239 -0
- package/lib/types/factories/YearnAdapter__factory.d.ts +56 -0
- package/lib/types/factories/YearnAdapter__factory.js +497 -0
- package/lib/types/factories/YearnMock__factory.d.ts +56 -0
- package/lib/types/factories/YearnMock__factory.js +598 -0
- package/lib/types/factories/YearnPriceFeed__factory.d.ts +56 -0
- package/lib/types/factories/YearnPriceFeed__factory.js +350 -0
- package/lib/types/hardhat.d.ts +343 -0
- package/lib/types/index.d.ts +152 -0
- package/lib/types/index.js +156 -0
- package/lib/utils/events.d.ts +2 -0
- package/lib/utils/events.js +13 -0
- package/lib/utils/formatter.d.ts +13 -0
- package/lib/utils/formatter.js +125 -0
- package/lib/utils/loading.d.ts +1 -0
- package/lib/utils/loading.js +17 -0
- package/lib/utils/math.d.ts +6 -0
- package/lib/utils/math.js +44 -0
- package/lib/utils/multicall.d.ts +15 -0
- package/lib/utils/multicall.js +84 -0
- package/lib/utils/repeater.d.ts +1 -0
- package/lib/utils/repeater.js +72 -0
- package/lib/utils/validate.d.ts +1 -0
- package/lib/utils/validate.js +13 -0
- package/package.json +27 -0
- package/src/abi/adapters/YearnV2.sol/YearnAdapter.dbg.json +4 -0
- package/src/abi/adapters/YearnV2.sol/YearnAdapter.json +455 -0
- package/src/abi/core/ACL.sol/ACL.dbg.json +4 -0
- package/src/abi/core/ACL.sol/ACL.json +262 -0
- package/src/abi/core/ACLTrait.sol/ACLTrait.dbg.json +4 -0
- package/src/abi/core/ACLTrait.sol/ACLTrait.json +64 -0
- package/src/abi/core/AccountMining.sol/AccountMining.dbg.json +4 -0
- package/src/abi/core/AccountMining.sol/AccountMining.json +150 -0
- package/src/abi/core/AddressProvider.sol/AddressProvider.dbg.json +4 -0
- package/src/abi/core/AddressProvider.sol/AddressProvider.json +496 -0
- package/src/abi/core/ContractsRegister.sol/ContractsRegister.dbg.json +4 -0
- package/src/abi/core/ContractsRegister.sol/ContractsRegister.json +255 -0
- package/src/abi/credit/LeverageActions.sol/LeveragedActions.dbg.json +4 -0
- package/src/abi/credit/LeverageActions.sol/LeveragedActions.json +514 -0
- package/src/abi/deployer/AdaptersDeployer.sol/AdaptersDeployer.dbg.json +4 -0
- package/src/abi/deployer/AdaptersDeployer.sol/AdaptersDeployer.json +160 -0
- package/src/abi/deployer/GenesisDeployer.sol/GenesisDeployer.dbg.json +4 -0
- package/src/abi/deployer/GenesisDeployer.sol/GenesisDeployer.json +189 -0
- package/src/abi/deployer/PoolDeployer.sol/PoolDeployer.dbg.json +4 -0
- package/src/abi/deployer/PoolDeployer.sol/PoolDeployer.json +215 -0
- package/src/abi/fuzzing/FuzzHarness.sol/FuzzHarness.dbg.json +4 -0
- package/src/abi/fuzzing/FuzzHarness.sol/FuzzHarness.json +50 -0
- package/src/abi/integrations/yearn/IYVault.sol/IYVault.dbg.json +4 -0
- package/src/abi/integrations/yearn/IYVault.sol/IYVault.json +400 -0
- package/src/abi/interfaces/IGearToken.sol/IGearToken.dbg.json +4 -0
- package/src/abi/interfaces/IGearToken.sol/IGearToken.json +331 -0
- package/src/abi/interfaces/IMerkleDistributor.sol/IMerkleDistributor.dbg.json +4 -0
- package/src/abi/interfaces/IMerkleDistributor.sol/IMerkleDistributor.json +98 -0
- package/src/abi/mocks/core/ACLTraitTest.sol/ACLTraitTest.dbg.json +4 -0
- package/src/abi/mocks/core/ACLTraitTest.sol/ACLTraitTest.json +96 -0
- package/src/abi/mocks/credit/ExecutorMock.sol/ExecutorMock.dbg.json +4 -0
- package/src/abi/mocks/credit/ExecutorMock.sol/ExecutorMock.json +61 -0
- package/src/abi/mocks/integrations/CurveMock.sol/CurveMock.dbg.json +4 -0
- package/src/abi/mocks/integrations/CurveMock.sol/CurveMock.json +168 -0
- package/src/abi/mocks/integrations/YearnMock.sol/YearnMock.dbg.json +4 -0
- package/src/abi/mocks/integrations/YearnMock.sol/YearnMock.json +556 -0
- package/src/abi/mocks/oracles/ChainlinkPriceFeedMock.sol/ChainlinkPriceFeedMock.dbg.json +4 -0
- package/src/abi/mocks/oracles/ChainlinkPriceFeedMock.sol/ChainlinkPriceFeedMock.json +151 -0
- package/src/abi/mocks/pool/CreditManagerMockForPoolTest.sol/CreditManagerMockForPoolTest.dbg.json +4 -0
- package/src/abi/mocks/pool/CreditManagerMockForPoolTest.sol/CreditManagerMockForPoolTest.json +89 -0
- package/src/abi/mocks/tokens/ERC20Blocking.sol/ERC20BlockingMock.dbg.json +4 -0
- package/src/abi/mocks/tokens/ERC20Blocking.sol/ERC20BlockingMock.json +387 -0
- package/src/abi/mocks/tokens/ERC20Fee.sol/TokenFeeMock.dbg.json +4 -0
- package/src/abi/mocks/tokens/ERC20Fee.sol/TokenFeeMock.json +385 -0
- package/src/abi/oracles/YearnPriceFeed.sol/YearnPriceFeed.dbg.json +4 -0
- package/src/abi/oracles/YearnPriceFeed.sol/YearnPriceFeed.json +321 -0
- package/src/abi/support/PathFinder.sol/PathFinder.dbg.json +4 -0
- package/src/abi/support/PathFinder.sol/PathFinder.json +189 -0
- package/src/abi/tokens/GearNFT.sol/GearBeta.dbg.json +4 -0
- package/src/abi/tokens/GearNFT.sol/GearBeta.json +485 -0
- package/src/abi/tokens/TokenDistributor.sol/TokenDistributor.dbg.json +4 -0
- package/src/abi/tokens/TokenDistributor.sol/TokenDistributor.json +439 -0
- package/src/abi/tokens/Vesting.sol/StepVesting.dbg.json +4 -0
- package/src/abi/tokens/Vesting.sol/StepVesting.json +254 -0
- package/src/config.ts +1 -0
- package/src/core/constants.ts +44 -0
- package/src/core/contracts.ts +151 -0
- package/src/core/contractsRegister.ts +51 -0
- package/src/core/creditAccount.ts +105 -0
- package/src/core/creditCard.ts +15 -0
- package/src/core/creditManager.ts +171 -0
- package/src/core/creditOperation.ts +9 -0
- package/src/core/creditSession.ts +67 -0
- package/src/core/errors.ts +45 -0
- package/src/core/eventOrTx.ts +94 -0
- package/src/core/events.ts +1167 -0
- package/src/core/history.ts +55 -0
- package/src/core/operations.ts +35 -0
- package/src/core/oracles.ts +7 -0
- package/src/core/pool.ts +60 -0
- package/src/core/swap.ts +4 -0
- package/src/core/token.ts +275 -0
- package/src/core/tokenData.ts +84 -0
- package/src/core/tokenDistributor.ts +14 -0
- package/src/core/trade.ts +83 -0
- package/src/core/transactions.ts +407 -0
- package/src/index.ts +42 -0
- package/src/payload/creditAccount.ts +29 -0
- package/src/payload/creditManager.ts +46 -0
- package/src/payload/creditSession.ts +24 -0
- package/src/payload/graphPayload.ts +10 -0
- package/src/payload/pool.ts +20 -0
- package/src/payload/token.ts +5 -0
- package/src/types/ACL.d.ts +491 -0
- package/src/types/ACLTrait.d.ts +148 -0
- package/src/types/ACLTraitTest.d.ts +209 -0
- package/src/types/AccountFactory.d.ts +716 -0
- package/src/types/AccountMining.d.ts +222 -0
- package/src/types/AddressProvider.d.ts +912 -0
- package/src/types/AggregatorV3Interface.d.ts +234 -0
- package/src/types/ChainlinkPriceFeedMock.d.ts +215 -0
- package/src/types/ContractsRegister.d.ts +398 -0
- package/src/types/CreditAccount.d.ts +443 -0
- package/src/types/CreditFilter.d.ts +1609 -0
- package/src/types/CreditFilterMock.d.ts +1687 -0
- package/src/types/CreditManager.d.ts +1285 -0
- package/src/types/CreditManagerMockForFilter.d.ts +605 -0
- package/src/types/CreditManagerMockForPoolTest.d.ts +204 -0
- package/src/types/CurveMock.d.ts +298 -0
- package/src/types/CurveV1Adapter.d.ts +349 -0
- package/src/types/DataCompressor.d.ts +1331 -0
- package/src/types/DieselToken.d.ts +567 -0
- package/src/types/ERC165.d.ts +116 -0
- package/src/types/ERC20.d.ts +411 -0
- package/src/types/ERC20BlockingMock.d.ts +568 -0
- package/src/types/ERC721.d.ts +625 -0
- package/src/types/Errors.d.ts +1854 -0
- package/src/types/ExecutorMock.d.ts +140 -0
- package/src/types/FlashLoanAttacker.d.ts +170 -0
- package/src/types/FuzzHarness.d.ts +124 -0
- package/src/types/GearBeta.d.ts +745 -0
- package/src/types/GearToken.d.ts +888 -0
- package/src/types/IAccountFactory.d.ts +317 -0
- package/src/types/IAccountMiner.d.ts +124 -0
- package/src/types/IAppAddressProvider.d.ts +198 -0
- package/src/types/IAppCreditManager.d.ts +408 -0
- package/src/types/IAppERC20.d.ts +309 -0
- package/src/types/IAppPoolService.d.ts +166 -0
- package/src/types/ICreditAccount.d.ts +430 -0
- package/src/types/ICreditFilter.d.ts +1162 -0
- package/src/types/ICreditManager.d.ts +971 -0
- package/src/types/ICurvePool.d.ts +298 -0
- package/src/types/IDataCompressor.d.ts +1231 -0
- package/src/types/IERC165.d.ts +116 -0
- package/src/types/IERC20.d.ts +294 -0
- package/src/types/IERC721.d.ts +472 -0
- package/src/types/IERC721Enumerable.d.ts +564 -0
- package/src/types/IERC721Metadata.d.ts +523 -0
- package/src/types/IERC721Receiver.d.ts +132 -0
- package/src/types/IGearToken.d.ts +527 -0
- package/src/types/IInterestRateModel.d.ts +121 -0
- package/src/types/IMerkleDistributor.d.ts +190 -0
- package/src/types/IPoolService.d.ts +772 -0
- package/src/types/IPriceOracle.d.ts +211 -0
- package/src/types/IQuoter.d.ts +269 -0
- package/src/types/ISwapRouter.d.ts +404 -0
- package/src/types/IUniswapV2Migrator.d.ts +134 -0
- package/src/types/IUniswapV2Router01.d.ts +1119 -0
- package/src/types/IUniswapV2Router02.d.ts +1432 -0
- package/src/types/IUniswapV3SwapCallback.d.ts +127 -0
- package/src/types/IWETH.d.ts +169 -0
- package/src/types/IWETHGateway.d.ts +335 -0
- package/src/types/IYVault.d.ts +558 -0
- package/src/types/LeveragedActions.d.ts +772 -0
- package/src/types/LinearInterestRateModel.d.ts +279 -0
- package/src/types/MockPoolService.d.ts +1271 -0
- package/src/types/Multicall2.d.ts +449 -0
- package/src/types/Ownable.d.ts +169 -0
- package/src/types/PathFinder.d.ts +379 -0
- package/src/types/Pausable.d.ts +105 -0
- package/src/types/PercentageMathTest.d.ts +154 -0
- package/src/types/PoolService.d.ts +1174 -0
- package/src/types/PriceOracle.d.ts +387 -0
- package/src/types/StepVesting.d.ts +411 -0
- package/src/types/TestPoolService.d.ts +1294 -0
- package/src/types/TokenDistributor.d.ts +640 -0
- package/src/types/TokenFeeMock.d.ts +544 -0
- package/src/types/TokenMock.d.ts +531 -0
- package/src/types/TreasuryMock.d.ts +86 -0
- package/src/types/UniswapRouterMock.d.ts +1520 -0
- package/src/types/UniswapV2Adapter.d.ts +1463 -0
- package/src/types/UniswapV3Adapter.d.ts +455 -0
- package/src/types/WETHGateway.d.ts +376 -0
- package/src/types/WETHMock.d.ts +433 -0
- package/src/types/WadRayMathTest.d.ts +316 -0
- package/src/types/YearnAdapter.d.ts +609 -0
- package/src/types/YearnMock.d.ts +795 -0
- package/src/types/YearnPriceFeed.d.ts +399 -0
- package/src/types/commons.d.ts +16 -0
- package/src/types/commons.js +5 -0
- package/src/types/commons.ts +37 -0
- package/src/types/factories/ACLTraitTest__factory.ts +137 -0
- package/src/types/factories/ACLTrait__factory.ts +76 -0
- package/src/types/factories/ACL__factory.ts +308 -0
- package/src/types/factories/AccountFactory__factory.ts +510 -0
- package/src/types/factories/AccountMining__factory.ts +214 -0
- package/src/types/factories/AddressProvider__factory.ts +579 -0
- package/src/types/factories/AggregatorV3Interface__factory.ts +141 -0
- package/src/types/factories/ChainlinkPriceFeedMock__factory.ts +209 -0
- package/src/types/factories/ContractsRegister__factory.ts +312 -0
- package/src/types/factories/CreditAccount__factory.ts +256 -0
- package/src/types/factories/CreditFilterMock__factory.ts +1092 -0
- package/src/types/factories/CreditFilter__factory.ts +1053 -0
- package/src/types/factories/CreditManagerMockForFilter__factory.ts +325 -0
- package/src/types/factories/CreditManagerMockForPoolTest__factory.ts +137 -0
- package/src/types/factories/CreditManager__factory.ts +1063 -0
- package/src/types/factories/CurveMock__factory.ts +206 -0
- package/src/types/factories/CurveV1Adapter__factory.ts +263 -0
- package/src/types/factories/DataCompressor__factory.ts +946 -0
- package/src/types/factories/DieselToken__factory.ts +449 -0
- package/src/types/factories/ERC165__factory.ts +39 -0
- package/src/types/factories/ERC20BlockingMock__factory.ts +434 -0
- package/src/types/factories/ERC20__factory.ts +334 -0
- package/src/types/factories/ERC721__factory.ts +463 -0
- package/src/types/factories/Errors__factory.ts +1006 -0
- package/src/types/factories/ExecutorMock__factory.ts +97 -0
- package/src/types/factories/FlashLoanAttacker__factory.ts +119 -0
- package/src/types/factories/FuzzHarness__factory.ts +94 -0
- package/src/types/factories/GearBeta__factory.ts +521 -0
- package/src/types/factories/GearToken__factory.ts +704 -0
- package/src/types/factories/IAccountFactory__factory.ts +230 -0
- package/src/types/factories/IAccountMiner__factory.ts +49 -0
- package/src/types/factories/IAppAddressProvider__factory.ts +104 -0
- package/src/types/factories/IAppCreditManager__factory.ts +208 -0
- package/src/types/factories/IAppERC20__factory.ts +195 -0
- package/src/types/factories/IAppPoolService__factory.ts +73 -0
- package/src/types/factories/ICreditAccount__factory.ts +222 -0
- package/src/types/factories/ICreditFilter__factory.ts +701 -0
- package/src/types/factories/ICreditManager__factory.ts +724 -0
- package/src/types/factories/ICurvePool__factory.ts +169 -0
- package/src/types/factories/IDataCompressor__factory.ts +830 -0
- package/src/types/factories/IERC165__factory.ts +42 -0
- package/src/types/factories/IERC20__factory.ts +203 -0
- package/src/types/factories/IERC721Enumerable__factory.ts +367 -0
- package/src/types/factories/IERC721Metadata__factory.ts +356 -0
- package/src/types/factories/IERC721Receiver__factory.ts +60 -0
- package/src/types/factories/IERC721__factory.ts +308 -0
- package/src/types/factories/IGearToken__factory.ts +343 -0
- package/src/types/factories/IInterestRateModel__factory.ts +50 -0
- package/src/types/factories/IMerkleDistributor__factory.ts +113 -0
- package/src/types/factories/IPoolService__factory.ts +581 -0
- package/src/types/factories/IPriceOracle__factory.ts +113 -0
- package/src/types/factories/IQuoter__factory.ts +149 -0
- package/src/types/factories/ISwapRouter__factory.ts +237 -0
- package/src/types/factories/IUniswapV2Migrator__factory.ts +59 -0
- package/src/types/factories/IUniswapV2Router01__factory.ts +775 -0
- package/src/types/factories/IUniswapV2Router02__factory.ts +977 -0
- package/src/types/factories/IUniswapV3SwapCallback__factory.ts +53 -0
- package/src/types/factories/IWETHGateway__factory.ts +151 -0
- package/src/types/factories/IWETH__factory.ts +64 -0
- package/src/types/factories/IYVault__factory.ts +412 -0
- package/src/types/factories/LeveragedActions__factory.ts +571 -0
- package/src/types/factories/LinearInterestRateModel__factory.ts +237 -0
- package/src/types/factories/MockPoolService__factory.ts +891 -0
- package/src/types/factories/Multicall2__factory.ts +358 -0
- package/src/types/factories/Ownable__factory.ts +75 -0
- package/src/types/factories/PathFinder__factory.ts +301 -0
- package/src/types/factories/Pausable__factory.ts +62 -0
- package/src/types/factories/PercentageMathTest__factory.ts +98 -0
- package/src/types/factories/PoolService__factory.ts +898 -0
- package/src/types/factories/PriceOracle__factory.ts +289 -0
- package/src/types/factories/StepVesting__factory.ts +290 -0
- package/src/types/factories/TestPoolService__factory.ts +960 -0
- package/src/types/factories/TokenDistributor__factory.ts +483 -0
- package/src/types/factories/TokenFeeMock__factory.ts +439 -0
- package/src/types/factories/TokenMock__factory.ts +407 -0
- package/src/types/factories/TreasuryMock__factory.ts +64 -0
- package/src/types/factories/UniswapRouterMock__factory.ts +1043 -0
- package/src/types/factories/UniswapV2Adapter__factory.ts +1064 -0
- package/src/types/factories/UniswapV3Adapter__factory.ts +327 -0
- package/src/types/factories/WETHGateway__factory.ts +240 -0
- package/src/types/factories/WETHMock__factory.ts +349 -0
- package/src/types/factories/WadRayMathTest__factory.ts +236 -0
- package/src/types/factories/YearnAdapter__factory.ts +499 -0
- package/src/types/factories/YearnMock__factory.ts +594 -0
- package/src/types/factories/YearnPriceFeed__factory.ts +378 -0
- package/src/types/hardhat.d.ts +343 -0
- package/src/types/index.d.ts +174 -0
- package/src/types/index.js +178 -0
- package/src/types/index.ts +156 -0
- package/src/utils/events.ts +10 -0
- package/src/utils/formatter.ts +138 -0
- package/src/utils/loading.ts +9 -0
- package/src/utils/math.ts +42 -0
- package/src/utils/multicall.ts +54 -0
- package/src/utils/repeater.ts +18 -0
- package/src/utils/validate.ts +8 -0
- package/tsconfig.json +62 -0
|
@@ -0,0 +1,1167 @@
|
|
|
1
|
+
import { TokenData } from "./tokenData";
|
|
2
|
+
import { BigNumber } from "ethers";
|
|
3
|
+
import { formatBN } from "../utils/formatter";
|
|
4
|
+
import { LEVERAGE_DECIMALS } from "./constants";
|
|
5
|
+
import { EVMEvent, EVMTx, EVMEventProps } from "./eventOrTx";
|
|
6
|
+
import { getContractName } from "./contractsRegister";
|
|
7
|
+
|
|
8
|
+
export interface EventSerialized {
|
|
9
|
+
type:
|
|
10
|
+
| "EventAddLiquidity"
|
|
11
|
+
| "EventRemoveLiquidity"
|
|
12
|
+
| "EventOpenCreditAccount"
|
|
13
|
+
| "EventCloseCreditAccount"
|
|
14
|
+
| "EventLiquidateCreditAccount"
|
|
15
|
+
| "EventRepayCreditAccount"
|
|
16
|
+
| "EventAddCollateral"
|
|
17
|
+
| "EventIncreaseBorrowAmount"
|
|
18
|
+
| "EventCMNewParameters"
|
|
19
|
+
| "EventTokenAllowed"
|
|
20
|
+
| "EventTokenForbidden"
|
|
21
|
+
| "EventContractAllowed"
|
|
22
|
+
| "EventContractForbidden"
|
|
23
|
+
| "EventNewFastCheckParameters"
|
|
24
|
+
| "EventPriceOracleUpdated"
|
|
25
|
+
| "EventTransferPluginAllowed"
|
|
26
|
+
| "EventNewInterestRateModel"
|
|
27
|
+
| "EventNewCreditManagerConnected"
|
|
28
|
+
| "EventBorrowForbidden"
|
|
29
|
+
| "EventNewExpectedLiquidityLimit"
|
|
30
|
+
| "EventNewWithdrawFee"
|
|
31
|
+
| "EventNewPriceFeed"
|
|
32
|
+
| "EventTakeForever"
|
|
33
|
+
| "EventPaused"
|
|
34
|
+
| "EventUnPaused"
|
|
35
|
+
| "EventPausableAdminAdded"
|
|
36
|
+
| "EventPausableAdminRemoved"
|
|
37
|
+
| "EventUnpausableAdminAdded"
|
|
38
|
+
| "EventUnpausableAdminRemoved"
|
|
39
|
+
| "EventOwnershipTransferred";
|
|
40
|
+
|
|
41
|
+
content: any;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class EventParser {
|
|
45
|
+
static serialize(items: Array<EVMTx>): string {
|
|
46
|
+
return JSON.stringify(items.map(i => i.serialize()));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static deserialize(data: EventSerialized): EVMEvent {
|
|
50
|
+
const params = data.content;
|
|
51
|
+
switch (data.type) {
|
|
52
|
+
case "EventAddLiquidity":
|
|
53
|
+
return new EventAddLiquidity(params);
|
|
54
|
+
case "EventRemoveLiquidity":
|
|
55
|
+
return new EventRemoveLiquidity(params);
|
|
56
|
+
case "EventOpenCreditAccount":
|
|
57
|
+
return new EventOpenCreditAccount(params);
|
|
58
|
+
case "EventCloseCreditAccount":
|
|
59
|
+
return new EventCloseCreditAccount(params);
|
|
60
|
+
case "EventLiquidateCreditAccount":
|
|
61
|
+
return new EventLiquidateCreditAccount(params);
|
|
62
|
+
case "EventRepayCreditAccount":
|
|
63
|
+
return new EventRepayCreditAccount(params);
|
|
64
|
+
case "EventAddCollateral":
|
|
65
|
+
return new EventAddCollateral(params);
|
|
66
|
+
case "EventIncreaseBorrowAmount":
|
|
67
|
+
return new EventIncreaseBorrowAmount(params);
|
|
68
|
+
case "EventCMNewParameters":
|
|
69
|
+
return new EventCMNewParameters(params);
|
|
70
|
+
case "EventTokenAllowed":
|
|
71
|
+
return new EventTokenAllowed(params);
|
|
72
|
+
case "EventTokenForbidden":
|
|
73
|
+
return new EventTokenForbidden(params);
|
|
74
|
+
case "EventContractAllowed":
|
|
75
|
+
return new EventContractAllowed(params);
|
|
76
|
+
case "EventContractForbidden":
|
|
77
|
+
return new EventContractForbidden(params);
|
|
78
|
+
case "EventNewFastCheckParameters":
|
|
79
|
+
return new EventNewFastCheckParameters(params);
|
|
80
|
+
case "EventPriceOracleUpdated":
|
|
81
|
+
return new EventPriceOracleUpdated(params);
|
|
82
|
+
case "EventTransferPluginAllowed":
|
|
83
|
+
return new EventTransferPluginAllowed(params);
|
|
84
|
+
case "EventNewInterestRateModel":
|
|
85
|
+
return new EventNewInterestRateModel(params);
|
|
86
|
+
case "EventNewCreditManagerConnected":
|
|
87
|
+
return new EventNewCreditManagerConnected(params);
|
|
88
|
+
case "EventBorrowForbidden":
|
|
89
|
+
return new EventBorrowForbidden(params);
|
|
90
|
+
case "EventNewExpectedLiquidityLimit":
|
|
91
|
+
return new EventNewExpectedLiquidityLimit(params);
|
|
92
|
+
case "EventNewWithdrawFee":
|
|
93
|
+
return new EventNewWithdrawFee(params);
|
|
94
|
+
case "EventNewPriceFeed":
|
|
95
|
+
return new EventNewPriceFeed(params);
|
|
96
|
+
case "EventTakeForever":
|
|
97
|
+
return new EventTakeForever(params);
|
|
98
|
+
case "EventPaused":
|
|
99
|
+
return new EventPaused(params);
|
|
100
|
+
case "EventUnPaused":
|
|
101
|
+
return new EventUnPaused(params);
|
|
102
|
+
case "EventPausableAdminAdded":
|
|
103
|
+
return new EventPausableAdminAdded(params);
|
|
104
|
+
case "EventPausableAdminRemoved":
|
|
105
|
+
return new EventPausableAdminRemoved(params);
|
|
106
|
+
case "EventUnpausableAdminAdded":
|
|
107
|
+
return new EventUnPausableAdminAdded(params);
|
|
108
|
+
case "EventUnpausableAdminRemoved":
|
|
109
|
+
return new EventUnPausableAdminRemoved(params);
|
|
110
|
+
case "EventOwnershipTransferred":
|
|
111
|
+
return new EventTransferOwnership(params);
|
|
112
|
+
|
|
113
|
+
default:
|
|
114
|
+
throw new Error("Unknown transaction for parsing");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
static deserializeArray(data: Array<EventSerialized>): Array<EVMEvent> {
|
|
119
|
+
return data.map(e => {
|
|
120
|
+
return EventParser.deserialize(e);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// POOL EVENTS
|
|
126
|
+
interface EventAddLiquidityProps extends EVMEventProps {
|
|
127
|
+
amount: string;
|
|
128
|
+
underlyingToken: string;
|
|
129
|
+
pool: string;
|
|
130
|
+
}
|
|
131
|
+
export class EventAddLiquidity extends EVMEvent {
|
|
132
|
+
public readonly amount: BigNumber;
|
|
133
|
+
public readonly underlyingToken: string;
|
|
134
|
+
public readonly pool: string;
|
|
135
|
+
|
|
136
|
+
constructor(opts: EventAddLiquidityProps) {
|
|
137
|
+
super({
|
|
138
|
+
block: opts.block,
|
|
139
|
+
txHash: opts.txHash,
|
|
140
|
+
timestamp: opts.timestamp
|
|
141
|
+
});
|
|
142
|
+
this.amount = BigNumber.from(opts.amount);
|
|
143
|
+
this.underlyingToken = opts.underlyingToken;
|
|
144
|
+
this.pool = opts.pool;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
148
|
+
const { decimals = 18, symbol } = tokenData[this.underlyingToken] || {};
|
|
149
|
+
|
|
150
|
+
return `Pool ${getContractName(this.pool)}: Deposit ${formatBN(
|
|
151
|
+
this.amount,
|
|
152
|
+
decimals
|
|
153
|
+
)} ${symbol}`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface RemoveLiquidityProps extends EVMEventProps {
|
|
158
|
+
amount: string;
|
|
159
|
+
underlyingToken: string;
|
|
160
|
+
dieselToken: string;
|
|
161
|
+
pool: string;
|
|
162
|
+
}
|
|
163
|
+
export class EventRemoveLiquidity extends EVMEvent {
|
|
164
|
+
public readonly amount: BigNumber;
|
|
165
|
+
public readonly underlyingToken: string;
|
|
166
|
+
public readonly dieselToken: string;
|
|
167
|
+
public readonly pool: string;
|
|
168
|
+
|
|
169
|
+
constructor(opts: RemoveLiquidityProps) {
|
|
170
|
+
super({
|
|
171
|
+
block: opts.block,
|
|
172
|
+
txHash: opts.txHash,
|
|
173
|
+
timestamp: opts.timestamp
|
|
174
|
+
});
|
|
175
|
+
this.amount = BigNumber.from(opts.amount);
|
|
176
|
+
this.underlyingToken = opts.underlyingToken;
|
|
177
|
+
this.dieselToken = opts.dieselToken;
|
|
178
|
+
this.pool = opts.pool;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
182
|
+
const { decimals = 18, symbol } = tokenData[this.dieselToken] || {};
|
|
183
|
+
|
|
184
|
+
return `Pool ${getContractName(this.pool)}: withdraw ${formatBN(
|
|
185
|
+
this.amount,
|
|
186
|
+
decimals
|
|
187
|
+
)} ${symbol}`;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// CREDIT MANAGER EVENTS
|
|
192
|
+
|
|
193
|
+
interface OpenCreditAccountProps extends EVMEventProps {
|
|
194
|
+
amount: string;
|
|
195
|
+
underlyingToken: string;
|
|
196
|
+
leverage: number;
|
|
197
|
+
creditManager: string;
|
|
198
|
+
}
|
|
199
|
+
export class EventOpenCreditAccount extends EVMEvent {
|
|
200
|
+
public readonly amount: BigNumber;
|
|
201
|
+
public readonly underlyingToken: string;
|
|
202
|
+
public readonly leverage: number;
|
|
203
|
+
public readonly creditManager: string;
|
|
204
|
+
|
|
205
|
+
constructor(opts: OpenCreditAccountProps) {
|
|
206
|
+
super({
|
|
207
|
+
block: opts.block,
|
|
208
|
+
txHash: opts.txHash,
|
|
209
|
+
timestamp: opts.timestamp
|
|
210
|
+
});
|
|
211
|
+
this.amount = BigNumber.from(opts.amount);
|
|
212
|
+
this.underlyingToken = opts.underlyingToken;
|
|
213
|
+
this.leverage = opts.leverage;
|
|
214
|
+
this.creditManager = opts.creditManager;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
218
|
+
const { decimals = 18, symbol } = tokenData[this.underlyingToken] || {};
|
|
219
|
+
|
|
220
|
+
return `Credit account ${getContractName(
|
|
221
|
+
this.creditManager
|
|
222
|
+
)}: open ${formatBN(
|
|
223
|
+
this.amount,
|
|
224
|
+
decimals
|
|
225
|
+
)} ${symbol} x ${this.leverage.toFixed(2)} ⇒
|
|
226
|
+
${formatBN(
|
|
227
|
+
this.amount
|
|
228
|
+
.mul(Math.floor(this.leverage + LEVERAGE_DECIMALS))
|
|
229
|
+
.div(LEVERAGE_DECIMALS),
|
|
230
|
+
decimals + 2
|
|
231
|
+
)} ${symbol}`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
interface CloseCreditAccountProps extends EVMEventProps {
|
|
236
|
+
amount: string;
|
|
237
|
+
underlyingToken: string;
|
|
238
|
+
creditManager: string;
|
|
239
|
+
}
|
|
240
|
+
export class EventCloseCreditAccount extends EVMEvent {
|
|
241
|
+
public readonly amount: BigNumber;
|
|
242
|
+
public readonly underlyingToken: string;
|
|
243
|
+
public readonly creditManager: string;
|
|
244
|
+
|
|
245
|
+
constructor(opts: CloseCreditAccountProps) {
|
|
246
|
+
super({
|
|
247
|
+
block: opts.block,
|
|
248
|
+
txHash: opts.txHash,
|
|
249
|
+
timestamp: opts.timestamp
|
|
250
|
+
});
|
|
251
|
+
this.amount = BigNumber.from(opts.amount);
|
|
252
|
+
this.underlyingToken = opts.underlyingToken;
|
|
253
|
+
this.creditManager = opts.creditManager;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
257
|
+
const { decimals = 18, symbol } = tokenData[this.underlyingToken] || {};
|
|
258
|
+
|
|
259
|
+
return `Credit account ${getContractName(
|
|
260
|
+
this.creditManager
|
|
261
|
+
)}: was closed and got ${formatBN(
|
|
262
|
+
this.amount,
|
|
263
|
+
decimals
|
|
264
|
+
)} ${symbol} as remaining funds`;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface LiquidateCreditAccountProps extends EVMEventProps {
|
|
269
|
+
amount: string;
|
|
270
|
+
underlyingToken: string;
|
|
271
|
+
creditManager: string;
|
|
272
|
+
}
|
|
273
|
+
export class EventLiquidateCreditAccount extends EVMEvent {
|
|
274
|
+
public readonly amount: BigNumber;
|
|
275
|
+
public readonly underlyingToken: string;
|
|
276
|
+
public readonly creditManager: string;
|
|
277
|
+
|
|
278
|
+
constructor(opts: LiquidateCreditAccountProps) {
|
|
279
|
+
super({
|
|
280
|
+
block: opts.block,
|
|
281
|
+
txHash: opts.txHash,
|
|
282
|
+
timestamp: opts.timestamp
|
|
283
|
+
});
|
|
284
|
+
this.amount = BigNumber.from(opts.amount);
|
|
285
|
+
this.underlyingToken = opts.underlyingToken;
|
|
286
|
+
this.creditManager = opts.creditManager;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
290
|
+
const { decimals = 18, symbol } = tokenData[this.underlyingToken] || {};
|
|
291
|
+
|
|
292
|
+
return `Credit account ${getContractName(
|
|
293
|
+
this.creditManager
|
|
294
|
+
)}: was liquidated. ${formatBN(
|
|
295
|
+
this.amount,
|
|
296
|
+
decimals
|
|
297
|
+
)} ${symbol} were paid back as remaining funds`;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
interface RepayCreditAccountProps extends EVMEventProps {
|
|
302
|
+
underlyingToken: string;
|
|
303
|
+
creditManager: string;
|
|
304
|
+
}
|
|
305
|
+
export class EventRepayCreditAccount extends EVMEvent {
|
|
306
|
+
public readonly underlyingToken: string;
|
|
307
|
+
public readonly creditManager: string;
|
|
308
|
+
|
|
309
|
+
constructor(opts: RepayCreditAccountProps) {
|
|
310
|
+
super({
|
|
311
|
+
block: opts.block,
|
|
312
|
+
txHash: opts.txHash,
|
|
313
|
+
timestamp: opts.timestamp
|
|
314
|
+
});
|
|
315
|
+
this.underlyingToken = opts.underlyingToken;
|
|
316
|
+
this.creditManager = opts.creditManager;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
320
|
+
return `Credit account ${getContractName(this.creditManager)}: was repaid`;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
interface AddCollateralProps extends EVMEventProps {
|
|
325
|
+
amount: string;
|
|
326
|
+
addedToken: string;
|
|
327
|
+
creditManager: string;
|
|
328
|
+
}
|
|
329
|
+
export class EventAddCollateral extends EVMEvent {
|
|
330
|
+
public readonly amount: BigNumber;
|
|
331
|
+
public readonly addedToken: string;
|
|
332
|
+
public readonly creditManager: string;
|
|
333
|
+
|
|
334
|
+
constructor(opts: AddCollateralProps) {
|
|
335
|
+
super({
|
|
336
|
+
block: opts.block,
|
|
337
|
+
txHash: opts.txHash,
|
|
338
|
+
timestamp: opts.timestamp
|
|
339
|
+
});
|
|
340
|
+
this.amount = BigNumber.from(opts.amount);
|
|
341
|
+
|
|
342
|
+
this.addedToken = opts.addedToken;
|
|
343
|
+
this.creditManager = opts.creditManager;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
347
|
+
const { decimals = 18, symbol } = tokenData[this.addedToken] || {};
|
|
348
|
+
|
|
349
|
+
return `Credit account ${getContractName(
|
|
350
|
+
this.creditManager
|
|
351
|
+
)}: added ${formatBN(this.amount, decimals)} ${symbol} as collateral`;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
interface IncreaseBorrowAmountProps extends EVMEventProps {
|
|
356
|
+
amount: string;
|
|
357
|
+
underlyingToken: string;
|
|
358
|
+
creditManager: string;
|
|
359
|
+
}
|
|
360
|
+
export class EventIncreaseBorrowAmount extends EVMEvent {
|
|
361
|
+
public readonly amount: BigNumber;
|
|
362
|
+
public readonly underlyingToken: string;
|
|
363
|
+
public readonly creditManager: string;
|
|
364
|
+
|
|
365
|
+
constructor(opts: IncreaseBorrowAmountProps) {
|
|
366
|
+
super({
|
|
367
|
+
block: opts.block,
|
|
368
|
+
txHash: opts.txHash,
|
|
369
|
+
timestamp: opts.timestamp
|
|
370
|
+
});
|
|
371
|
+
this.amount = BigNumber.from(opts.amount);
|
|
372
|
+
this.underlyingToken = opts.underlyingToken;
|
|
373
|
+
this.creditManager = opts.creditManager;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
377
|
+
const { decimals = 18, symbol } = tokenData[this.underlyingToken] || {};
|
|
378
|
+
|
|
379
|
+
return `Credit account ${getContractName(
|
|
380
|
+
this.creditManager
|
|
381
|
+
)}: borrowed amount was increased for ${formatBN(
|
|
382
|
+
this.amount,
|
|
383
|
+
decimals
|
|
384
|
+
)} ${symbol}`;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// // Emits each time when new fees are set
|
|
389
|
+
// event NewParameters(
|
|
390
|
+
// uint256 minAmount,
|
|
391
|
+
// uint256 maxAmount,
|
|
392
|
+
// uint256 maxLeverage,
|
|
393
|
+
// uint256 feeInterest,
|
|
394
|
+
// uint256 feeLiquidation,
|
|
395
|
+
// uint256 liquidationDiscount
|
|
396
|
+
// );
|
|
397
|
+
|
|
398
|
+
interface CMNewParametersProps extends EVMEventProps {
|
|
399
|
+
creditManager: string;
|
|
400
|
+
underlyingToken: string;
|
|
401
|
+
minAmount: string;
|
|
402
|
+
maxAmount: string;
|
|
403
|
+
maxLeverage: number;
|
|
404
|
+
feeInterest: number;
|
|
405
|
+
feeLiquidation: number;
|
|
406
|
+
liquidationDiscount: number;
|
|
407
|
+
prevMinAmount: string;
|
|
408
|
+
prevMaxAmount: string;
|
|
409
|
+
prevMaxLeverage: number;
|
|
410
|
+
prevFeeInterest: number;
|
|
411
|
+
prevFeeLiquidation: number;
|
|
412
|
+
prevLiquidationDiscount: number;
|
|
413
|
+
}
|
|
414
|
+
export class EventCMNewParameters extends EVMEvent {
|
|
415
|
+
public readonly creditManager: string;
|
|
416
|
+
public readonly underlyingToken: string;
|
|
417
|
+
public readonly minAmount: BigNumber;
|
|
418
|
+
public readonly maxAmount: BigNumber;
|
|
419
|
+
public readonly maxLeverage: number;
|
|
420
|
+
public readonly feeInterest: number;
|
|
421
|
+
public readonly feeLiquidation: number;
|
|
422
|
+
public readonly liquidationDiscount: number;
|
|
423
|
+
public readonly prevMinAmount: BigNumber;
|
|
424
|
+
public readonly prevMaxAmount: BigNumber;
|
|
425
|
+
public readonly prevMaxLeverage: number;
|
|
426
|
+
public readonly prevFeeInterest: number;
|
|
427
|
+
public readonly prevFeeLiquidation: number;
|
|
428
|
+
public readonly prevLiquidationDiscount: number;
|
|
429
|
+
|
|
430
|
+
constructor(opts: CMNewParametersProps) {
|
|
431
|
+
super({
|
|
432
|
+
block: opts.block,
|
|
433
|
+
txHash: opts.txHash,
|
|
434
|
+
timestamp: opts.timestamp
|
|
435
|
+
});
|
|
436
|
+
this.creditManager = opts.creditManager;
|
|
437
|
+
this.underlyingToken = opts.underlyingToken;
|
|
438
|
+
this.minAmount = BigNumber.from(opts.minAmount);
|
|
439
|
+
this.maxAmount = BigNumber.from(opts.maxAmount);
|
|
440
|
+
this.maxLeverage = opts.maxLeverage;
|
|
441
|
+
this.feeInterest = opts.feeInterest;
|
|
442
|
+
this.feeLiquidation = opts.feeLiquidation;
|
|
443
|
+
this.liquidationDiscount = opts.liquidationDiscount;
|
|
444
|
+
|
|
445
|
+
this.prevMinAmount = BigNumber.from(opts.prevMinAmount);
|
|
446
|
+
this.prevMaxAmount = BigNumber.from(opts.prevMaxAmount);
|
|
447
|
+
this.prevMaxLeverage = opts.prevMaxLeverage;
|
|
448
|
+
this.prevFeeInterest = opts.prevFeeInterest;
|
|
449
|
+
this.prevFeeLiquidation = opts.prevFeeLiquidation;
|
|
450
|
+
this.prevLiquidationDiscount = opts.prevLiquidationDiscount;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
454
|
+
const token = tokenData[this.underlyingToken];
|
|
455
|
+
let msg = `Credit manager ${getContractName(this.creditManager)} updated: `;
|
|
456
|
+
|
|
457
|
+
if (this.minAmount !== this.prevMinAmount) {
|
|
458
|
+
msg += `min amount: ${formatBN(
|
|
459
|
+
this.prevMinAmount,
|
|
460
|
+
token.decimals
|
|
461
|
+
)} => ${formatBN(this.minAmount, token.decimals)} ${token.symbol}, `;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (this.maxAmount !== this.prevMaxAmount) {
|
|
465
|
+
msg += `max amount: ${formatBN(
|
|
466
|
+
this.prevMaxAmount,
|
|
467
|
+
token.decimals
|
|
468
|
+
)} => ${formatBN(this.maxAmount, token.decimals)} ${token.symbol}, `;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (this.maxLeverage !== this.prevMaxLeverage) {
|
|
472
|
+
msg += `max leverage: ${this.prevMaxLeverage / 100 + 1} => ${
|
|
473
|
+
this.maxLeverage / 100 + 1
|
|
474
|
+
}, `;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (this.feeInterest !== this.prevFeeInterest) {
|
|
478
|
+
msg += `interest fee: ${this.prevFeeInterest / 100}% => ${
|
|
479
|
+
this.feeInterest / 100
|
|
480
|
+
}%, `;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (this.feeLiquidation !== this.prevFeeLiquidation) {
|
|
484
|
+
msg += `liquidation fee: ${this.prevFeeLiquidation / 100}% => ${
|
|
485
|
+
this.feeLiquidation / 100
|
|
486
|
+
}%, `;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (this.liquidationDiscount !== this.prevLiquidationDiscount) {
|
|
490
|
+
msg += `liquidation premium: ${
|
|
491
|
+
100 - this.prevLiquidationDiscount / 100
|
|
492
|
+
}% => ${100 - this.liquidationDiscount / 100}%, `;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return msg.slice(0, msg.length - 2);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// // Emits each time token is allowed or liquidation threshold changed
|
|
500
|
+
// event TokenAllowed(address indexed token, uint256 liquidityThreshold);
|
|
501
|
+
|
|
502
|
+
export type TokenAllowanceType = "NewToken" | "LTUpdated" | "Allowed";
|
|
503
|
+
|
|
504
|
+
interface TokenAllowedProps extends EVMEventProps {
|
|
505
|
+
creditManager: string;
|
|
506
|
+
token: string;
|
|
507
|
+
liquidityThreshold: number;
|
|
508
|
+
prevLiquidationThreshold?: number;
|
|
509
|
+
status: TokenAllowanceType;
|
|
510
|
+
}
|
|
511
|
+
export class EventTokenAllowed extends EVMEvent {
|
|
512
|
+
public readonly creditManager: string;
|
|
513
|
+
public readonly token: string;
|
|
514
|
+
public readonly liquidityThreshold: number;
|
|
515
|
+
public readonly prevLiquidationThreshold?: number;
|
|
516
|
+
public readonly status: TokenAllowanceType;
|
|
517
|
+
|
|
518
|
+
constructor(opts: TokenAllowedProps) {
|
|
519
|
+
super({
|
|
520
|
+
block: opts.block,
|
|
521
|
+
txHash: opts.txHash,
|
|
522
|
+
timestamp: opts.timestamp
|
|
523
|
+
});
|
|
524
|
+
this.creditManager = opts.creditManager;
|
|
525
|
+
this.token = opts.token;
|
|
526
|
+
this.liquidityThreshold = opts.liquidityThreshold;
|
|
527
|
+
this.prevLiquidationThreshold = opts.prevLiquidationThreshold;
|
|
528
|
+
this.status = opts.status;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
532
|
+
const token = tokenData[this.token];
|
|
533
|
+
let msg = `Credit manager ${getContractName(this.creditManager)} updated `;
|
|
534
|
+
switch (this.status) {
|
|
535
|
+
case "NewToken":
|
|
536
|
+
return `${msg}: New token allowed: ${
|
|
537
|
+
token.symbol
|
|
538
|
+
}, liquidation threshold: ${this.liquidityThreshold / 100}%`;
|
|
539
|
+
case "Allowed":
|
|
540
|
+
return `${msg}: ${
|
|
541
|
+
token.symbol
|
|
542
|
+
} is allowed now, liquidation threshold: ${
|
|
543
|
+
this.liquidityThreshold / 100
|
|
544
|
+
}%`;
|
|
545
|
+
case "LTUpdated":
|
|
546
|
+
return `${msg}: ${token.symbol} liquidation threshold: ${
|
|
547
|
+
(this.prevLiquidationThreshold || 0) / 100
|
|
548
|
+
} => ${this.liquidityThreshold / 100}%`;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// // Emits each time token is allowed or liquidtion threshold changed
|
|
554
|
+
// event TokenForbidden(address indexed token);
|
|
555
|
+
|
|
556
|
+
interface TokenForbiddenProps extends EVMEventProps {
|
|
557
|
+
creditManager: string;
|
|
558
|
+
token: string;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export class EventTokenForbidden extends EVMEvent {
|
|
562
|
+
public readonly creditManager: string;
|
|
563
|
+
public readonly token: string;
|
|
564
|
+
|
|
565
|
+
constructor(opts: TokenForbiddenProps) {
|
|
566
|
+
super({
|
|
567
|
+
block: opts.block,
|
|
568
|
+
txHash: opts.txHash,
|
|
569
|
+
timestamp: opts.timestamp
|
|
570
|
+
});
|
|
571
|
+
this.creditManager = opts.creditManager;
|
|
572
|
+
this.token = opts.token;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
576
|
+
const token = tokenData[this.token];
|
|
577
|
+
return `Credit manager ${getContractName(this.creditManager)} updated ${
|
|
578
|
+
token.symbol
|
|
579
|
+
} forbidden`;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
//
|
|
584
|
+
// // Emits each time contract is allowed or adapter changed
|
|
585
|
+
// event ContractAllowed(address indexed protocol, address indexed adapter);
|
|
586
|
+
|
|
587
|
+
export type EventContractAllowedStatus = "Connected" | "AdapterUpdate";
|
|
588
|
+
|
|
589
|
+
interface ContractAllowedProps extends EVMEventProps {
|
|
590
|
+
creditManager: string;
|
|
591
|
+
protocol: string;
|
|
592
|
+
adapter: string;
|
|
593
|
+
status: EventContractAllowedStatus;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export class EventContractAllowed extends EVMEvent {
|
|
597
|
+
public readonly creditManager: string;
|
|
598
|
+
public readonly protocol: string;
|
|
599
|
+
public readonly adapter: string;
|
|
600
|
+
public readonly status: EventContractAllowedStatus;
|
|
601
|
+
|
|
602
|
+
constructor(opts: ContractAllowedProps) {
|
|
603
|
+
super({
|
|
604
|
+
block: opts.block,
|
|
605
|
+
txHash: opts.txHash,
|
|
606
|
+
timestamp: opts.timestamp
|
|
607
|
+
});
|
|
608
|
+
this.creditManager = opts.creditManager;
|
|
609
|
+
this.protocol = opts.protocol;
|
|
610
|
+
this.adapter = opts.adapter;
|
|
611
|
+
this.status = opts.status;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
toString(_: Record<string, TokenData>): string {
|
|
615
|
+
let msg = `Credit manager ${getContractName(this.creditManager)} updated`;
|
|
616
|
+
|
|
617
|
+
switch (this.status) {
|
|
618
|
+
case "Connected":
|
|
619
|
+
return `${msg} : ${getContractName(
|
|
620
|
+
this.protocol
|
|
621
|
+
)} was connected. Adapter at: ${this.adapter}`;
|
|
622
|
+
case "AdapterUpdate":
|
|
623
|
+
return `${msg} : ${getContractName(
|
|
624
|
+
this.protocol
|
|
625
|
+
)} adapter was updated. New adapter: ${this.adapter}`;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
//
|
|
631
|
+
// // Emits each time contract is forbidden
|
|
632
|
+
// event ContractForbidden(address indexed protocol);
|
|
633
|
+
|
|
634
|
+
interface ContractForbiddenProps extends EVMEventProps {
|
|
635
|
+
creditManager: string;
|
|
636
|
+
protocol: string;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export class EventContractForbidden extends EVMEvent {
|
|
640
|
+
public readonly creditManager: string;
|
|
641
|
+
public readonly protocol: string;
|
|
642
|
+
|
|
643
|
+
constructor(opts: ContractForbiddenProps) {
|
|
644
|
+
super({
|
|
645
|
+
block: opts.block,
|
|
646
|
+
txHash: opts.txHash,
|
|
647
|
+
timestamp: opts.timestamp
|
|
648
|
+
});
|
|
649
|
+
this.creditManager = opts.creditManager;
|
|
650
|
+
this.protocol = opts.protocol;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
toString(_: Record<string, TokenData>): string {
|
|
654
|
+
return `Credit manager ${getContractName(
|
|
655
|
+
this.creditManager
|
|
656
|
+
)} updated: ${getContractName(this.protocol)}`;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
//
|
|
661
|
+
// // Emits each time when fast check parameters are updated
|
|
662
|
+
// event NewFastCheckParameters(uint256 chiThreshold, uint256 fastCheckDelay);
|
|
663
|
+
|
|
664
|
+
interface NewFastCheckParametersProps extends EVMEventProps {
|
|
665
|
+
creditManager: string;
|
|
666
|
+
chiThreshold: number;
|
|
667
|
+
fastCheckDelay: number;
|
|
668
|
+
prevChiThreshold?: number;
|
|
669
|
+
prevFastCheckDelay?: number;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export class EventNewFastCheckParameters extends EVMEvent {
|
|
673
|
+
public readonly creditManager: string;
|
|
674
|
+
public readonly chiThreshold: number;
|
|
675
|
+
public readonly fastCheckDelay: number;
|
|
676
|
+
public readonly prevChiThreshold?: number;
|
|
677
|
+
public readonly prevFastCheckDelay?: number;
|
|
678
|
+
|
|
679
|
+
constructor(opts: NewFastCheckParametersProps) {
|
|
680
|
+
super({
|
|
681
|
+
block: opts.block,
|
|
682
|
+
txHash: opts.txHash,
|
|
683
|
+
timestamp: opts.timestamp
|
|
684
|
+
});
|
|
685
|
+
this.creditManager = opts.creditManager;
|
|
686
|
+
this.chiThreshold = opts.chiThreshold;
|
|
687
|
+
this.fastCheckDelay = opts.fastCheckDelay;
|
|
688
|
+
this.prevChiThreshold = opts.prevChiThreshold;
|
|
689
|
+
this.prevFastCheckDelay = opts.prevFastCheckDelay;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
toString(_: Record<string, TokenData>): string {
|
|
693
|
+
let msg = `Credit manager ${getContractName(this.creditManager)} updated: `;
|
|
694
|
+
|
|
695
|
+
if (this.chiThreshold !== this.prevChiThreshold) {
|
|
696
|
+
msg += `Chi threshold: ${this.prevChiThreshold} => ${this.chiThreshold}, `;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if (this.fastCheckDelay !== this.prevFastCheckDelay) {
|
|
700
|
+
msg += `fast check delay: ${this.prevFastCheckDelay} => ${this.fastCheckDelay}, `;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
return msg.slice(0, msg.length - 2);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
// event PriceOracleUpdated(address indexed newPriceOracle);
|
|
708
|
+
|
|
709
|
+
interface PriceOracleUpdatedProps extends EVMEventProps {
|
|
710
|
+
creditManager: string;
|
|
711
|
+
priceOracle: string;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export class EventPriceOracleUpdated extends EVMEvent {
|
|
715
|
+
public readonly creditManager: string;
|
|
716
|
+
public readonly priceOracle: string;
|
|
717
|
+
|
|
718
|
+
constructor(opts: PriceOracleUpdatedProps) {
|
|
719
|
+
super({
|
|
720
|
+
block: opts.block,
|
|
721
|
+
txHash: opts.txHash,
|
|
722
|
+
timestamp: opts.timestamp
|
|
723
|
+
});
|
|
724
|
+
this.creditManager = opts.creditManager;
|
|
725
|
+
this.priceOracle = opts.priceOracle;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
toString(_: Record<string, TokenData>): string {
|
|
729
|
+
return `Credit manager ${getContractName(
|
|
730
|
+
this.creditManager
|
|
731
|
+
)} updated: price oracle was updated. New price oracle ${getContractName(
|
|
732
|
+
this.priceOracle
|
|
733
|
+
)}`;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// event TransferPluginAllowed(
|
|
738
|
+
// address indexed plugin,
|
|
739
|
+
// bool state
|
|
740
|
+
// );
|
|
741
|
+
|
|
742
|
+
interface TransferPluginAllowedProps extends EVMEventProps {
|
|
743
|
+
creditManager: string;
|
|
744
|
+
priceOracle: string;
|
|
745
|
+
state: boolean;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export class EventTransferPluginAllowed extends EVMEvent {
|
|
749
|
+
public readonly creditManager: string;
|
|
750
|
+
public readonly plugin: string;
|
|
751
|
+
public readonly state: boolean;
|
|
752
|
+
|
|
753
|
+
constructor(opts: TransferPluginAllowedProps) {
|
|
754
|
+
super({
|
|
755
|
+
block: opts.block,
|
|
756
|
+
txHash: opts.txHash,
|
|
757
|
+
timestamp: opts.timestamp
|
|
758
|
+
});
|
|
759
|
+
this.creditManager = opts.creditManager;
|
|
760
|
+
this.plugin = opts.priceOracle;
|
|
761
|
+
this.state = opts.state;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
toString(_: Record<string, TokenData>): string {
|
|
765
|
+
return `Credit manager ${getContractName(
|
|
766
|
+
this.creditManager
|
|
767
|
+
)} updated: transfer plugin ${getContractName(this.plugin)} was ${
|
|
768
|
+
this.state ? "allowed" : "forbidden"
|
|
769
|
+
}`;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// // Emits each time when Interest Rate model was changed
|
|
774
|
+
// event NewInterestRateModel(address indexed newInterestRateModel);
|
|
775
|
+
|
|
776
|
+
interface NewInterestRateModelProps extends EVMEventProps {
|
|
777
|
+
pool: string;
|
|
778
|
+
newInterestRateModel: string;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
export class EventNewInterestRateModel extends EVMEvent {
|
|
782
|
+
public readonly pool: string;
|
|
783
|
+
public readonly newInterestRateModel: string;
|
|
784
|
+
|
|
785
|
+
constructor(opts: NewInterestRateModelProps) {
|
|
786
|
+
super({
|
|
787
|
+
block: opts.block,
|
|
788
|
+
txHash: opts.txHash,
|
|
789
|
+
timestamp: opts.timestamp
|
|
790
|
+
});
|
|
791
|
+
this.pool = opts.pool;
|
|
792
|
+
this.newInterestRateModel = opts.newInterestRateModel;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
toString(_: Record<string, TokenData>): string {
|
|
796
|
+
return `Pool ${getContractName(
|
|
797
|
+
this.pool
|
|
798
|
+
)} updated: interest rate model was updated. New model: ${getContractName(
|
|
799
|
+
this.newInterestRateModel
|
|
800
|
+
)}`;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
//
|
|
805
|
+
// // Emits each time when new credit Manager was connected
|
|
806
|
+
// event NewCreditManagerConnected(address indexed creditManager);
|
|
807
|
+
|
|
808
|
+
interface NewCreditManagerConnectedProps extends EVMEventProps {
|
|
809
|
+
pool: string;
|
|
810
|
+
creditManager: string;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export class EventNewCreditManagerConnected extends EVMEvent {
|
|
814
|
+
public readonly pool: string;
|
|
815
|
+
public readonly creditManager: string;
|
|
816
|
+
|
|
817
|
+
constructor(opts: NewCreditManagerConnectedProps) {
|
|
818
|
+
super({
|
|
819
|
+
block: opts.block,
|
|
820
|
+
txHash: opts.txHash,
|
|
821
|
+
timestamp: opts.timestamp
|
|
822
|
+
});
|
|
823
|
+
this.pool = opts.pool;
|
|
824
|
+
this.creditManager = opts.creditManager;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
toString(_: Record<string, TokenData>): string {
|
|
828
|
+
return `Pool ${getContractName(
|
|
829
|
+
this.pool
|
|
830
|
+
)} updated: new credit manager ${getContractName(
|
|
831
|
+
this.creditManager
|
|
832
|
+
)} was connected`;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
//
|
|
837
|
+
// // Emits each time when borrow forbidden for credit manager
|
|
838
|
+
// event BorrowForbidden(address indexed creditManager);
|
|
839
|
+
|
|
840
|
+
interface BorrowForbiddenProps extends EVMEventProps {
|
|
841
|
+
pool: string;
|
|
842
|
+
creditManager: string;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
export class EventBorrowForbidden extends EVMEvent {
|
|
846
|
+
public readonly pool: string;
|
|
847
|
+
public readonly creditManager: string;
|
|
848
|
+
|
|
849
|
+
constructor(opts: BorrowForbiddenProps) {
|
|
850
|
+
super({
|
|
851
|
+
block: opts.block,
|
|
852
|
+
txHash: opts.txHash,
|
|
853
|
+
timestamp: opts.timestamp
|
|
854
|
+
});
|
|
855
|
+
this.pool = opts.pool;
|
|
856
|
+
this.creditManager = opts.creditManager;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
toString(_: Record<string, TokenData>): string {
|
|
860
|
+
return `Pool ${getContractName(
|
|
861
|
+
this.pool
|
|
862
|
+
)} updated: credit manager ${getContractName(
|
|
863
|
+
this.creditManager
|
|
864
|
+
)} was forbidden to borrow`;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// // Emits after expected liquidity limit update
|
|
869
|
+
// event NewExpectedLiquidityLimit(uint256 newLimit);
|
|
870
|
+
|
|
871
|
+
interface NewExpectedLiquidityLimitProps extends EVMEventProps {
|
|
872
|
+
pool: string;
|
|
873
|
+
underlyingToken: string;
|
|
874
|
+
newLimit: string;
|
|
875
|
+
oldLimit: string;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
export class EventNewExpectedLiquidityLimit extends EVMEvent {
|
|
879
|
+
public readonly pool: string;
|
|
880
|
+
public readonly underlyingToken: string;
|
|
881
|
+
public readonly newLimit: BigNumber;
|
|
882
|
+
public readonly prevLimit: BigNumber;
|
|
883
|
+
|
|
884
|
+
constructor(opts: NewExpectedLiquidityLimitProps) {
|
|
885
|
+
super({
|
|
886
|
+
block: opts.block,
|
|
887
|
+
txHash: opts.txHash,
|
|
888
|
+
timestamp: opts.timestamp
|
|
889
|
+
});
|
|
890
|
+
this.pool = opts.pool;
|
|
891
|
+
this.underlyingToken = opts.underlyingToken;
|
|
892
|
+
this.newLimit = BigNumber.from(opts.newLimit);
|
|
893
|
+
this.prevLimit = BigNumber.from(opts.oldLimit);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
897
|
+
const { decimals = 18, symbol } = tokenData[this.underlyingToken] || {};
|
|
898
|
+
|
|
899
|
+
return this.prevLimit.isZero()
|
|
900
|
+
? `Pool ${getContractName(
|
|
901
|
+
this.pool
|
|
902
|
+
)} updated: expected liquidity limit was set to ${formatBN(
|
|
903
|
+
this.newLimit,
|
|
904
|
+
decimals
|
|
905
|
+
)} ${symbol}`
|
|
906
|
+
: `Pool ${getContractName(
|
|
907
|
+
this.pool
|
|
908
|
+
)} updated: expected liquidity limit was ${
|
|
909
|
+
this.newLimit.gt(this.prevLimit) ? "increased" : "decreased"
|
|
910
|
+
}: ${formatBN(this.prevLimit, decimals)} ${symbol} => ${formatBN(
|
|
911
|
+
this.newLimit,
|
|
912
|
+
decimals
|
|
913
|
+
)} ${symbol}`;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
// // Emits each time when withdraw fee is udpated
|
|
918
|
+
// event NewWithdrawFee(uint256 fee);
|
|
919
|
+
|
|
920
|
+
interface NewWithdrawFeeProps extends EVMEventProps {
|
|
921
|
+
pool: string;
|
|
922
|
+
underlyingToken: string;
|
|
923
|
+
newFee: string;
|
|
924
|
+
oldFee: string;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
export class EventNewWithdrawFee extends EVMEvent {
|
|
928
|
+
public readonly pool: string;
|
|
929
|
+
public readonly underlyingToken: string;
|
|
930
|
+
public readonly newFee: number;
|
|
931
|
+
public readonly prevFee: number;
|
|
932
|
+
|
|
933
|
+
constructor(opts: NewWithdrawFeeProps) {
|
|
934
|
+
super({
|
|
935
|
+
block: opts.block,
|
|
936
|
+
txHash: opts.txHash,
|
|
937
|
+
timestamp: opts.timestamp
|
|
938
|
+
});
|
|
939
|
+
this.pool = opts.pool;
|
|
940
|
+
this.underlyingToken = opts.underlyingToken;
|
|
941
|
+
this.newFee = Number(opts.newFee);
|
|
942
|
+
this.prevFee = Number(opts.oldFee);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
946
|
+
return this.prevFee === 0
|
|
947
|
+
? `Pool ${getContractName(this.pool)} updated: withdraw fee was set to: ${
|
|
948
|
+
this.newFee / 100
|
|
949
|
+
}%`
|
|
950
|
+
: `Pool ${getContractName(this.pool)} updated: withdraw fee was ${
|
|
951
|
+
this.newFee > this.prevFee ? "increased" : "decreased"
|
|
952
|
+
}: ${this.prevFee / 100}% => ${this.newFee / 100}%`;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// // Emits each time new configurator is set up
|
|
957
|
+
// event NewPriceFeed(address indexed token, address indexed priceFeed);
|
|
958
|
+
|
|
959
|
+
interface NewPriceFeedProps extends EVMEventProps {
|
|
960
|
+
token: string;
|
|
961
|
+
priceFeed: string;
|
|
962
|
+
}
|
|
963
|
+
export class EventNewPriceFeed extends EVMEvent {
|
|
964
|
+
public readonly token: string;
|
|
965
|
+
public readonly priceFeed: string;
|
|
966
|
+
|
|
967
|
+
constructor(opts: NewPriceFeedProps) {
|
|
968
|
+
super({
|
|
969
|
+
block: opts.block,
|
|
970
|
+
txHash: opts.txHash,
|
|
971
|
+
timestamp: opts.timestamp
|
|
972
|
+
});
|
|
973
|
+
this.token = opts.token;
|
|
974
|
+
this.priceFeed = opts.priceFeed;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
toString(tokenData: Record<string, TokenData>): string {
|
|
978
|
+
const { symbol } = tokenData[this.token] || {};
|
|
979
|
+
|
|
980
|
+
return `PriceOracle: oracle for ${symbol} was updated to ${getContractName(
|
|
981
|
+
this.priceFeed
|
|
982
|
+
)}`;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
// // emits each time when DAO takes account from account factory forever
|
|
987
|
+
// event TakeForever(address indexed creditAccount, address indexed to);
|
|
988
|
+
|
|
989
|
+
interface TakeForeverProps extends EVMEventProps {
|
|
990
|
+
creditAccount: string;
|
|
991
|
+
to: string;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
export class EventTakeForever extends EVMEvent {
|
|
995
|
+
public readonly creditAccount: string;
|
|
996
|
+
public readonly to: string;
|
|
997
|
+
|
|
998
|
+
constructor(opts: TakeForeverProps) {
|
|
999
|
+
super({
|
|
1000
|
+
block: opts.block,
|
|
1001
|
+
txHash: opts.txHash,
|
|
1002
|
+
timestamp: opts.timestamp
|
|
1003
|
+
});
|
|
1004
|
+
this.creditAccount = opts.creditAccount;
|
|
1005
|
+
this.to = opts.to;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1009
|
+
return `AccountFactory: account ${this.creditAccount} was taken forever and transferred to ${this.to}`;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
// Paused / Unpaused event (!)
|
|
1014
|
+
|
|
1015
|
+
interface PausedProps extends EVMEventProps {
|
|
1016
|
+
contract: string;
|
|
1017
|
+
}
|
|
1018
|
+
export class EventPaused extends EVMEvent {
|
|
1019
|
+
public readonly contract: string;
|
|
1020
|
+
|
|
1021
|
+
constructor(opts: PausedProps) {
|
|
1022
|
+
super({
|
|
1023
|
+
block: opts.block,
|
|
1024
|
+
txHash: opts.txHash,
|
|
1025
|
+
timestamp: opts.timestamp
|
|
1026
|
+
});
|
|
1027
|
+
this.contract = opts.contract;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1031
|
+
return `${getContractName(this.contract)} was paused`;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
interface UnPausedProps extends EVMEventProps {
|
|
1036
|
+
contract: string;
|
|
1037
|
+
}
|
|
1038
|
+
export class EventUnPaused extends EVMEvent {
|
|
1039
|
+
public readonly contract: string;
|
|
1040
|
+
|
|
1041
|
+
constructor(opts: UnPausedProps) {
|
|
1042
|
+
super({
|
|
1043
|
+
block: opts.block,
|
|
1044
|
+
txHash: opts.txHash,
|
|
1045
|
+
timestamp: opts.timestamp
|
|
1046
|
+
});
|
|
1047
|
+
this.contract = opts.contract;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1051
|
+
return `${getContractName(this.contract)} was unpaused`;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// // emits each time when new pausable admin added
|
|
1056
|
+
// event PausableAdminAdded(address indexed newAdmin);
|
|
1057
|
+
|
|
1058
|
+
interface PausableAdminAddedProps extends EVMEventProps {
|
|
1059
|
+
admin: string;
|
|
1060
|
+
}
|
|
1061
|
+
export class EventPausableAdminAdded extends EVMEvent {
|
|
1062
|
+
public readonly admin: string;
|
|
1063
|
+
|
|
1064
|
+
constructor(opts: PausableAdminAddedProps) {
|
|
1065
|
+
super({
|
|
1066
|
+
block: opts.block,
|
|
1067
|
+
txHash: opts.txHash,
|
|
1068
|
+
timestamp: opts.timestamp
|
|
1069
|
+
});
|
|
1070
|
+
this.admin = opts.admin;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1074
|
+
return `ACL: pausable admin ${this.admin} was added`;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
// emits each time when pausable admin removed
|
|
1079
|
+
// event PausableAdminRemoved(address indexed admin);
|
|
1080
|
+
|
|
1081
|
+
interface PausableAdminRemovedProps extends EVMEventProps {
|
|
1082
|
+
admin: string;
|
|
1083
|
+
}
|
|
1084
|
+
export class EventPausableAdminRemoved extends EVMEvent {
|
|
1085
|
+
public readonly admin: string;
|
|
1086
|
+
|
|
1087
|
+
constructor(opts: PausableAdminRemovedProps) {
|
|
1088
|
+
super({
|
|
1089
|
+
block: opts.block,
|
|
1090
|
+
txHash: opts.txHash,
|
|
1091
|
+
timestamp: opts.timestamp
|
|
1092
|
+
});
|
|
1093
|
+
this.admin = opts.admin;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1097
|
+
return `ACL: pausable admin ${this.admin} was removed`;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// // emits each time when new unpausable admin added
|
|
1102
|
+
// event UnpausableAdminAdded(address indexed newAdmin);
|
|
1103
|
+
|
|
1104
|
+
interface UnPausableAdminAddedProps extends EVMEventProps {
|
|
1105
|
+
admin: string;
|
|
1106
|
+
}
|
|
1107
|
+
export class EventUnPausableAdminAdded extends EVMEvent {
|
|
1108
|
+
public readonly admin: string;
|
|
1109
|
+
|
|
1110
|
+
constructor(opts: UnPausableAdminAddedProps) {
|
|
1111
|
+
super({
|
|
1112
|
+
block: opts.block,
|
|
1113
|
+
txHash: opts.txHash,
|
|
1114
|
+
timestamp: opts.timestamp
|
|
1115
|
+
});
|
|
1116
|
+
this.admin = opts.admin;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1120
|
+
return `ACL: unpausable admin ${this.admin} was added`;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
// emits each times when unpausable admin removed
|
|
1125
|
+
// event UnpausableAdminRemoved(address indexed admin);
|
|
1126
|
+
|
|
1127
|
+
interface UnPausableAdminRemovedProps extends EVMEventProps {
|
|
1128
|
+
admin: string;
|
|
1129
|
+
}
|
|
1130
|
+
export class EventUnPausableAdminRemoved extends EVMEvent {
|
|
1131
|
+
public readonly admin: string;
|
|
1132
|
+
|
|
1133
|
+
constructor(opts: UnPausableAdminRemovedProps) {
|
|
1134
|
+
super({
|
|
1135
|
+
block: opts.block,
|
|
1136
|
+
txHash: opts.txHash,
|
|
1137
|
+
timestamp: opts.timestamp
|
|
1138
|
+
});
|
|
1139
|
+
this.admin = opts.admin;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1143
|
+
return `ACL: unpausable admin ${this.admin} was removed`;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
interface TransferOwnershipProps extends EVMEventProps {
|
|
1148
|
+
admin: string;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// ACL: Transfer ownership
|
|
1152
|
+
export class EventTransferOwnership extends EVMEvent {
|
|
1153
|
+
public readonly newOwner: string;
|
|
1154
|
+
|
|
1155
|
+
constructor(opts: TransferOwnershipProps) {
|
|
1156
|
+
super({
|
|
1157
|
+
block: opts.block,
|
|
1158
|
+
txHash: opts.txHash,
|
|
1159
|
+
timestamp: opts.timestamp
|
|
1160
|
+
});
|
|
1161
|
+
this.newOwner = opts.admin;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
toString(_tokenData: Record<string, TokenData>): string {
|
|
1165
|
+
return `ACL: configurator was changed to ${this.newOwner}`;
|
|
1166
|
+
}
|
|
1167
|
+
}
|