dequanto 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/.vscode/settings.json +11 -0
- package/actions/gen.act.ts +38 -0
- package/actions/tokens.act.ts +12 -0
- package/configs/dequanto.yml +51 -0
- package/contracts/abi/erc20.abi.json +222 -0
- package/contracts/gen/amm/AmmFactoryV2ContractBase.ts +66 -0
- package/contracts/gen/amm/AmmMasterChefV2ContractBase.ts +158 -0
- package/contracts/gen/amm/AmmPairContractV2Base.ts +158 -0
- package/contracts/gen/amm/AmmPairContractV3Base.ts +125 -0
- package/contracts/gen/amm/AmmRouterV2ContractBase.ts +124 -0
- package/contracts/gen/amm/AmmVaultV2ContractBase.ts +214 -0
- package/contracts/gen/base/ERC20Base.ts +90 -0
- package/contracts/gen/bsc/OneInchRouterV3Base.ts +57 -0
- package/contracts/gen/eth/WETHBase/WETHBase.sol +756 -0
- package/contracts/gen/eth/WETHBase.ts +136 -0
- package/contracts/gen/polygon/ERC20PolygonBase.ts +305 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Address.sol +216 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BeaconProxy.sol +61 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Bridge.sol +437 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BridgeGetters.sol +70 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BridgeGovernance.sol +142 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BridgeImplementation.sol +34 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BridgeSetters.sol +57 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BridgeState.sol +52 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BridgeStructs.sol +66 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/BytesLib.sol +510 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Context.sol +23 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/ERC1967Proxy.sol +32 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/ERC1967Upgrade.sol +193 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/IBeacon.sol +15 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/IERC20.sol +81 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/IWormhole.sol +42 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Ownable.sol +71 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Proxy.sol +85 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/SafeERC20.sol +98 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/StorageSlot.sol +83 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Structs.sol +40 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/Token.sol +12 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/TokenBridge.sol +15 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/TokenImplementation.sol +177 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase/TokenState.sol +31 -0
- package/contracts/gen/polygon/WormholeBridgeContractBase.ts +231 -0
- package/contracts/gen/xdai/WXDaiTokenContractBase.ts +136 -0
- package/data/cex/eth.csv +356 -0
- package/data/tokens/1inch.json +16557 -0
- package/data/tokens/arbitrum.json +1 -0
- package/data/tokens/sushi.json +56388 -0
- package/dist/contracts/gen/amm/AmmFactoryV2ContractBase.js +53 -0
- package/dist/contracts/gen/amm/AmmMasterChefV2ContractBase.js +122 -0
- package/dist/contracts/gen/amm/AmmPairContractV2Base.js +122 -0
- package/dist/contracts/gen/amm/AmmPairContractV3Base.js +98 -0
- package/dist/contracts/gen/amm/AmmRouterV2ContractBase.js +95 -0
- package/dist/contracts/gen/amm/AmmVaultV2ContractBase.js +164 -0
- package/dist/contracts/gen/base/ERC20Base.js +64 -0
- package/dist/contracts/gen/bsc/OneInchRouterV3Base.js +47 -0
- package/dist/contracts/gen/eth/WETHBase.js +96 -0
- package/dist/contracts/gen/polygon/ERC20PolygonBase.js +233 -0
- package/dist/contracts/gen/polygon/WormholeBridgeContractBase.js +172 -0
- package/dist/contracts/gen/xdai/WXDaiTokenContractBase.js +96 -0
- package/dist/src/BlockchainExplorer/BlockChainExplorerFactory.js +227 -0
- package/dist/src/BlockchainExplorer/BlockChainExplorerProvider.js +32 -0
- package/dist/src/BlockchainExplorer/BlockNumberCache.js +33 -0
- package/dist/src/BlockchainExplorer/Bscscan.js +27 -0
- package/dist/src/BlockchainExplorer/Etherscan.js +27 -0
- package/dist/src/BlockchainExplorer/IAbiProvider.js +2 -0
- package/dist/src/BlockchainExplorer/IBlockChainExplorer.js +2 -0
- package/dist/src/BlockchainExplorer/Polyscan.js +27 -0
- package/dist/src/ChainAccounts.js +69 -0
- package/dist/src/ChainAccountsService.js +75 -0
- package/dist/src/Config.js +7 -0
- package/dist/src/blocks/BlockDateResolver.js +125 -0
- package/dist/src/bridges/BridgeFactory.js +19 -0
- package/dist/src/bridges/hop/HopAddresses.js +520 -0
- package/dist/src/bridges/hop/HopBridge.js +327 -0
- package/dist/src/bridges/hop/contracts/gen.act.js +43 -0
- package/dist/src/bridges/hop/contracts/polygon/Dai_l2AmmWrapperContract.js +52 -0
- package/dist/src/bridges/hop/contracts/polygon/Dai_l2BridgeContract.js +319 -0
- package/dist/src/bridges/hop/contracts/polygon/Dai_l2SaddleSwapContract.js +178 -0
- package/dist/src/bridges/hop/contracts/polygon/Eth_l2AmmWrapperContract.js +52 -0
- package/dist/src/bridges/hop/contracts/polygon/Eth_l2BridgeContract.js +319 -0
- package/dist/src/bridges/hop/contracts/polygon/Eth_l2SaddleSwapContract.js +178 -0
- package/dist/src/bridges/hop/contracts/polygon/Matic_l2AmmWrapperContract.js +52 -0
- package/dist/src/bridges/hop/contracts/polygon/Matic_l2BridgeContract.js +319 -0
- package/dist/src/bridges/hop/contracts/polygon/Matic_l2SaddleSwapContract.js +178 -0
- package/dist/src/bridges/hop/contracts/polygon/Usdc_l2AmmWrapperContract.js +52 -0
- package/dist/src/bridges/hop/contracts/polygon/Usdc_l2BridgeContract.js +319 -0
- package/dist/src/bridges/hop/contracts/polygon/Usdc_l2SaddleSwapContract.js +178 -0
- package/dist/src/bridges/hop/contracts/polygon/Usdt_l2AmmWrapperContract.js +52 -0
- package/dist/src/bridges/hop/contracts/polygon/Usdt_l2BridgeContract.js +319 -0
- package/dist/src/bridges/hop/contracts/polygon/Usdt_l2SaddleSwapContract.js +178 -0
- package/dist/src/bridges/hop/contracts/polygon/Wbtc_l2AmmWrapperContract.js +52 -0
- package/dist/src/bridges/hop/contracts/polygon/Wbtc_l2BridgeContract.js +319 -0
- package/dist/src/bridges/hop/contracts/polygon/Wbtc_l2SaddleSwapContract.js +178 -0
- package/dist/src/bridges/models/IBridge.js +2 -0
- package/dist/src/bridges/wormhole/contracts/WormholeBridgeContract.js +15 -0
- package/dist/src/chains/PlatformFactory.js +42 -0
- package/dist/src/chains/arbitrum/ArbTokenProvider.js +40 -0
- package/dist/src/chains/arbitrum/ArbWeb3Client.js +39 -0
- package/dist/src/chains/arbitrum/Arbiscan.js +27 -0
- package/dist/src/chains/boba/BobaWeb3Client.js +47 -0
- package/dist/src/chains/boba/Bobascan.js +28 -0
- package/dist/src/chains/xdai/XDaiWeb3Client.js +87 -0
- package/dist/src/chains/xdai/XDaiscan.js +27 -0
- package/dist/src/chains/xdai/tokens/WXDaiTokenContract.js +15 -0
- package/dist/src/clients/BscWeb3Client.js +38 -0
- package/dist/src/clients/ClientEventsStream.js +34 -0
- package/dist/src/clients/ClientPool.js +560 -0
- package/dist/src/clients/ClientPoolStats.js +52 -0
- package/dist/src/clients/EthWeb3Client.js +35 -0
- package/dist/src/clients/HardhatWeb3Client.js +56 -0
- package/dist/src/clients/PolyWeb3Client.js +77 -0
- package/dist/src/clients/Web3Client.js +186 -0
- package/dist/src/clients/Web3ClientFactory.js +32 -0
- package/dist/src/clients/interfaces/IWeb3Client.js +2 -0
- package/dist/src/clients/interfaces/IWeb3ClientStatus.js +2 -0
- package/dist/src/clients/interfaces/IWeb3EndpointOptions.js +2 -0
- package/dist/src/clients/model/ClientStatus.js +9 -0
- package/dist/src/clients/model/PromiEventWrap.js +52 -0
- package/dist/src/clients/model/SubscriptionWrap.js +42 -0
- package/dist/src/clients/utils/ClientEndpoints.js +27 -0
- package/dist/src/clients/utils/ClientErrorUtil.js +30 -0
- package/dist/src/clients/utils/TxFactory.js +14 -0
- package/dist/src/contracts/BscContract.js +30 -0
- package/dist/src/contracts/Contract.js +90 -0
- package/dist/src/contracts/ContractBase.js +139 -0
- package/dist/src/contracts/ContractFactory.js +17 -0
- package/dist/src/contracts/ContractProvider.js +40 -0
- package/dist/src/contracts/ContractReader.js +76 -0
- package/dist/src/contracts/ContractStream.js +20 -0
- package/dist/src/contracts/ContractWriter.js +62 -0
- package/dist/src/contracts/EthContract.js +31 -0
- package/dist/src/contracts/TxContract.js +37 -0
- package/dist/src/contracts/common/ERC20.js +14 -0
- package/dist/src/contracts/common/ERC20Polygon.js +14 -0
- package/dist/src/contracts/common/PoolPair.js +23 -0
- package/dist/src/contracts/utils/AbiDeserializer.js +89 -0
- package/dist/src/contracts/utils/ConvertUtils.js +21 -0
- package/dist/src/contracts/utils/InputDataUtils.js +87 -0
- package/dist/src/contracts/utils/TypeUtils.js +24 -0
- package/dist/src/defi/OneInch/OneInchRouter.js +14 -0
- package/dist/src/env/BigIntSerializer.js +19 -0
- package/dist/src/gen/Ast.js +12 -0
- package/dist/src/gen/ContractTemplate.js +27 -0
- package/dist/src/gen/Generator.js +180 -0
- package/dist/src/gen/GeneratorFromAbi.js +361 -0
- package/dist/src/handlers/TokenHandler.js +69 -0
- package/dist/src/indexer/BlocksTxIndexer.js +52 -0
- package/dist/src/indexer/PendingTxIndexer.js +96 -0
- package/dist/src/indexer/handlers/BlocksWalker.js +306 -0
- package/dist/src/indexer/handlers/TxQueueLoader.js +117 -0
- package/dist/src/json/JsonArrayStore.js +296 -0
- package/dist/src/json/JsonObjectStore.js +214 -0
- package/dist/src/json/JsonStore.spec.js +83 -0
- package/dist/src/loggers/ILogger.js +2 -0
- package/dist/src/loggers/LoggerService.js +34 -0
- package/dist/src/loggers/TxLoggerService.js +122 -0
- package/dist/src/models/IContractDetails.js +2 -0
- package/dist/src/models/IToken.js +2 -0
- package/dist/src/models/ITokenGlob.js +6 -0
- package/dist/src/models/ITransactionDetails.js +2 -0
- package/dist/src/models/TAddress.js +2 -0
- package/dist/src/models/TBufferLike.js +2 -0
- package/dist/src/models/THex.js +2 -0
- package/dist/src/models/TPlatform.js +2 -0
- package/dist/src/models/TResult.js +2 -0
- package/dist/src/ns/NameService.js +19 -0
- package/dist/src/ns/providers/EnsProvider.js +41 -0
- package/dist/src/ns/providers/INsProvider.js +2 -0
- package/dist/src/ns/providers/UDProvider.js +39 -0
- package/dist/src/ns/utils/$ns.js +17 -0
- package/dist/src/structs/PackedRanges.js +186 -0
- package/dist/src/structs/PackedRanges.spec.js +30 -0
- package/dist/src/tokens/TokenExchangeService.js +110 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/AmmUtilts.js +17 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmFactoryV2Contract.js +15 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmMasterChefV2Contract.js +15 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Contract.js +16 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js +144 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmRouterV2Contract.js +15 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmVaultV2Contract.js +15 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V3/AmmPairV3Contract.js +22 -0
- package/dist/src/tokens/TokenExchanges/AmmV2ExchangeBase.js +194 -0
- package/dist/src/tokens/TokenExchanges/OneInchExchange.js +92 -0
- package/dist/src/tokens/TokenExchanges/PancakeswapExchange.js +28 -0
- package/dist/src/tokens/TokenExchanges/SushiswapPolygonExchange.js +28 -0
- package/dist/src/tokens/TokenExchanges/UniswapExchange.js +28 -0
- package/dist/src/tokens/TokenOracles/AmmPriceV2Oracle.js +319 -0
- package/dist/src/tokens/TokenOracles/TokenPriceStore.js +108 -0
- package/dist/src/tokens/TokenPriceService.js +196 -0
- package/dist/src/tokens/TokenPriceServiceProvider.js +31 -0
- package/dist/src/tokens/TokenProviders/ATokenProvider.js +38 -0
- package/dist/src/tokens/TokenProviders/ITokenProvider.js +2 -0
- package/dist/src/tokens/TokenProviders/TPChain.js +35 -0
- package/dist/src/tokens/TokenProviders/TPCoinmarketcap.js +63 -0
- package/dist/src/tokens/TokenProviders/TPOneInch.js +65 -0
- package/dist/src/tokens/TokenProviders/TPSushiswap.js +89 -0
- package/dist/src/tokens/TokenProviders/TPUniswap.js +84 -0
- package/dist/src/tokens/TokenService.js +115 -0
- package/dist/src/tokens/TokenSwapService.js +37 -0
- package/dist/src/tokens/TokenTransferService.js +189 -0
- package/dist/src/tokens/TokensService.js +236 -0
- package/dist/src/tokens/TokensServiceBsc.js +18 -0
- package/dist/src/tokens/TokensServiceEth.js +15 -0
- package/dist/src/tokens/TokensServiceFactory.js +29 -0
- package/dist/src/tokens/TokensServicePolygon.js +18 -0
- package/dist/src/tokens/TokensServiceXDai.js +24 -0
- package/dist/src/tokens/defi/ISwapService.js +2 -0
- package/dist/src/tokens/defi/paraswap/Paraswap.js +135 -0
- package/dist/src/tokens/erc20/eth/WETH.js +14 -0
- package/dist/src/tokens/utils/TokenUtils.js +66 -0
- package/dist/src/txs/ITxConfig.js +2 -0
- package/dist/src/txs/TxDataBuilder.js +159 -0
- package/dist/src/txs/TxLogger.js +119 -0
- package/dist/src/txs/TxProvider.js +73 -0
- package/dist/src/txs/TxService.js +19 -0
- package/dist/src/txs/TxWriter.js +287 -0
- package/dist/src/txs/conditional/GasWatcherLogger.js +61 -0
- package/dist/src/txs/conditional/GasWatcherService.js +103 -0
- package/dist/src/txs/conditional/GasWatcherStore.js +25 -0
- package/dist/src/txs/conditional/GasWatcherTx.js +126 -0
- package/dist/src/txs/receipt/ITxLogItem.js +2 -0
- package/dist/src/txs/receipt/TxLogParser.js +27 -0
- package/dist/src/txs/receipt/TxLogsTransfer.js +50 -0
- package/dist/src/txs/receipt/TxTopicInMemoryProvider.js +41 -0
- package/dist/src/txs/receipt/TxTopicProvider.js +25 -0
- package/dist/src/utils/$abiParser.js +159 -0
- package/dist/src/utils/$abiType.js +77 -0
- package/dist/src/utils/$abiUtils.js +43 -0
- package/dist/src/utils/$address.js +41 -0
- package/dist/src/utils/$array.js +60 -0
- package/dist/src/utils/$bigint.js +130 -0
- package/dist/src/utils/$block.js +10 -0
- package/dist/src/utils/$class.js +13 -0
- package/dist/src/utils/$config.js +18 -0
- package/dist/src/utils/$contract.js +67 -0
- package/dist/src/utils/$csv.js +79 -0
- package/dist/src/utils/$date.js +496 -0
- package/dist/src/utils/$fn.js +117 -0
- package/dist/src/utils/$is.js +40 -0
- package/dist/src/utils/$logger.js +15 -0
- package/dist/src/utils/$number.js +95 -0
- package/dist/src/utils/$object.js +82 -0
- package/dist/src/utils/$path.js +33 -0
- package/dist/src/utils/$promise.js +13 -0
- package/dist/src/utils/$require.js +127 -0
- package/dist/src/utils/$sign.js +35 -0
- package/dist/src/utils/$signSerializer.js +264 -0
- package/dist/src/utils/$wallet.js +13 -0
- package/dist/src/utils/types.js +2 -0
- package/dist/src/wallets/Wallet.js +26 -0
- package/dist/src/wallets/WalletBsc.js +17 -0
- package/dist/src/wallets/WalletService.js +35 -0
- package/dist/src/www/utils/BlockChainExplorerFormatter.js +15 -0
- package/hardhat.config.js +6 -0
- package/package.json +52 -0
- package/readme.md +76 -0
- package/src/BlockchainExplorer/BlockChainExplorerFactory.ts +273 -0
- package/src/BlockchainExplorer/BlockChainExplorerProvider.ts +26 -0
- package/src/BlockchainExplorer/BlockNumberCache.ts +46 -0
- package/src/BlockchainExplorer/Bscscan.ts +23 -0
- package/src/BlockchainExplorer/Etherscan.ts +25 -0
- package/src/BlockchainExplorer/IAbiProvider.ts +5 -0
- package/src/BlockchainExplorer/IBlockChainExplorer.ts +37 -0
- package/src/BlockchainExplorer/Polyscan.ts +23 -0
- package/src/ChainAccounts.ts +72 -0
- package/src/ChainAccountsService.ts +74 -0
- package/src/Config.ts +34 -0
- package/src/blocks/BlockDateResolver.ts +149 -0
- package/src/bridges/BridgeFactory.ts +16 -0
- package/src/bridges/hop/HopAddresses.ts +518 -0
- package/src/bridges/hop/HopBridge.ts +430 -0
- package/src/bridges/hop/contracts/gen.act.ts +50 -0
- package/src/bridges/hop/contracts/polygon/Dai_l2AmmWrapperContract.ts +69 -0
- package/src/bridges/hop/contracts/polygon/Dai_l2BridgeContract.ts +453 -0
- package/src/bridges/hop/contracts/polygon/Dai_l2SaddleSwapContract.ts +264 -0
- package/src/bridges/hop/contracts/polygon/Eth_l2AmmWrapperContract.ts +69 -0
- package/src/bridges/hop/contracts/polygon/Eth_l2BridgeContract.ts +453 -0
- package/src/bridges/hop/contracts/polygon/Eth_l2SaddleSwapContract.ts +264 -0
- package/src/bridges/hop/contracts/polygon/Matic_l2AmmWrapperContract.ts +69 -0
- package/src/bridges/hop/contracts/polygon/Matic_l2BridgeContract.ts +453 -0
- package/src/bridges/hop/contracts/polygon/Matic_l2SaddleSwapContract.ts +264 -0
- package/src/bridges/hop/contracts/polygon/Usdc_l2AmmWrapperContract.ts +69 -0
- package/src/bridges/hop/contracts/polygon/Usdc_l2BridgeContract.ts +453 -0
- package/src/bridges/hop/contracts/polygon/Usdc_l2SaddleSwapContract.ts +264 -0
- package/src/bridges/hop/contracts/polygon/Usdt_l2AmmWrapperContract.ts +69 -0
- package/src/bridges/hop/contracts/polygon/Usdt_l2BridgeContract.ts +453 -0
- package/src/bridges/hop/contracts/polygon/Usdt_l2SaddleSwapContract.ts +264 -0
- package/src/bridges/hop/contracts/polygon/Wbtc_l2AmmWrapperContract.ts +69 -0
- package/src/bridges/hop/contracts/polygon/Wbtc_l2BridgeContract.ts +453 -0
- package/src/bridges/hop/contracts/polygon/Wbtc_l2SaddleSwapContract.ts +264 -0
- package/src/bridges/models/IBridge.ts +43 -0
- package/src/bridges/wormhole/contracts/WormholeBridgeContract.ts +14 -0
- package/src/chains/PlatformFactory.ts +45 -0
- package/src/chains/arbitrum/ArbTokenProvider.ts +39 -0
- package/src/chains/arbitrum/ArbWeb3Client.ts +39 -0
- package/src/chains/arbitrum/Arbiscan.ts +24 -0
- package/src/chains/boba/BobaWeb3Client.ts +49 -0
- package/src/chains/boba/Bobascan.ts +25 -0
- package/src/chains/xdai/XDaiWeb3Client.ts +82 -0
- package/src/chains/xdai/XDaiscan.ts +24 -0
- package/src/chains/xdai/tokens/WXDaiTokenContract.json +279 -0
- package/src/chains/xdai/tokens/WXDaiTokenContract.ts +14 -0
- package/src/clients/BscWeb3Client.ts +38 -0
- package/src/clients/ClientEventsStream.ts +33 -0
- package/src/clients/ClientPool.ts +673 -0
- package/src/clients/ClientPoolStats.ts +64 -0
- package/src/clients/EthWeb3Client.ts +36 -0
- package/src/clients/HardhatWeb3Client.ts +60 -0
- package/src/clients/PolyWeb3Client.ts +91 -0
- package/src/clients/Web3Client.ts +228 -0
- package/src/clients/Web3ClientFactory.ts +28 -0
- package/src/clients/interfaces/IWeb3Client.ts +14 -0
- package/src/clients/interfaces/IWeb3ClientStatus.ts +23 -0
- package/src/clients/interfaces/IWeb3EndpointOptions.ts +9 -0
- package/src/clients/model/ClientStatus.ts +5 -0
- package/src/clients/model/PromiEventWrap.ts +61 -0
- package/src/clients/model/SubscriptionWrap.ts +53 -0
- package/src/clients/utils/ClientEndpoints.ts +26 -0
- package/src/clients/utils/ClientErrorUtil.ts +26 -0
- package/src/clients/utils/TxFactory.ts +17 -0
- package/src/contracts/BscContract.ts +28 -0
- package/src/contracts/Contract.ts +126 -0
- package/src/contracts/ContractBase.ts +158 -0
- package/src/contracts/ContractFactory.ts +19 -0
- package/src/contracts/ContractProvider.ts +55 -0
- package/src/contracts/ContractReader.ts +87 -0
- package/src/contracts/ContractStream.ts +18 -0
- package/src/contracts/ContractWriter.ts +97 -0
- package/src/contracts/EthContract.ts +29 -0
- package/src/contracts/TxContract.ts +43 -0
- package/src/contracts/common/ERC20.ts +13 -0
- package/src/contracts/common/ERC20Polygon.ts +13 -0
- package/src/contracts/common/PoolPair.ts +22 -0
- package/src/contracts/utils/AbiDeserializer.ts +98 -0
- package/src/contracts/utils/ConvertUtils.ts +16 -0
- package/src/contracts/utils/InputDataUtils.ts +93 -0
- package/src/contracts/utils/TypeUtils.ts +21 -0
- package/src/defi/OneInch/OneInchRouter.ts +13 -0
- package/src/env/BigIntSerializer.ts +18 -0
- package/src/gen/Ast.ts +12 -0
- package/src/gen/ContractTemplate.ts +36 -0
- package/src/gen/Generator.ts +227 -0
- package/src/gen/GeneratorFromAbi.ts +402 -0
- package/src/handlers/TokenHandler.ts +78 -0
- package/src/indexer/BlocksTxIndexer.ts +69 -0
- package/src/indexer/PendingTxIndexer.ts +124 -0
- package/src/indexer/handlers/BlocksWalker.ts +390 -0
- package/src/indexer/handlers/TxQueueLoader.ts +143 -0
- package/src/json/JsonArrayStore.ts +310 -0
- package/src/json/JsonObjectStore.ts +239 -0
- package/src/json/JsonStore.spec.ts +98 -0
- package/src/loggers/ILogger.ts +3 -0
- package/src/loggers/LoggerService.ts +39 -0
- package/src/loggers/TxLoggerService.ts +146 -0
- package/src/models/IContractDetails.ts +8 -0
- package/src/models/IToken.ts +11 -0
- package/src/models/ITokenGlob.ts +14 -0
- package/src/models/ITransactionDetails.ts +11 -0
- package/src/models/TAddress.ts +1 -0
- package/src/models/TBufferLike.ts +2 -0
- package/src/models/THex.ts +1 -0
- package/src/models/TPlatform.ts +1 -0
- package/src/models/TResult.ts +6 -0
- package/src/ns/NameService.ts +21 -0
- package/src/ns/providers/EnsProvider.ts +45 -0
- package/src/ns/providers/INsProvider.ts +6 -0
- package/src/ns/providers/UDProvider.ts +49 -0
- package/src/ns/utils/$ns.ts +15 -0
- package/src/structs/PackedRanges.spec.ts +38 -0
- package/src/structs/PackedRanges.ts +207 -0
- package/src/tokens/TokenExchangeService.ts +126 -0
- package/src/tokens/TokenExchanges/AmmBase/AmmUtilts.ts +16 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmFactoryV2Contract.ts +15 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmMasterChefV2Contract.ts +15 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Contract.ts +17 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.ts +208 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmRouterV2Contract.ts +15 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmVaultV2Contract.ts +15 -0
- package/src/tokens/TokenExchanges/AmmBase/V3/AmmPairV3Contract.ts +24 -0
- package/src/tokens/TokenExchanges/AmmV2ExchangeBase.ts +242 -0
- package/src/tokens/TokenExchanges/OneInchExchange.ts +111 -0
- package/src/tokens/TokenExchanges/PancakeswapExchange.ts +30 -0
- package/src/tokens/TokenExchanges/SushiswapPolygonExchange.ts +30 -0
- package/src/tokens/TokenExchanges/UniswapExchange.ts +31 -0
- package/src/tokens/TokenOracles/AmmPriceV2Oracle.ts +440 -0
- package/src/tokens/TokenOracles/TokenPriceStore.ts +129 -0
- package/src/tokens/TokenPriceService.ts +276 -0
- package/src/tokens/TokenPriceServiceProvider.ts +36 -0
- package/src/tokens/TokenProviders/ATokenProvider.ts +42 -0
- package/src/tokens/TokenProviders/ITokenProvider.ts +9 -0
- package/src/tokens/TokenProviders/TPChain.ts +41 -0
- package/src/tokens/TokenProviders/TPCoinmarketcap.ts +82 -0
- package/src/tokens/TokenProviders/TPOneInch.ts +71 -0
- package/src/tokens/TokenProviders/TPSushiswap.ts +96 -0
- package/src/tokens/TokenProviders/TPUniswap.ts +85 -0
- package/src/tokens/TokenService.ts +128 -0
- package/src/tokens/TokenSwapService.ts +47 -0
- package/src/tokens/TokenTransferService.ts +216 -0
- package/src/tokens/TokensService.ts +252 -0
- package/src/tokens/TokensServiceBsc.ts +17 -0
- package/src/tokens/TokensServiceEth.ts +9 -0
- package/src/tokens/TokensServiceFactory.ts +24 -0
- package/src/tokens/TokensServicePolygon.ts +17 -0
- package/src/tokens/TokensServiceXDai.ts +26 -0
- package/src/tokens/defi/ISwapService.ts +12 -0
- package/src/tokens/defi/paraswap/Paraswap.ts +244 -0
- package/src/tokens/erc20/eth/WETH.ts +13 -0
- package/src/tokens/utils/TokenUtils.ts +63 -0
- package/src/txs/ITxConfig.ts +27 -0
- package/src/txs/TxDataBuilder.ts +207 -0
- package/src/txs/TxLogger.ts +121 -0
- package/src/txs/TxProvider.ts +68 -0
- package/src/txs/TxService.ts +19 -0
- package/src/txs/TxWriter.ts +370 -0
- package/src/txs/conditional/GasWatcherLogger.ts +57 -0
- package/src/txs/conditional/GasWatcherService.ts +117 -0
- package/src/txs/conditional/GasWatcherStore.ts +40 -0
- package/src/txs/conditional/GasWatcherTx.ts +143 -0
- package/src/txs/receipt/ITxLogItem.ts +25 -0
- package/src/txs/receipt/TxLogParser.ts +29 -0
- package/src/txs/receipt/TxLogsTransfer.ts +61 -0
- package/src/txs/receipt/TxTopicInMemoryProvider.ts +45 -0
- package/src/txs/receipt/TxTopicProvider.ts +29 -0
- package/src/utils/$abiParser.ts +179 -0
- package/src/utils/$abiType.ts +85 -0
- package/src/utils/$abiUtils.ts +38 -0
- package/src/utils/$address.ts +37 -0
- package/src/utils/$array.ts +57 -0
- package/src/utils/$bigint.ts +127 -0
- package/src/utils/$block.ts +7 -0
- package/src/utils/$class.ts +8 -0
- package/src/utils/$config.ts +17 -0
- package/src/utils/$contract.ts +67 -0
- package/src/utils/$csv.ts +54 -0
- package/src/utils/$date.ts +473 -0
- package/src/utils/$fn.ts +134 -0
- package/src/utils/$is.ts +37 -0
- package/src/utils/$logger.ts +10 -0
- package/src/utils/$number.ts +89 -0
- package/src/utils/$object.ts +95 -0
- package/src/utils/$path.ts +32 -0
- package/src/utils/$promise.ts +7 -0
- package/src/utils/$require.ts +118 -0
- package/src/utils/$sign.ts +36 -0
- package/src/utils/$signSerializer.ts +339 -0
- package/src/utils/$wallet.ts +10 -0
- package/src/utils/types.ts +29 -0
- package/src/wallets/Wallet.ts +33 -0
- package/src/wallets/WalletBsc.ts +13 -0
- package/src/wallets/WalletService.ts +43 -0
- package/src/www/utils/BlockChainExplorerFormatter.ts +13 -0
- package/test/ChainAccount.spec.ts +9 -0
- package/test/client.spec.ts +59 -0
- package/test/fixtures/DaiTokenContract.ts +13 -0
- package/test/fixtures/receipts/swap.json +94 -0
- package/test/generate/class.spec.ts +27 -0
- package/test/hardhat/TestNode.ts +61 -0
- package/test/ns.spec.ts +30 -0
- package/test/receipt.spec.ts +27 -0
- package/test/utils/abi-parser.spec.ts +117 -0
- package/test/utils/bigint.spec.ts +40 -0
- package/test/utils/date.spec.ts +8 -0
- package/test/utils/fn.spec.ts +39 -0
- package/test/utils/number.spec.ts +41 -0
- package/test/utils/sign.spec.ts +22 -0
- package/tsconfig-build.json +24 -0
- package/tsconfig-src.json +36 -0
- package/tsconfig.json +27 -0
- package/typings/globals/assertion/index.d.ts +159 -0
- package/typings/globals/assertion/typings.json +10 -0
- package/typings/globals/atma-utest/index.d.ts +53 -0
- package/typings/globals/atma-utest/typings.json +10 -0
- package/typings/globals/axios/index.d.ts +6 -0
- package/typings/globals/mask/index.d.ts +6 -0
- package/typings/globals/mask/typings.json +9 -0
- package/typings/index.d.ts +6 -0
- package/typings.json +6 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ERC20PolygonBase = void 0;
|
|
7
|
+
const a_di_1 = __importDefault(require("a-di"));
|
|
8
|
+
const Polyscan_1 = require("@dequanto/BlockchainExplorer/Polyscan");
|
|
9
|
+
const PolyWeb3Client_1 = require("@dequanto/clients/PolyWeb3Client");
|
|
10
|
+
const ContractBase_1 = require("@dequanto/contracts/ContractBase");
|
|
11
|
+
class ERC20PolygonBase extends ContractBase_1.ContractBase {
|
|
12
|
+
constructor(address = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', client = a_di_1.default.resolve(PolyWeb3Client_1.PolyWeb3Client), explorer = a_di_1.default.resolve(Polyscan_1.Polyscan)) {
|
|
13
|
+
super(address, client, explorer);
|
|
14
|
+
this.address = address;
|
|
15
|
+
this.client = client;
|
|
16
|
+
this.explorer = explorer;
|
|
17
|
+
this.abi = [{ "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "authorizer", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "nonce", "type": "bytes32" }], "name": "AuthorizationCanceled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "authorizer", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "nonce", "type": "bytes32" }], "name": "AuthorizationUsed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "account", "type": "address" }], "name": "Blacklisted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "userAddress", "type": "address" }, { "indexed": false, "internalType": "address payable", "name": "relayerAddress", "type": "address" }, { "indexed": false, "internalType": "bytes", "name": "functionSignature", "type": "bytes" }], "name": "MetaTransactionExecuted", "type": "event" }, { "anonymous": false, "inputs": [], "name": "Pause", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "newRescuer", "type": "address" }], "name": "RescuerChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "account", "type": "address" }], "name": "UnBlacklisted", "type": "event" }, { "anonymous": false, "inputs": [], "name": "Unpause", "type": "event" }, { "inputs": [], "name": "APPROVE_WITH_AUTHORIZATION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "BLACKLISTER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "CANCEL_AUTHORIZATION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DECREASE_ALLOWANCE_WITH_AUTHORIZATION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEPOSITOR_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "EIP712_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "INCREASE_ALLOWANCE_WITH_AUTHORIZATION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "META_TRANSACTION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PAUSER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "PERMIT_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RESCUER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "TRANSFER_WITH_AUTHORIZATION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "WITHDRAW_WITH_AUTHORIZATION_TYPEHASH", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "validAfter", "type": "uint256" }, { "internalType": "uint256", "name": "validBefore", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "approveWithAuthorization", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "authorizer", "type": "address" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }], "name": "authorizationState", "outputs": [{ "internalType": "enum GasAbstraction.AuthorizationState", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "blacklist", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "blacklisters", "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "authorizer", "type": "address" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "cancelAuthorization", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" }], "name": "decreaseAllowance", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "decrement", "type": "uint256" }, { "internalType": "uint256", "name": "validAfter", "type": "uint256" }, { "internalType": "uint256", "name": "validBefore", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "decreaseAllowanceWithAuthorization", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "user", "type": "address" }, { "internalType": "bytes", "name": "depositData", "type": "bytes" }], "name": "deposit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "userAddress", "type": "address" }, { "internalType": "bytes", "name": "functionSignature", "type": "bytes" }, { "internalType": "bytes32", "name": "sigR", "type": "bytes32" }, { "internalType": "bytes32", "name": "sigS", "type": "bytes32" }, { "internalType": "uint8", "name": "sigV", "type": "uint8" }], "name": "executeMetaTransaction", "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "uint256", "name": "index", "type": "uint256" }], "name": "getRoleMember", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleMemberCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "addedValue", "type": "uint256" }], "name": "increaseAllowance", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "increment", "type": "uint256" }, { "internalType": "uint256", "name": "validAfter", "type": "uint256" }, { "internalType": "uint256", "name": "validBefore", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "increaseAllowanceWithAuthorization", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "newName", "type": "string" }, { "internalType": "string", "name": "newSymbol", "type": "string" }, { "internalType": "uint8", "name": "newDecimals", "type": "uint8" }, { "internalType": "address", "name": "childChainManager", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "initialized", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "isBlacklisted", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "nonces", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pausers", "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "contract IERC20", "name": "tokenContract", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "rescueERC20", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rescuers", "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "validAfter", "type": "uint256" }, { "internalType": "uint256", "name": "validBefore", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "transferWithAuthorization", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "unBlacklist", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "newName", "type": "string" }, { "internalType": "string", "name": "newSymbol", "type": "string" }], "name": "updateMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "validAfter", "type": "uint256" }, { "internalType": "uint256", "name": "validBefore", "type": "uint256" }, { "internalType": "bytes32", "name": "nonce", "type": "bytes32" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "withdrawWithAuthorization", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
|
|
18
|
+
}
|
|
19
|
+
async APPROVE_WITH_AUTHORIZATION_TYPEHASH() {
|
|
20
|
+
return this.$read('function APPROVE_WITH_AUTHORIZATION_TYPEHASH() returns bytes32');
|
|
21
|
+
}
|
|
22
|
+
async BLACKLISTER_ROLE() {
|
|
23
|
+
return this.$read('function BLACKLISTER_ROLE() returns bytes32');
|
|
24
|
+
}
|
|
25
|
+
async CANCEL_AUTHORIZATION_TYPEHASH() {
|
|
26
|
+
return this.$read('function CANCEL_AUTHORIZATION_TYPEHASH() returns bytes32');
|
|
27
|
+
}
|
|
28
|
+
async DECREASE_ALLOWANCE_WITH_AUTHORIZATION_TYPEHASH() {
|
|
29
|
+
return this.$read('function DECREASE_ALLOWANCE_WITH_AUTHORIZATION_TYPEHASH() returns bytes32');
|
|
30
|
+
}
|
|
31
|
+
async DEFAULT_ADMIN_ROLE() {
|
|
32
|
+
return this.$read('function DEFAULT_ADMIN_ROLE() returns bytes32');
|
|
33
|
+
}
|
|
34
|
+
async DEPOSITOR_ROLE() {
|
|
35
|
+
return this.$read('function DEPOSITOR_ROLE() returns bytes32');
|
|
36
|
+
}
|
|
37
|
+
async DOMAIN_SEPARATOR() {
|
|
38
|
+
return this.$read('function DOMAIN_SEPARATOR() returns bytes32');
|
|
39
|
+
}
|
|
40
|
+
async EIP712_VERSION() {
|
|
41
|
+
return this.$read('function EIP712_VERSION() returns string');
|
|
42
|
+
}
|
|
43
|
+
async INCREASE_ALLOWANCE_WITH_AUTHORIZATION_TYPEHASH() {
|
|
44
|
+
return this.$read('function INCREASE_ALLOWANCE_WITH_AUTHORIZATION_TYPEHASH() returns bytes32');
|
|
45
|
+
}
|
|
46
|
+
async META_TRANSACTION_TYPEHASH() {
|
|
47
|
+
return this.$read('function META_TRANSACTION_TYPEHASH() returns bytes32');
|
|
48
|
+
}
|
|
49
|
+
async PAUSER_ROLE() {
|
|
50
|
+
return this.$read('function PAUSER_ROLE() returns bytes32');
|
|
51
|
+
}
|
|
52
|
+
async PERMIT_TYPEHASH() {
|
|
53
|
+
return this.$read('function PERMIT_TYPEHASH() returns bytes32');
|
|
54
|
+
}
|
|
55
|
+
async RESCUER_ROLE() {
|
|
56
|
+
return this.$read('function RESCUER_ROLE() returns bytes32');
|
|
57
|
+
}
|
|
58
|
+
async TRANSFER_WITH_AUTHORIZATION_TYPEHASH() {
|
|
59
|
+
return this.$read('function TRANSFER_WITH_AUTHORIZATION_TYPEHASH() returns bytes32');
|
|
60
|
+
}
|
|
61
|
+
async WITHDRAW_WITH_AUTHORIZATION_TYPEHASH() {
|
|
62
|
+
return this.$read('function WITHDRAW_WITH_AUTHORIZATION_TYPEHASH() returns bytes32');
|
|
63
|
+
}
|
|
64
|
+
async allowance(owner, spender) {
|
|
65
|
+
return this.$read('function allowance(address, address) returns uint256', owner, spender);
|
|
66
|
+
}
|
|
67
|
+
async approve(eoa, spender, amount) {
|
|
68
|
+
return this.$write('function approve(address, uint256) returns bool', eoa, spender, amount);
|
|
69
|
+
}
|
|
70
|
+
async approveWithAuthorization(eoa, owner, spender, value, validAfter, validBefore, nonce, v, r, s) {
|
|
71
|
+
return this.$write('function approveWithAuthorization(address, address, uint256, uint256, uint256, bytes32, uint8, bytes32, bytes32)', eoa, owner, spender, value, validAfter, validBefore, nonce, v, r, s);
|
|
72
|
+
}
|
|
73
|
+
async authorizationState(authorizer, nonce) {
|
|
74
|
+
return this.$read('function authorizationState(address, bytes32) returns uint8', authorizer, nonce);
|
|
75
|
+
}
|
|
76
|
+
async balanceOf(account) {
|
|
77
|
+
return this.$read('function balanceOf(address) returns uint256', account);
|
|
78
|
+
}
|
|
79
|
+
async blacklist(eoa, account) {
|
|
80
|
+
return this.$write('function blacklist(address)', eoa, account);
|
|
81
|
+
}
|
|
82
|
+
async blacklisters() {
|
|
83
|
+
return this.$read('function blacklisters() returns address[]');
|
|
84
|
+
}
|
|
85
|
+
async cancelAuthorization(eoa, authorizer, nonce, v, r, s) {
|
|
86
|
+
return this.$write('function cancelAuthorization(address, bytes32, uint8, bytes32, bytes32)', eoa, authorizer, nonce, v, r, s);
|
|
87
|
+
}
|
|
88
|
+
async decimals() {
|
|
89
|
+
return this.$read('function decimals() returns uint8');
|
|
90
|
+
}
|
|
91
|
+
async decreaseAllowance(eoa, spender, subtractedValue) {
|
|
92
|
+
return this.$write('function decreaseAllowance(address, uint256) returns bool', eoa, spender, subtractedValue);
|
|
93
|
+
}
|
|
94
|
+
async decreaseAllowanceWithAuthorization(eoa, owner, spender, decrement, validAfter, validBefore, nonce, v, r, s) {
|
|
95
|
+
return this.$write('function decreaseAllowanceWithAuthorization(address, address, uint256, uint256, uint256, bytes32, uint8, bytes32, bytes32)', eoa, owner, spender, decrement, validAfter, validBefore, nonce, v, r, s);
|
|
96
|
+
}
|
|
97
|
+
async deposit(eoa, user, depositData) {
|
|
98
|
+
return this.$write('function deposit(address, bytes)', eoa, user, depositData);
|
|
99
|
+
}
|
|
100
|
+
async executeMetaTransaction(eoa, userAddress, functionSignature, sigR, sigS, sigV) {
|
|
101
|
+
return this.$write('function executeMetaTransaction(address, bytes, bytes32, bytes32, uint8) returns bytes', eoa, userAddress, functionSignature, sigR, sigS, sigV);
|
|
102
|
+
}
|
|
103
|
+
async getRoleAdmin(role) {
|
|
104
|
+
return this.$read('function getRoleAdmin(bytes32) returns bytes32', role);
|
|
105
|
+
}
|
|
106
|
+
async getRoleMember(role, index) {
|
|
107
|
+
return this.$read('function getRoleMember(bytes32, uint256) returns address', role, index);
|
|
108
|
+
}
|
|
109
|
+
async getRoleMemberCount(role) {
|
|
110
|
+
return this.$read('function getRoleMemberCount(bytes32) returns uint256', role);
|
|
111
|
+
}
|
|
112
|
+
async grantRole(eoa, role, account) {
|
|
113
|
+
return this.$write('function grantRole(bytes32, address)', eoa, role, account);
|
|
114
|
+
}
|
|
115
|
+
async hasRole(role, account) {
|
|
116
|
+
return this.$read('function hasRole(bytes32, address) returns bool', role, account);
|
|
117
|
+
}
|
|
118
|
+
async increaseAllowance(eoa, spender, addedValue) {
|
|
119
|
+
return this.$write('function increaseAllowance(address, uint256) returns bool', eoa, spender, addedValue);
|
|
120
|
+
}
|
|
121
|
+
async increaseAllowanceWithAuthorization(eoa, owner, spender, increment, validAfter, validBefore, nonce, v, r, s) {
|
|
122
|
+
return this.$write('function increaseAllowanceWithAuthorization(address, address, uint256, uint256, uint256, bytes32, uint8, bytes32, bytes32)', eoa, owner, spender, increment, validAfter, validBefore, nonce, v, r, s);
|
|
123
|
+
}
|
|
124
|
+
async initialize(eoa, newName, newSymbol, newDecimals, childChainManager) {
|
|
125
|
+
return this.$write('function initialize(string, string, uint8, address)', eoa, newName, newSymbol, newDecimals, childChainManager);
|
|
126
|
+
}
|
|
127
|
+
async initialized() {
|
|
128
|
+
return this.$read('function initialized() returns bool');
|
|
129
|
+
}
|
|
130
|
+
async isBlacklisted(account) {
|
|
131
|
+
return this.$read('function isBlacklisted(address) returns bool', account);
|
|
132
|
+
}
|
|
133
|
+
async name() {
|
|
134
|
+
return this.$read('function name() returns string');
|
|
135
|
+
}
|
|
136
|
+
async nonces(owner) {
|
|
137
|
+
return this.$read('function nonces(address) returns uint256', owner);
|
|
138
|
+
}
|
|
139
|
+
async pause(eoa) {
|
|
140
|
+
return this.$write('function pause()', eoa);
|
|
141
|
+
}
|
|
142
|
+
async paused() {
|
|
143
|
+
return this.$read('function paused() returns bool');
|
|
144
|
+
}
|
|
145
|
+
async pausers() {
|
|
146
|
+
return this.$read('function pausers() returns address[]');
|
|
147
|
+
}
|
|
148
|
+
async permit(eoa, owner, spender, value, deadline, v, r, s) {
|
|
149
|
+
return this.$write('function permit(address, address, uint256, uint256, uint8, bytes32, bytes32)', eoa, owner, spender, value, deadline, v, r, s);
|
|
150
|
+
}
|
|
151
|
+
async renounceRole(eoa, role, account) {
|
|
152
|
+
return this.$write('function renounceRole(bytes32, address)', eoa, role, account);
|
|
153
|
+
}
|
|
154
|
+
async rescueERC20(eoa, tokenContract, to, amount) {
|
|
155
|
+
return this.$write('function rescueERC20(address, address, uint256)', eoa, tokenContract, to, amount);
|
|
156
|
+
}
|
|
157
|
+
async rescuers() {
|
|
158
|
+
return this.$read('function rescuers() returns address[]');
|
|
159
|
+
}
|
|
160
|
+
async revokeRole(eoa, role, account) {
|
|
161
|
+
return this.$write('function revokeRole(bytes32, address)', eoa, role, account);
|
|
162
|
+
}
|
|
163
|
+
async symbol() {
|
|
164
|
+
return this.$read('function symbol() returns string');
|
|
165
|
+
}
|
|
166
|
+
async totalSupply() {
|
|
167
|
+
return this.$read('function totalSupply() returns uint256');
|
|
168
|
+
}
|
|
169
|
+
async transfer(eoa, recipient, amount) {
|
|
170
|
+
return this.$write('function transfer(address, uint256) returns bool', eoa, recipient, amount);
|
|
171
|
+
}
|
|
172
|
+
async transferFrom(eoa, sender, recipient, amount) {
|
|
173
|
+
return this.$write('function transferFrom(address, address, uint256) returns bool', eoa, sender, recipient, amount);
|
|
174
|
+
}
|
|
175
|
+
async transferWithAuthorization(eoa, from, to, value, validAfter, validBefore, nonce, v, r, s) {
|
|
176
|
+
return this.$write('function transferWithAuthorization(address, address, uint256, uint256, uint256, bytes32, uint8, bytes32, bytes32)', eoa, from, to, value, validAfter, validBefore, nonce, v, r, s);
|
|
177
|
+
}
|
|
178
|
+
async unBlacklist(eoa, account) {
|
|
179
|
+
return this.$write('function unBlacklist(address)', eoa, account);
|
|
180
|
+
}
|
|
181
|
+
async unpause(eoa) {
|
|
182
|
+
return this.$write('function unpause()', eoa);
|
|
183
|
+
}
|
|
184
|
+
async updateMetadata(eoa, newName, newSymbol) {
|
|
185
|
+
return this.$write('function updateMetadata(string, string)', eoa, newName, newSymbol);
|
|
186
|
+
}
|
|
187
|
+
async withdraw(eoa, amount) {
|
|
188
|
+
return this.$write('function withdraw(uint256)', eoa, amount);
|
|
189
|
+
}
|
|
190
|
+
async withdrawWithAuthorization(eoa, owner, value, validAfter, validBefore, nonce, v, r, s) {
|
|
191
|
+
return this.$write('function withdrawWithAuthorization(address, uint256, uint256, uint256, bytes32, uint8, bytes32, bytes32)', eoa, owner, value, validAfter, validBefore, nonce, v, r, s);
|
|
192
|
+
}
|
|
193
|
+
onApproval(fn) {
|
|
194
|
+
return this.$on('Approval', fn);
|
|
195
|
+
}
|
|
196
|
+
onAuthorizationCanceled(fn) {
|
|
197
|
+
return this.$on('AuthorizationCanceled', fn);
|
|
198
|
+
}
|
|
199
|
+
onAuthorizationUsed(fn) {
|
|
200
|
+
return this.$on('AuthorizationUsed', fn);
|
|
201
|
+
}
|
|
202
|
+
onBlacklisted(fn) {
|
|
203
|
+
return this.$on('Blacklisted', fn);
|
|
204
|
+
}
|
|
205
|
+
onMetaTransactionExecuted(fn) {
|
|
206
|
+
return this.$on('MetaTransactionExecuted', fn);
|
|
207
|
+
}
|
|
208
|
+
onPause(fn) {
|
|
209
|
+
return this.$on('Pause', fn);
|
|
210
|
+
}
|
|
211
|
+
onRescuerChanged(fn) {
|
|
212
|
+
return this.$on('RescuerChanged', fn);
|
|
213
|
+
}
|
|
214
|
+
onRoleAdminChanged(fn) {
|
|
215
|
+
return this.$on('RoleAdminChanged', fn);
|
|
216
|
+
}
|
|
217
|
+
onRoleGranted(fn) {
|
|
218
|
+
return this.$on('RoleGranted', fn);
|
|
219
|
+
}
|
|
220
|
+
onRoleRevoked(fn) {
|
|
221
|
+
return this.$on('RoleRevoked', fn);
|
|
222
|
+
}
|
|
223
|
+
onTransfer(fn) {
|
|
224
|
+
return this.$on('Transfer', fn);
|
|
225
|
+
}
|
|
226
|
+
onUnBlacklisted(fn) {
|
|
227
|
+
return this.$on('UnBlacklisted', fn);
|
|
228
|
+
}
|
|
229
|
+
onUnpause(fn) {
|
|
230
|
+
return this.$on('Unpause', fn);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
exports.ERC20PolygonBase = ERC20PolygonBase;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WormholeBridgeContractBase = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* AUTO-Generated Class: 2022-01-26 09:40
|
|
9
|
+
* Implementation: https://polygonscan.com/address/0x449c258f75bef9b6840e9252706d1644a9b4983c#code
|
|
10
|
+
*/
|
|
11
|
+
const a_di_1 = __importDefault(require("a-di"));
|
|
12
|
+
const ContractBase_1 = require("@dequanto/contracts/ContractBase");
|
|
13
|
+
const Polyscan_1 = require("@dequanto/BlockchainExplorer/Polyscan");
|
|
14
|
+
const PolyWeb3Client_1 = require("@dequanto/clients/PolyWeb3Client");
|
|
15
|
+
class WormholeBridgeContractBase extends ContractBase_1.ContractBase {
|
|
16
|
+
constructor(address = '0x5a58505a96d1dbf8df91cb21b54419fc36e93fde', client = a_di_1.default.resolve(PolyWeb3Client_1.PolyWeb3Client), explorer = a_di_1.default.resolve(Polyscan_1.Polyscan)) {
|
|
17
|
+
super(address, client, explorer);
|
|
18
|
+
this.address = address;
|
|
19
|
+
this.client = client;
|
|
20
|
+
this.explorer = explorer;
|
|
21
|
+
this.abi = [{ "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "previousAdmin", "type": "address" }, { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" }], "name": "AdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "beacon", "type": "address" }], "name": "BeaconUpgraded", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "oldContract", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newContract", "type": "address" }], "name": "ContractUpgraded", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "WETH", "outputs": [{ "internalType": "contract IWETH", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint32", "name": "nonce", "type": "uint32" }], "name": "attestToken", "outputs": [{ "internalType": "uint64", "name": "sequence", "type": "uint64" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "chainId_", "type": "uint16" }], "name": "bridgeContracts", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "chainId", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encodedVm", "type": "bytes" }], "name": "completeTransfer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encodedVm", "type": "bytes" }], "name": "completeTransferAndUnwrapETH", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encodedVm", "type": "bytes" }], "name": "createWrapped", "outputs": [{ "internalType": "address", "name": "token", "type": "address" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint8", "name": "payloadID", "type": "uint8" }, { "internalType": "bytes32", "name": "tokenAddress", "type": "bytes32" }, { "internalType": "uint16", "name": "tokenChain", "type": "uint16" }, { "internalType": "uint8", "name": "decimals", "type": "uint8" }, { "internalType": "bytes32", "name": "symbol", "type": "bytes32" }, { "internalType": "bytes32", "name": "name", "type": "bytes32" }], "internalType": "struct BridgeStructs.AssetMeta", "name": "meta", "type": "tuple" }], "name": "encodeAssetMeta", "outputs": [{ "internalType": "bytes", "name": "encoded", "type": "bytes" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "components": [{ "internalType": "uint8", "name": "payloadID", "type": "uint8" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bytes32", "name": "tokenAddress", "type": "bytes32" }, { "internalType": "uint16", "name": "tokenChain", "type": "uint16" }, { "internalType": "bytes32", "name": "to", "type": "bytes32" }, { "internalType": "uint16", "name": "toChain", "type": "uint16" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }], "internalType": "struct BridgeStructs.Transfer", "name": "transfer", "type": "tuple" }], "name": "encodeTransfer", "outputs": [{ "internalType": "bytes", "name": "encoded", "type": "bytes" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "hash", "type": "bytes32" }], "name": "governanceActionIsConsumed", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "governanceChainId", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "governanceContract", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "implementation", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "impl", "type": "address" }], "name": "isInitialized", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "hash", "type": "bytes32" }], "name": "isTransferCompleted", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "token", "type": "address" }], "name": "isWrappedAsset", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "token", "type": "address" }], "name": "outstandingBridged", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encoded", "type": "bytes" }], "name": "parseAssetMeta", "outputs": [{ "components": [{ "internalType": "uint8", "name": "payloadID", "type": "uint8" }, { "internalType": "bytes32", "name": "tokenAddress", "type": "bytes32" }, { "internalType": "uint16", "name": "tokenChain", "type": "uint16" }, { "internalType": "uint8", "name": "decimals", "type": "uint8" }, { "internalType": "bytes32", "name": "symbol", "type": "bytes32" }, { "internalType": "bytes32", "name": "name", "type": "bytes32" }], "internalType": "struct BridgeStructs.AssetMeta", "name": "meta", "type": "tuple" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encoded", "type": "bytes" }], "name": "parseRegisterChain", "outputs": [{ "components": [{ "internalType": "bytes32", "name": "module", "type": "bytes32" }, { "internalType": "uint8", "name": "action", "type": "uint8" }, { "internalType": "uint16", "name": "chainId", "type": "uint16" }, { "internalType": "uint16", "name": "emitterChainID", "type": "uint16" }, { "internalType": "bytes32", "name": "emitterAddress", "type": "bytes32" }], "internalType": "struct BridgeStructs.RegisterChain", "name": "chain", "type": "tuple" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encoded", "type": "bytes" }], "name": "parseTransfer", "outputs": [{ "components": [{ "internalType": "uint8", "name": "payloadID", "type": "uint8" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bytes32", "name": "tokenAddress", "type": "bytes32" }, { "internalType": "uint16", "name": "tokenChain", "type": "uint16" }, { "internalType": "bytes32", "name": "to", "type": "bytes32" }, { "internalType": "uint16", "name": "toChain", "type": "uint16" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }], "internalType": "struct BridgeStructs.Transfer", "name": "transfer", "type": "tuple" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encoded", "type": "bytes" }], "name": "parseUpgrade", "outputs": [{ "components": [{ "internalType": "bytes32", "name": "module", "type": "bytes32" }, { "internalType": "uint8", "name": "action", "type": "uint8" }, { "internalType": "uint16", "name": "chainId", "type": "uint16" }, { "internalType": "bytes32", "name": "newContract", "type": "bytes32" }], "internalType": "struct BridgeStructs.UpgradeContract", "name": "chain", "type": "tuple" }], "stateMutability": "pure", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encodedVM", "type": "bytes" }], "name": "registerChain", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "tokenImplementation", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint16", "name": "recipientChain", "type": "uint16" }, { "internalType": "bytes32", "name": "recipient", "type": "bytes32" }, { "internalType": "uint256", "name": "arbiterFee", "type": "uint256" }, { "internalType": "uint32", "name": "nonce", "type": "uint32" }], "name": "transferTokens", "outputs": [{ "internalType": "uint64", "name": "sequence", "type": "uint64" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encodedVm", "type": "bytes" }], "name": "updateWrapped", "outputs": [{ "internalType": "address", "name": "token", "type": "address" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes", "name": "encodedVM", "type": "bytes" }], "name": "upgrade", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "wormhole", "outputs": [{ "internalType": "contract IWormhole", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "recipientChain", "type": "uint16" }, { "internalType": "bytes32", "name": "recipient", "type": "bytes32" }, { "internalType": "uint256", "name": "arbiterFee", "type": "uint256" }, { "internalType": "uint32", "name": "nonce", "type": "uint32" }], "name": "wrapAndTransferETH", "outputs": [{ "internalType": "uint64", "name": "sequence", "type": "uint64" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "tokenChainId", "type": "uint16" }, { "internalType": "bytes32", "name": "tokenAddress", "type": "bytes32" }], "name": "wrappedAsset", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "stateMutability": "payable", "type": "receive" }];
|
|
22
|
+
}
|
|
23
|
+
// 0xad5c4648
|
|
24
|
+
async WETH() {
|
|
25
|
+
return this.$read('function WETH() returns address');
|
|
26
|
+
}
|
|
27
|
+
// 0xc48fa115
|
|
28
|
+
async attestToken(eoa, tokenAddress, nonce) {
|
|
29
|
+
return this.$write(this.$getAbiItem('function', 'attestToken'), eoa, tokenAddress, nonce);
|
|
30
|
+
}
|
|
31
|
+
// 0xad66a5f1
|
|
32
|
+
async bridgeContracts(chainId_) {
|
|
33
|
+
return this.$read('function bridgeContracts(uint16) returns bytes32', chainId_);
|
|
34
|
+
}
|
|
35
|
+
// 0x9a8a0592
|
|
36
|
+
async chainId() {
|
|
37
|
+
return this.$read('function chainId() returns uint16');
|
|
38
|
+
}
|
|
39
|
+
// 0xc6878519
|
|
40
|
+
async completeTransfer(eoa, encodedVm) {
|
|
41
|
+
return this.$write(this.$getAbiItem('function', 'completeTransfer'), eoa, encodedVm);
|
|
42
|
+
}
|
|
43
|
+
// 0xff200cde
|
|
44
|
+
async completeTransferAndUnwrapETH(eoa, encodedVm) {
|
|
45
|
+
return this.$write(this.$getAbiItem('function', 'completeTransferAndUnwrapETH'), eoa, encodedVm);
|
|
46
|
+
}
|
|
47
|
+
// 0xe8059810
|
|
48
|
+
async createWrapped(eoa, encodedVm) {
|
|
49
|
+
return this.$write(this.$getAbiItem('function', 'createWrapped'), eoa, encodedVm);
|
|
50
|
+
}
|
|
51
|
+
// 0xb046223b
|
|
52
|
+
async encodeAssetMeta(meta) {
|
|
53
|
+
return this.$read('function encodeAssetMeta(tuple) returns bytes', meta);
|
|
54
|
+
}
|
|
55
|
+
// 0x5f854266
|
|
56
|
+
async encodeTransfer(transfer) {
|
|
57
|
+
return this.$read('function encodeTransfer(tuple) returns bytes', transfer);
|
|
58
|
+
}
|
|
59
|
+
// 0x2c3c02a4
|
|
60
|
+
async governanceActionIsConsumed(hash) {
|
|
61
|
+
return this.$read('function governanceActionIsConsumed(bytes32) returns bool', hash);
|
|
62
|
+
}
|
|
63
|
+
// 0xfbe3c2cd
|
|
64
|
+
async governanceChainId() {
|
|
65
|
+
return this.$read('function governanceChainId() returns uint16');
|
|
66
|
+
}
|
|
67
|
+
// 0xb172b222
|
|
68
|
+
async governanceContract() {
|
|
69
|
+
return this.$read('function governanceContract() returns bytes32');
|
|
70
|
+
}
|
|
71
|
+
// 0x5c60da1b
|
|
72
|
+
async implementation() {
|
|
73
|
+
return this.$read('function implementation() returns address');
|
|
74
|
+
}
|
|
75
|
+
// 0x8129fc1c
|
|
76
|
+
async initialize(eoa) {
|
|
77
|
+
return this.$write(this.$getAbiItem('function', 'initialize'), eoa);
|
|
78
|
+
}
|
|
79
|
+
// 0xd60b347f
|
|
80
|
+
async isInitialized(impl) {
|
|
81
|
+
return this.$read('function isInitialized(address) returns bool', impl);
|
|
82
|
+
}
|
|
83
|
+
// 0xaa4efa5b
|
|
84
|
+
async isTransferCompleted(hash) {
|
|
85
|
+
return this.$read('function isTransferCompleted(bytes32) returns bool', hash);
|
|
86
|
+
}
|
|
87
|
+
// 0x1a2be4da
|
|
88
|
+
async isWrappedAsset(token) {
|
|
89
|
+
return this.$read('function isWrappedAsset(address) returns bool', token);
|
|
90
|
+
}
|
|
91
|
+
// 0xb96c7e4d
|
|
92
|
+
async outstandingBridged(token) {
|
|
93
|
+
return this.$read('function outstandingBridged(address) returns uint256', token);
|
|
94
|
+
}
|
|
95
|
+
// 0x07dfd8fb
|
|
96
|
+
async parseAssetMeta(encoded) {
|
|
97
|
+
return this.$read('function parseAssetMeta(bytes) returns [uint8,bytes32,uint16,uint8,bytes32,bytes32]', encoded);
|
|
98
|
+
}
|
|
99
|
+
// 0x01f53255
|
|
100
|
+
async parseRegisterChain(encoded) {
|
|
101
|
+
return this.$read('function parseRegisterChain(bytes) returns [bytes32,uint8,uint16,uint16,bytes32]', encoded);
|
|
102
|
+
}
|
|
103
|
+
// 0x2b511375
|
|
104
|
+
async parseTransfer(encoded) {
|
|
105
|
+
return this.$read('function parseTransfer(bytes) returns [uint8,uint256,bytes32,uint16,bytes32,uint16,uint256]', encoded);
|
|
106
|
+
}
|
|
107
|
+
// 0xfbeeacd9
|
|
108
|
+
async parseUpgrade(encoded) {
|
|
109
|
+
return this.$read('function parseUpgrade(bytes) returns [bytes32,uint8,uint16,bytes32]', encoded);
|
|
110
|
+
}
|
|
111
|
+
// 0xa5799f93
|
|
112
|
+
async registerChain(eoa, encodedVM) {
|
|
113
|
+
return this.$write(this.$getAbiItem('function', 'registerChain'), eoa, encodedVM);
|
|
114
|
+
}
|
|
115
|
+
// 0x2f3a3d5d
|
|
116
|
+
async tokenImplementation() {
|
|
117
|
+
return this.$read('function tokenImplementation() returns address');
|
|
118
|
+
}
|
|
119
|
+
// 0x0f5287b0
|
|
120
|
+
async transferTokens(eoa, token, amount, recipientChain, recipient, arbiterFee, nonce) {
|
|
121
|
+
return this.$write(this.$getAbiItem('function', 'transferTokens'), eoa, token, amount, recipientChain, recipient, arbiterFee, nonce);
|
|
122
|
+
}
|
|
123
|
+
// 0xf768441f
|
|
124
|
+
async updateWrapped(eoa, encodedVm) {
|
|
125
|
+
return this.$write(this.$getAbiItem('function', 'updateWrapped'), eoa, encodedVm);
|
|
126
|
+
}
|
|
127
|
+
// 0x25394645
|
|
128
|
+
async upgrade(eoa, encodedVM) {
|
|
129
|
+
return this.$write(this.$getAbiItem('function', 'upgrade'), eoa, encodedVM);
|
|
130
|
+
}
|
|
131
|
+
// 0x84acd1bb
|
|
132
|
+
async wormhole() {
|
|
133
|
+
return this.$read('function wormhole() returns address');
|
|
134
|
+
}
|
|
135
|
+
// 0x9981509f
|
|
136
|
+
async wrapAndTransferETH(eoa, recipientChain, recipient, arbiterFee, nonce) {
|
|
137
|
+
return this.$write(this.$getAbiItem('function', 'wrapAndTransferETH'), eoa, recipientChain, recipient, arbiterFee, nonce);
|
|
138
|
+
}
|
|
139
|
+
// 0x1ff1e286
|
|
140
|
+
async wrappedAsset(tokenChainId, tokenAddress) {
|
|
141
|
+
return this.$read('function wrappedAsset(uint16, bytes32) returns address', tokenChainId, tokenAddress);
|
|
142
|
+
}
|
|
143
|
+
onAdminChanged(fn) {
|
|
144
|
+
return this.$on('AdminChanged', fn);
|
|
145
|
+
}
|
|
146
|
+
onBeaconUpgraded(fn) {
|
|
147
|
+
return this.$on('BeaconUpgraded', fn);
|
|
148
|
+
}
|
|
149
|
+
onContractUpgraded(fn) {
|
|
150
|
+
return this.$on('ContractUpgraded', fn);
|
|
151
|
+
}
|
|
152
|
+
onUpgraded(fn) {
|
|
153
|
+
return this.$on('Upgraded', fn);
|
|
154
|
+
}
|
|
155
|
+
extractLogsAdminChanged(tx) {
|
|
156
|
+
let abi = this.$getAbiItem('event', 'AdminChanged');
|
|
157
|
+
return this.$extractLogs(tx, abi);
|
|
158
|
+
}
|
|
159
|
+
extractLogsBeaconUpgraded(tx) {
|
|
160
|
+
let abi = this.$getAbiItem('event', 'BeaconUpgraded');
|
|
161
|
+
return this.$extractLogs(tx, abi);
|
|
162
|
+
}
|
|
163
|
+
extractLogsContractUpgraded(tx) {
|
|
164
|
+
let abi = this.$getAbiItem('event', 'ContractUpgraded');
|
|
165
|
+
return this.$extractLogs(tx, abi);
|
|
166
|
+
}
|
|
167
|
+
extractLogsUpgraded(tx) {
|
|
168
|
+
let abi = this.$getAbiItem('event', 'Upgraded');
|
|
169
|
+
return this.$extractLogs(tx, abi);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.WormholeBridgeContractBase = WormholeBridgeContractBase;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WXDaiTokenContractBase = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* AUTO-Generated Class: 2021-12-15 23:03
|
|
9
|
+
*/
|
|
10
|
+
const a_di_1 = __importDefault(require("a-di"));
|
|
11
|
+
const ContractBase_1 = require("@dequanto/contracts/ContractBase");
|
|
12
|
+
const XDaiscan_1 = require("@dequanto/chains/xdai/XDaiscan");
|
|
13
|
+
const XDaiWeb3Client_1 = require("@dequanto/chains/xdai/XDaiWeb3Client");
|
|
14
|
+
class WXDaiTokenContractBase extends ContractBase_1.ContractBase {
|
|
15
|
+
constructor(address = '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', client = a_di_1.default.resolve(XDaiWeb3Client_1.XDaiWeb3Client), explorer = a_di_1.default.resolve(XDaiscan_1.XDaiscan)) {
|
|
16
|
+
super(address, client, explorer);
|
|
17
|
+
this.address = address;
|
|
18
|
+
this.client = client;
|
|
19
|
+
this.explorer = explorer;
|
|
20
|
+
this.abi = [{ "type": "function", "stateMutability": "view", "payable": false, "outputs": [{ "type": "string", "name": "" }], "name": "name", "inputs": [], "constant": true }, { "type": "function", "stateMutability": "nonpayable", "payable": false, "outputs": [{ "type": "bool", "name": "" }], "name": "approve", "inputs": [{ "type": "address", "name": "guy" }, { "type": "uint256", "name": "wad" }], "constant": false }, { "type": "function", "stateMutability": "view", "payable": false, "outputs": [{ "type": "uint256", "name": "" }], "name": "totalSupply", "inputs": [], "constant": true }, { "type": "function", "stateMutability": "nonpayable", "payable": false, "outputs": [{ "type": "bool", "name": "" }], "name": "transferFrom", "inputs": [{ "type": "address", "name": "src" }, { "type": "address", "name": "dst" }, { "type": "uint256", "name": "wad" }], "constant": false }, { "type": "function", "stateMutability": "nonpayable", "payable": false, "outputs": [], "name": "withdraw", "inputs": [{ "type": "uint256", "name": "wad" }], "constant": false }, { "type": "function", "stateMutability": "view", "payable": false, "outputs": [{ "type": "uint8", "name": "" }], "name": "decimals", "inputs": [], "constant": true }, { "type": "function", "stateMutability": "view", "payable": false, "outputs": [{ "type": "uint256", "name": "" }], "name": "balanceOf", "inputs": [{ "type": "address", "name": "" }], "constant": true }, { "type": "function", "stateMutability": "view", "payable": false, "outputs": [{ "type": "string", "name": "" }], "name": "symbol", "inputs": [], "constant": true }, { "type": "function", "stateMutability": "nonpayable", "payable": false, "outputs": [{ "type": "bool", "name": "" }], "name": "transfer", "inputs": [{ "type": "address", "name": "dst" }, { "type": "uint256", "name": "wad" }], "constant": false }, { "type": "function", "stateMutability": "payable", "payable": true, "outputs": [], "name": "deposit", "inputs": [], "constant": false }, { "type": "function", "stateMutability": "view", "payable": false, "outputs": [{ "type": "uint256", "name": "" }], "name": "allowance", "inputs": [{ "type": "address", "name": "" }, { "type": "address", "name": "" }], "constant": true }, { "type": "fallback", "stateMutability": "payable", "payable": true }, { "type": "event", "name": "Approval", "inputs": [{ "type": "address", "name": "src", "indexed": true }, { "type": "address", "name": "guy", "indexed": true }, { "type": "uint256", "name": "wad", "indexed": false }], "anonymous": false }, { "type": "event", "name": "Transfer", "inputs": [{ "type": "address", "name": "src", "indexed": true }, { "type": "address", "name": "dst", "indexed": true }, { "type": "uint256", "name": "wad", "indexed": false }], "anonymous": false }, { "type": "event", "name": "Deposit", "inputs": [{ "type": "address", "name": "dst", "indexed": true }, { "type": "uint256", "name": "wad", "indexed": false }], "anonymous": false }, { "type": "event", "name": "Withdrawal", "inputs": [{ "type": "address", "name": "src", "indexed": true }, { "type": "uint256", "name": "wad", "indexed": false }], "anonymous": false }];
|
|
21
|
+
}
|
|
22
|
+
// 0x06fdde03
|
|
23
|
+
async name() {
|
|
24
|
+
return this.$read('function name() returns string');
|
|
25
|
+
}
|
|
26
|
+
// 0x095ea7b3
|
|
27
|
+
async approve(eoa, guy, wad) {
|
|
28
|
+
return this.$write(this.$getAbiItem('function', 'approve'), eoa, guy, wad);
|
|
29
|
+
}
|
|
30
|
+
// 0x18160ddd
|
|
31
|
+
async totalSupply() {
|
|
32
|
+
return this.$read('function totalSupply() returns uint256');
|
|
33
|
+
}
|
|
34
|
+
// 0x23b872dd
|
|
35
|
+
async transferFrom(eoa, src, dst, wad) {
|
|
36
|
+
return this.$write(this.$getAbiItem('function', 'transferFrom'), eoa, src, dst, wad);
|
|
37
|
+
}
|
|
38
|
+
// 0x2e1a7d4d
|
|
39
|
+
async withdraw(eoa, wad) {
|
|
40
|
+
console.log('WXDaiTokenContractBase.withdraw');
|
|
41
|
+
return this.$write(this.$getAbiItem('function', 'withdraw'), eoa, wad);
|
|
42
|
+
}
|
|
43
|
+
// 0x313ce567
|
|
44
|
+
async decimals() {
|
|
45
|
+
return this.$read('function decimals() returns uint8');
|
|
46
|
+
}
|
|
47
|
+
// 0x70a08231
|
|
48
|
+
async balanceOf(input0) {
|
|
49
|
+
return this.$read('function balanceOf(address) returns uint256', input0);
|
|
50
|
+
}
|
|
51
|
+
// 0x95d89b41
|
|
52
|
+
async symbol() {
|
|
53
|
+
return this.$read('function symbol() returns string');
|
|
54
|
+
}
|
|
55
|
+
// 0xa9059cbb
|
|
56
|
+
async transfer(eoa, dst, wad) {
|
|
57
|
+
return this.$write(this.$getAbiItem('function', 'transfer'), eoa, dst, wad);
|
|
58
|
+
}
|
|
59
|
+
// 0xd0e30db0
|
|
60
|
+
async deposit(eoa) {
|
|
61
|
+
return this.$write(this.$getAbiItem('function', 'deposit'), eoa);
|
|
62
|
+
}
|
|
63
|
+
// 0xdd62ed3e
|
|
64
|
+
async allowance(input0, input1) {
|
|
65
|
+
return this.$read('function allowance(address, address) returns uint256', input0, input1);
|
|
66
|
+
}
|
|
67
|
+
onApproval(fn) {
|
|
68
|
+
return this.$on('Approval', fn);
|
|
69
|
+
}
|
|
70
|
+
onTransfer(fn) {
|
|
71
|
+
return this.$on('Transfer', fn);
|
|
72
|
+
}
|
|
73
|
+
onDeposit(fn) {
|
|
74
|
+
return this.$on('Deposit', fn);
|
|
75
|
+
}
|
|
76
|
+
onWithdrawal(fn) {
|
|
77
|
+
return this.$on('Withdrawal', fn);
|
|
78
|
+
}
|
|
79
|
+
extractLogsApproval(tx) {
|
|
80
|
+
let abi = this.$getAbiItem('event', 'Approval');
|
|
81
|
+
return this.$extractLogs(tx, abi);
|
|
82
|
+
}
|
|
83
|
+
extractLogsTransfer(tx) {
|
|
84
|
+
let abi = this.$getAbiItem('event', 'Transfer');
|
|
85
|
+
return this.$extractLogs(tx, abi);
|
|
86
|
+
}
|
|
87
|
+
extractLogsDeposit(tx) {
|
|
88
|
+
let abi = this.$getAbiItem('event', 'Deposit');
|
|
89
|
+
return this.$extractLogs(tx, abi);
|
|
90
|
+
}
|
|
91
|
+
extractLogsWithdrawal(tx) {
|
|
92
|
+
let abi = this.$getAbiItem('event', 'Withdrawal');
|
|
93
|
+
return this.$extractLogs(tx, abi);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.WXDaiTokenContractBase = WXDaiTokenContractBase;
|