dequanto 0.2.37 → 0.2.40
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/hardhat.config.js +10 -1
- package/lib/cjs/abi/$abiCoder.js +1 -1
- package/lib/cjs/abi/$abiCoder.js.map +1 -1
- package/lib/cjs/abi/Logger.js +1 -1
- package/lib/cjs/abi/abi-coder-packed.js +3 -3
- package/lib/cjs/abi/abi-coder.js +16 -16
- package/lib/cjs/abi/coders/abstract-coder.js +31 -31
- package/lib/cjs/abi/coders/abstract-coder.js.map +1 -1
- package/lib/cjs/abi/fragments.js +90 -90
- package/lib/cjs/abi/fragments.js.map +1 -1
- package/lib/cjs/blocks/BlockDateResolver.js +9 -9
- package/lib/cjs/blocks/BlockDateResolver.js.map +1 -1
- package/lib/cjs/class/PackedRanges.js +46 -46
- package/lib/cjs/class/PackedRanges.js.map +1 -1
- package/lib/cjs/clients/ClientEventsStream.js +1 -1
- package/lib/cjs/clients/ClientEventsStream.js.map +1 -1
- package/lib/cjs/clients/ClientPool.js +23 -23
- package/lib/cjs/clients/ClientPool.js.map +1 -1
- package/lib/cjs/clients/WalletClient.js +3 -3
- package/lib/cjs/clients/WalletClient.js.map +1 -1
- package/lib/cjs/clients/Web3Client.js +14 -14
- package/lib/cjs/clients/Web3Client.js.map +1 -1
- package/lib/cjs/clients/Web3ClientFactory.js +1 -1
- package/lib/cjs/clients/Web3ClientFactory.js.map +1 -1
- package/lib/cjs/clients/compatibility/Web3.js +2 -2
- package/lib/cjs/clients/compatibility/Web3.js.map +1 -1
- package/lib/cjs/clients/handlers/RateLimitGuard.js +16 -16
- package/lib/cjs/clients/handlers/RateLimitGuard.js.map +1 -1
- package/lib/cjs/clients/model/PromiEventWrap.js +1 -1
- package/lib/cjs/clients/model/PromiEventWrap.js.map +1 -1
- package/lib/cjs/clients/utils/$web3Abi.js +2 -2
- package/lib/cjs/clients/utils/$web3Abi.js.map +1 -1
- package/lib/cjs/clients/utils/ClientErrorUtil.js +4 -0
- package/lib/cjs/clients/utils/ClientErrorUtil.js.map +1 -1
- package/lib/cjs/config/Config.js.map +1 -1
- package/lib/cjs/contracts/Contract.js +1 -1
- package/lib/cjs/contracts/Contract.js.map +1 -1
- package/lib/cjs/contracts/ContractAbiProvider.js +6 -6
- package/lib/cjs/contracts/ContractAbiProvider.js.map +1 -1
- package/lib/cjs/contracts/ContractBase.js +10 -10
- package/lib/cjs/contracts/ContractBase.js.map +1 -1
- package/lib/cjs/contracts/ContractProvider.js +1 -1
- package/lib/cjs/contracts/ContractProvider.js.map +1 -1
- package/lib/cjs/contracts/ContractReader.js +5 -5
- package/lib/cjs/contracts/ContractReader.js.map +1 -1
- package/lib/cjs/contracts/ContractWriter.js +4 -4
- package/lib/cjs/contracts/ContractWriter.js.map +1 -1
- package/lib/cjs/contracts/deploy/ContractDeployer.js +4 -4
- package/lib/cjs/contracts/deploy/ContractDeployer.js.map +1 -1
- package/lib/cjs/contracts/deploy/Deployments.js +68 -26
- package/lib/cjs/contracts/deploy/Deployments.js.map +1 -1
- package/lib/cjs/contracts/deploy/proxy/$proxyDeploy.js +13 -13
- package/lib/cjs/contracts/deploy/proxy/$proxyDeploy.js.map +1 -1
- package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js +58 -25
- package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
- package/lib/cjs/contracts/deploy/storage/DeploymentsStorage.js +15 -14
- package/lib/cjs/contracts/deploy/storage/DeploymentsStorage.js.map +1 -1
- package/lib/cjs/contracts/utils/AbiDeserializer.js +4 -4
- package/lib/cjs/contracts/utils/AbiDeserializer.js.map +1 -1
- package/lib/cjs/contracts/utils/ContractBaseUtils.js +3 -3
- package/lib/cjs/contracts/utils/ContractBaseUtils.js.map +1 -1
- package/lib/cjs/evm/OpcodesWalker.js +1 -1
- package/lib/cjs/evm/OpcodesWalker.js.map +1 -1
- package/lib/cjs/explorer/BlockchainExplorer.js +1 -1
- package/lib/cjs/explorer/BlockchainExplorer.js.map +1 -1
- package/lib/cjs/explorer/BlockchainExplorerFactory.js +1 -1
- package/lib/cjs/explorer/BlockchainExplorerStorage.js +12 -12
- package/lib/cjs/explorer/BlockchainExplorerStorage.js.map +1 -1
- package/lib/cjs/explorer/Evmscan.js +1 -1
- package/lib/cjs/explorer/verifiers/FsHtmlVerifier.js +7 -7
- package/lib/cjs/explorer/verifiers/FsHtmlVerifier.js.map +1 -1
- package/lib/cjs/flashbots/FlashbotWeb3Client.js +1 -1
- package/lib/cjs/flashbots/FlashbotWeb3Client.js.map +1 -1
- package/lib/cjs/gen/Generator.js +15 -0
- package/lib/cjs/gen/Generator.js.map +1 -1
- package/lib/cjs/hardhat/HardhatProvider.js +7 -7
- package/lib/cjs/hardhat/HardhatProvider.js.map +1 -1
- package/lib/cjs/indexer/BlocksTxIndexer.js +2 -2
- package/lib/cjs/indexer/BlocksTxIndexer.js.map +1 -1
- package/lib/cjs/indexer/EventsIndexer.js +11 -11
- package/lib/cjs/indexer/EventsIndexer.js.map +1 -1
- package/lib/cjs/indexer/PendingTxIndexer.js +2 -2
- package/lib/cjs/indexer/PendingTxIndexer.js.map +1 -1
- package/lib/cjs/indexer/handlers/BlocksWalker.js +9 -9
- package/lib/cjs/indexer/handlers/BlocksWalker.js.map +1 -1
- package/lib/cjs/indexer/handlers/TxQueueLoader.js +1 -1
- package/lib/cjs/indexer/storage/FsEventsIndexerStore.js +3 -3
- package/lib/cjs/indexer/storage/FsEventsIndexerStore.js.map +1 -1
- package/lib/cjs/indexer/storage/FsEventsStoreUtils.js +1 -1
- package/lib/cjs/indexer/storage/FsEventsStoreUtils.js.map +1 -1
- package/lib/cjs/json/JsonArrayMultiStore.js +1 -1
- package/lib/cjs/json/JsonArrayMultiStore.js.map +1 -1
- package/lib/cjs/json/JsonStoreFs.js +1 -1
- package/lib/cjs/json/JsonStoreFs.js.map +1 -1
- package/lib/cjs/rpc/$rpc.js +2 -2
- package/lib/cjs/rpc/$rpc.js.map +1 -1
- package/lib/cjs/rpc/Rpc.js +2 -2
- package/lib/cjs/rpc/RpcBase.js +2 -2
- package/lib/cjs/rpc/RpcBase.js.map +1 -1
- package/lib/cjs/rpc/RpcContract.js +4 -3
- package/lib/cjs/rpc/RpcContract.js.map +1 -1
- package/lib/cjs/rpc/RpcSubscription.js +1 -1
- package/lib/cjs/rpc/RpcSubscription.js.map +1 -1
- package/lib/cjs/rpc/transports/compatibility/EIP1193Transport.js +4 -4
- package/lib/cjs/rpc/transports/compatibility/EIP1193Transport.js.map +1 -1
- package/lib/cjs/rpc/transports/compatibility/Web3Transport.js +1 -1
- package/lib/cjs/rpc/transports/compatibility/Web3Transport.js.map +1 -1
- package/lib/cjs/services/TimelockService/TimelockService.js +2 -2
- package/lib/cjs/services/TimelockService/TimelockServiceFallbackSafe.js +2 -2
- package/lib/cjs/solidity/SlotsDump.js +1 -1
- package/lib/cjs/solidity/SlotsDump.js.map +1 -1
- package/lib/cjs/solidity/SlotsParser/MappingSettersResolver.js +3 -3
- package/lib/cjs/solidity/SlotsParser/MappingSettersResolver.js.map +1 -1
- package/lib/cjs/solidity/SlotsParser/SourceFile.js +3 -3
- package/lib/cjs/solidity/SlotsParser/SourceFile.js.map +1 -1
- package/lib/cjs/solidity/SolidityParser.js +1 -1
- package/lib/cjs/solidity/SolidityParser.js.map +1 -1
- package/lib/cjs/solidity/SourceCodeProvider.js +1 -1
- package/lib/cjs/solidity/SourceCodeProvider.js.map +1 -1
- package/lib/cjs/solidity/storage/Accessor.js +1 -1
- package/lib/cjs/solidity/storage/Accessor.js.map +1 -1
- package/lib/cjs/solidity/storage/SlotFixedArray.js +1 -1
- package/lib/cjs/solidity/storage/SlotFixedArray.js.map +1 -1
- package/lib/cjs/solidity/storage/SlotsStorageTransport.js +3 -3
- package/lib/cjs/solidity/storage/SlotsStorageTransport.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotBytesHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotBytesHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotDynamicArrayHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotDynamicArrayHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotFixedArrayHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotFixedArrayHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueConstantHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueConstantHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueImmutableHandler.js +4 -4
- package/lib/cjs/solidity/storage/handlers/SlotValueImmutableHandler.js.map +1 -1
- package/lib/cjs/tokens/TokenDataProvider.js +2 -2
- package/lib/cjs/tokens/TokenDataProvider.js.map +1 -1
- package/lib/cjs/tokens/TokenExchangeService.js +1 -1
- package/lib/cjs/tokens/TokenExchangeService.js.map +1 -1
- package/lib/cjs/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js +2 -2
- package/lib/cjs/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js.map +1 -1
- package/lib/cjs/tokens/TokenExchanges/AmmV2PriceQuote.js +2 -2
- package/lib/cjs/tokens/TokenExchanges/AmmV2PriceQuote.js.map +1 -1
- package/lib/cjs/tokens/TokenOracles/amm/AmmV1Oracle.js +2 -2
- package/lib/cjs/tokens/TokenOracles/amm/AmmV1Oracle.js.map +1 -1
- package/lib/cjs/tokens/TokenTransferService.js +2 -2
- package/lib/cjs/tokens/TokenTransferService.js.map +1 -1
- package/lib/cjs/tokens/TokensService.js +1 -1
- package/lib/cjs/tokens/TokensService.js.map +1 -1
- package/lib/cjs/txs/TxNonceManager.js +1 -1
- package/lib/cjs/txs/TxWriter.js +9 -0
- package/lib/cjs/txs/TxWriter.js.map +1 -1
- package/lib/cjs/txs/conditional/GasWatcherTx.js +1 -1
- package/lib/cjs/txs/conditional/GasWatcherTx.js.map +1 -1
- package/lib/cjs/txs/receipt/TxLogParser.js +1 -1
- package/lib/cjs/utils/$crypto.js +1 -1
- package/lib/cjs/utils/$crypto.js.map +1 -1
- package/lib/cjs/utils/$date.js +1 -1
- package/lib/cjs/utils/$date.js.map +1 -1
- package/lib/cjs/utils/$hex.js +1 -1
- package/lib/cjs/utils/$logger.js +1 -1
- package/lib/cjs/utils/$logger.js.map +1 -1
- package/lib/cjs/utils/$machine.js +2 -2
- package/lib/cjs/utils/$machine.js.map +1 -1
- package/lib/cjs/utils/$traces.js +1 -1
- package/lib/cjs/utils/$traces.js.map +1 -1
- package/lib/esm/abi/$abiCoder.js.map +1 -1
- package/lib/esm/abi/$abiCoder.mjs +1 -1
- package/lib/esm/abi/Logger.mjs +1 -1
- package/lib/esm/abi/abi-coder-packed.mjs +3 -3
- package/lib/esm/abi/abi-coder.mjs +16 -16
- package/lib/esm/abi/coders/abstract-coder.js.map +1 -1
- package/lib/esm/abi/coders/abstract-coder.mjs +31 -31
- package/lib/esm/abi/fragments.js.map +1 -1
- package/lib/esm/abi/fragments.mjs +90 -90
- package/lib/esm/blocks/BlockDateResolver.js.map +1 -1
- package/lib/esm/blocks/BlockDateResolver.mjs +9 -9
- package/lib/esm/class/PackedRanges.js.map +1 -1
- package/lib/esm/class/PackedRanges.mjs +46 -46
- package/lib/esm/clients/ClientEventsStream.js.map +1 -1
- package/lib/esm/clients/ClientEventsStream.mjs +1 -1
- package/lib/esm/clients/ClientPool.js.map +1 -1
- package/lib/esm/clients/ClientPool.mjs +23 -23
- package/lib/esm/clients/WalletClient.js.map +1 -1
- package/lib/esm/clients/WalletClient.mjs +3 -3
- package/lib/esm/clients/Web3Client.js.map +1 -1
- package/lib/esm/clients/Web3Client.mjs +14 -14
- package/lib/esm/clients/Web3ClientFactory.js.map +1 -1
- package/lib/esm/clients/Web3ClientFactory.mjs +1 -1
- package/lib/esm/clients/compatibility/Web3.js.map +1 -1
- package/lib/esm/clients/compatibility/Web3.mjs +2 -2
- package/lib/esm/clients/handlers/RateLimitGuard.js.map +1 -1
- package/lib/esm/clients/handlers/RateLimitGuard.mjs +16 -16
- package/lib/esm/clients/model/PromiEventWrap.js.map +1 -1
- package/lib/esm/clients/model/PromiEventWrap.mjs +1 -1
- package/lib/esm/clients/utils/$web3Abi.js.map +1 -1
- package/lib/esm/clients/utils/$web3Abi.mjs +2 -2
- package/lib/esm/clients/utils/ClientErrorUtil.js.map +1 -1
- package/lib/esm/clients/utils/ClientErrorUtil.mjs +4 -0
- package/lib/esm/config/Config.js.map +1 -1
- package/lib/esm/contracts/Contract.js.map +1 -1
- package/lib/esm/contracts/Contract.mjs +1 -1
- package/lib/esm/contracts/ContractAbiProvider.js.map +1 -1
- package/lib/esm/contracts/ContractAbiProvider.mjs +6 -6
- package/lib/esm/contracts/ContractBase.js.map +1 -1
- package/lib/esm/contracts/ContractBase.mjs +10 -10
- package/lib/esm/contracts/ContractProvider.js.map +1 -1
- package/lib/esm/contracts/ContractProvider.mjs +1 -1
- package/lib/esm/contracts/ContractReader.js.map +1 -1
- package/lib/esm/contracts/ContractReader.mjs +5 -5
- package/lib/esm/contracts/ContractWriter.js.map +1 -1
- package/lib/esm/contracts/ContractWriter.mjs +4 -4
- package/lib/esm/contracts/deploy/ContractDeployer.js.map +1 -1
- package/lib/esm/contracts/deploy/ContractDeployer.mjs +4 -4
- package/lib/esm/contracts/deploy/Deployments.js.map +1 -1
- package/lib/esm/contracts/deploy/Deployments.mjs +68 -26
- package/lib/esm/contracts/deploy/proxy/$proxyDeploy.js.map +1 -1
- package/lib/esm/contracts/deploy/proxy/$proxyDeploy.mjs +13 -13
- package/lib/esm/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
- package/lib/esm/contracts/deploy/proxy/ProxyDeployment.mjs +58 -25
- package/lib/esm/contracts/deploy/storage/DeploymentsStorage.js.map +1 -1
- package/lib/esm/contracts/deploy/storage/DeploymentsStorage.mjs +15 -14
- package/lib/esm/contracts/utils/AbiDeserializer.js.map +1 -1
- package/lib/esm/contracts/utils/AbiDeserializer.mjs +4 -4
- package/lib/esm/contracts/utils/ContractBaseUtils.js.map +1 -1
- package/lib/esm/contracts/utils/ContractBaseUtils.mjs +3 -3
- package/lib/esm/evm/OpcodesWalker.js.map +1 -1
- package/lib/esm/evm/OpcodesWalker.mjs +1 -1
- package/lib/esm/explorer/BlockchainExplorer.js.map +1 -1
- package/lib/esm/explorer/BlockchainExplorer.mjs +1 -1
- package/lib/esm/explorer/BlockchainExplorerFactory.mjs +1 -1
- package/lib/esm/explorer/BlockchainExplorerStorage.js.map +1 -1
- package/lib/esm/explorer/BlockchainExplorerStorage.mjs +12 -12
- package/lib/esm/explorer/Evmscan.mjs +1 -1
- package/lib/esm/explorer/verifiers/FsHtmlVerifier.js.map +1 -1
- package/lib/esm/explorer/verifiers/FsHtmlVerifier.mjs +7 -7
- package/lib/esm/flashbots/FlashbotWeb3Client.js.map +1 -1
- package/lib/esm/flashbots/FlashbotWeb3Client.mjs +1 -1
- package/lib/esm/gen/Generator.js.map +1 -1
- package/lib/esm/gen/Generator.mjs +15 -0
- package/lib/esm/hardhat/HardhatProvider.js.map +1 -1
- package/lib/esm/hardhat/HardhatProvider.mjs +7 -7
- package/lib/esm/indexer/BlocksTxIndexer.js.map +1 -1
- package/lib/esm/indexer/BlocksTxIndexer.mjs +2 -2
- package/lib/esm/indexer/EventsIndexer.js.map +1 -1
- package/lib/esm/indexer/EventsIndexer.mjs +11 -11
- package/lib/esm/indexer/PendingTxIndexer.js.map +1 -1
- package/lib/esm/indexer/PendingTxIndexer.mjs +2 -2
- package/lib/esm/indexer/handlers/BlocksWalker.js.map +1 -1
- package/lib/esm/indexer/handlers/BlocksWalker.mjs +9 -9
- package/lib/esm/indexer/handlers/TxQueueLoader.mjs +1 -1
- package/lib/esm/indexer/storage/FsEventsIndexerStore.js.map +1 -1
- package/lib/esm/indexer/storage/FsEventsIndexerStore.mjs +3 -3
- package/lib/esm/indexer/storage/FsEventsStoreUtils.js.map +1 -1
- package/lib/esm/indexer/storage/FsEventsStoreUtils.mjs +1 -1
- package/lib/esm/json/JsonArrayMultiStore.js.map +1 -1
- package/lib/esm/json/JsonArrayMultiStore.mjs +1 -1
- package/lib/esm/json/JsonStoreFs.js.map +1 -1
- package/lib/esm/json/JsonStoreFs.mjs +1 -1
- package/lib/esm/rpc/$rpc.js.map +1 -1
- package/lib/esm/rpc/$rpc.mjs +2 -2
- package/lib/esm/rpc/Rpc.mjs +2 -2
- package/lib/esm/rpc/RpcBase.js.map +1 -1
- package/lib/esm/rpc/RpcBase.mjs +2 -2
- package/lib/esm/rpc/RpcContract.js.map +1 -1
- package/lib/esm/rpc/RpcContract.mjs +4 -3
- package/lib/esm/rpc/RpcSubscription.js.map +1 -1
- package/lib/esm/rpc/RpcSubscription.mjs +1 -1
- package/lib/esm/rpc/transports/compatibility/EIP1193Transport.js.map +1 -1
- package/lib/esm/rpc/transports/compatibility/EIP1193Transport.mjs +4 -4
- package/lib/esm/rpc/transports/compatibility/Web3Transport.js.map +1 -1
- package/lib/esm/rpc/transports/compatibility/Web3Transport.mjs +1 -1
- package/lib/esm/services/TimelockService/TimelockService.mjs +2 -2
- package/lib/esm/services/TimelockService/TimelockServiceFallbackSafe.mjs +2 -2
- package/lib/esm/solidity/SlotsDump.js.map +1 -1
- package/lib/esm/solidity/SlotsDump.mjs +1 -1
- package/lib/esm/solidity/SlotsParser/MappingSettersResolver.js.map +1 -1
- package/lib/esm/solidity/SlotsParser/MappingSettersResolver.mjs +3 -3
- package/lib/esm/solidity/SlotsParser/SourceFile.js.map +1 -1
- package/lib/esm/solidity/SlotsParser/SourceFile.mjs +3 -3
- package/lib/esm/solidity/SolidityParser.js.map +1 -1
- package/lib/esm/solidity/SolidityParser.mjs +1 -1
- package/lib/esm/solidity/SourceCodeProvider.js.map +1 -1
- package/lib/esm/solidity/SourceCodeProvider.mjs +1 -1
- package/lib/esm/solidity/storage/Accessor.js.map +1 -1
- package/lib/esm/solidity/storage/Accessor.mjs +1 -1
- package/lib/esm/solidity/storage/SlotFixedArray.js.map +1 -1
- package/lib/esm/solidity/storage/SlotFixedArray.mjs +1 -1
- package/lib/esm/solidity/storage/SlotsStorageTransport.js.map +1 -1
- package/lib/esm/solidity/storage/SlotsStorageTransport.mjs +3 -3
- package/lib/esm/solidity/storage/handlers/SlotBytesHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotBytesHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotDynamicArrayHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotDynamicArrayHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotFixedArrayHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotFixedArrayHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueConstantHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueConstantHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueImmutableHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueImmutableHandler.mjs +4 -4
- package/lib/esm/tokens/TokenDataProvider.js.map +1 -1
- package/lib/esm/tokens/TokenDataProvider.mjs +2 -2
- package/lib/esm/tokens/TokenExchangeService.js.map +1 -1
- package/lib/esm/tokens/TokenExchangeService.mjs +1 -1
- package/lib/esm/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js.map +1 -1
- package/lib/esm/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.mjs +2 -2
- package/lib/esm/tokens/TokenExchanges/AmmV2PriceQuote.js.map +1 -1
- package/lib/esm/tokens/TokenExchanges/AmmV2PriceQuote.mjs +2 -2
- package/lib/esm/tokens/TokenOracles/amm/AmmV1Oracle.js.map +1 -1
- package/lib/esm/tokens/TokenOracles/amm/AmmV1Oracle.mjs +2 -2
- package/lib/esm/tokens/TokenTransferService.js.map +1 -1
- package/lib/esm/tokens/TokenTransferService.mjs +2 -2
- package/lib/esm/tokens/TokensService.js.map +1 -1
- package/lib/esm/tokens/TokensService.mjs +1 -1
- package/lib/esm/txs/TxNonceManager.mjs +1 -1
- package/lib/esm/txs/TxWriter.js.map +1 -1
- package/lib/esm/txs/TxWriter.mjs +9 -0
- package/lib/esm/txs/conditional/GasWatcherTx.js.map +1 -1
- package/lib/esm/txs/conditional/GasWatcherTx.mjs +1 -1
- package/lib/esm/txs/receipt/TxLogParser.mjs +1 -1
- package/lib/esm/utils/$crypto.js.map +1 -1
- package/lib/esm/utils/$crypto.mjs +1 -1
- package/lib/esm/utils/$date.js.map +1 -1
- package/lib/esm/utils/$date.mjs +1 -1
- package/lib/esm/utils/$hex.mjs +1 -1
- package/lib/esm/utils/$logger.js.map +1 -1
- package/lib/esm/utils/$logger.mjs +1 -1
- package/lib/esm/utils/$machine.js.map +1 -1
- package/lib/esm/utils/$machine.mjs +2 -2
- package/lib/esm/utils/$traces.js.map +1 -1
- package/lib/esm/utils/$traces.mjs +1 -1
- package/lib/types/abi/abi-coder-packed.d.ts +1 -1
- package/lib/types/abi/abi-coder.d.ts +13 -13
- package/lib/types/abi/coders/abstract-coder.d.ts +14 -14
- package/lib/types/abi/fragments.d.ts +95 -95
- package/lib/types/blocks/BlockDateResolver.d.ts +7 -7
- package/lib/types/class/PackedRanges.d.ts +44 -44
- package/lib/types/clients/ClientPool.d.ts +10 -10
- package/lib/types/clients/WalletClient.d.ts +2 -2
- package/lib/types/clients/Web3Client.d.ts +6 -6
- package/lib/types/clients/Web3ClientFactory.d.ts +1 -1
- package/lib/types/clients/handlers/RateLimitGuard.d.ts +5 -5
- package/lib/types/clients/model/PromiEventWrap.d.ts +1 -1
- package/lib/types/clients/utils/$web3Abi.d.ts +1 -1
- package/lib/types/clients/utils/ClientErrorUtil.d.ts +1 -0
- package/lib/types/config/Config.d.ts +3 -2
- package/lib/types/contracts/ContractBase.d.ts +4 -4
- package/lib/types/contracts/ContractReader.d.ts +2 -2
- package/lib/types/contracts/ContractWriter.d.ts +3 -3
- package/lib/types/contracts/deploy/Deployments.d.ts +20 -15
- package/lib/types/contracts/deploy/proxy/ProxyDeployment.d.ts +2 -0
- package/lib/types/contracts/deploy/storage/DeploymentsStorage.d.ts +2 -0
- package/lib/types/explorer/BlockchainExplorerFactory.d.ts +1 -1
- package/lib/types/explorer/Evmscan.d.ts +1 -1
- package/lib/types/gen/Generator.d.ts +8 -0
- package/lib/types/indexer/BlocksTxIndexer.d.ts +4 -4
- package/lib/types/indexer/EventsIndexer.d.ts +4 -4
- package/lib/types/indexer/PendingTxIndexer.d.ts +1 -1
- package/lib/types/indexer/handlers/BlocksWalker.d.ts +2 -2
- package/lib/types/indexer/storage/FsEventsIndexerStore.d.ts +4 -4
- package/lib/types/ns/providers/INsProvider.d.ts +1 -1
- package/lib/types/rpc/Rpc.d.ts +2 -2
- package/lib/types/services/TimelockService/ITimelockService.d.ts +2 -2
- package/lib/types/services/TimelockService/TimelockService.d.ts +2 -2
- package/lib/types/services/TimelockService/TimelockServiceFallbackSafe.d.ts +2 -2
- package/lib/types/solidity/SlotsParser/SourceFile.d.ts +1 -1
- package/lib/types/solidity/storage/SlotFixedArray.d.ts +1 -1
- package/lib/types/tokens/TokenDataProvider.d.ts +2 -2
- package/lib/types/tokens/TokensService.d.ts +1 -1
- package/lib/types/txs/ITxBuilderOptions.d.ts +1 -1
- package/lib/types/txs/TxNonceManager.d.ts +1 -1
- package/lib/types/txs/TxWriter.d.ts +4 -4
- package/lib/types/txs/receipt/TxLogParser.d.ts +1 -1
- package/lib/types/utils/$date.d.ts +1 -1
- package/lib/types/utils/$hex.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +105 -83
- package/src/abi/$abiCoder.ts +1 -1
- package/src/abi/Logger.ts +1 -1
- package/src/abi/abi-coder-packed.ts +3 -3
- package/src/abi/abi-coder.ts +16 -16
- package/src/abi/coders/abstract-coder.ts +36 -36
- package/src/abi/fragments.ts +137 -137
- package/src/blocks/BlockDateResolver.ts +9 -9
- package/src/bridges/hop/HopBridge.ts +1 -1
- package/src/class/PackedRanges.ts +46 -46
- package/src/clients/ClientEventsStream.ts +1 -1
- package/src/clients/ClientPool.ts +38 -38
- package/src/clients/WalletClient.ts +3 -3
- package/src/clients/Web3BatchRequests.ts +3 -3
- package/src/clients/Web3Client.ts +21 -21
- package/src/clients/Web3ClientFactory.ts +1 -1
- package/src/clients/compatibility/Web3.ts +2 -2
- package/src/clients/handlers/RateLimitGuard.ts +16 -16
- package/src/clients/interfaces/IWeb3Client.ts +2 -2
- package/src/clients/model/PromiEventWrap.ts +1 -1
- package/src/clients/utils/$web3Abi.ts +2 -2
- package/src/clients/utils/ClientErrorUtil.ts +4 -0
- package/src/config/Config.ts +4 -3
- package/src/contracts/Contract.ts +1 -1
- package/src/contracts/ContractAbiProvider.ts +6 -6
- package/src/contracts/ContractBase.ts +14 -14
- package/src/contracts/ContractProvider.ts +1 -1
- package/src/contracts/ContractReader.ts +7 -7
- package/src/contracts/ContractWriter.ts +4 -4
- package/src/contracts/deploy/ContractDeployer.ts +4 -4
- package/src/contracts/deploy/ContractDeployment.ts +1 -1
- package/src/contracts/deploy/Deployments.ts +110 -53
- package/src/contracts/deploy/proxy/$proxyDeploy.ts +14 -14
- package/src/contracts/deploy/proxy/ProxyDeployment.ts +82 -37
- package/src/contracts/deploy/storage/DeploymentsStorage.ts +21 -18
- package/src/contracts/utils/AbiDeserializer.ts +4 -4
- package/src/contracts/utils/ContractBaseUtils.ts +3 -3
- package/src/erc4337/models/UserOperation.ts +2 -2
- package/src/evm/OpcodesWalker.ts +1 -1
- package/src/explorer/BlockchainExplorer.ts +1 -1
- package/src/explorer/BlockchainExplorerFactory.ts +1 -1
- package/src/explorer/BlockchainExplorerStorage.ts +12 -12
- package/src/explorer/Evmscan.ts +1 -1
- package/src/explorer/verifiers/FsHtmlVerifier.ts +7 -7
- package/src/flashbots/FlashbotWeb3Client.ts +1 -1
- package/src/gen/Generator.ts +17 -0
- package/src/hardhat/HardhatProvider.ts +7 -7
- package/src/indexer/BlocksTxIndexer.ts +6 -6
- package/src/indexer/EventsIndexer.ts +20 -20
- package/src/indexer/PendingTxIndexer.ts +3 -3
- package/src/indexer/handlers/BlocksWalker.ts +9 -9
- package/src/indexer/handlers/TxQueueLoader.ts +1 -1
- package/src/indexer/storage/FsEventsIndexerStore.ts +9 -9
- package/src/indexer/storage/FsEventsMetaStore.ts +1 -1
- package/src/indexer/storage/FsEventsStoreUtils.ts +1 -1
- package/src/json/JsonArrayMultiStore.ts +1 -1
- package/src/json/JsonStoreFs.ts +1 -1
- package/src/ns/providers/INsProvider.ts +1 -1
- package/src/rpc/$rpc.ts +2 -2
- package/src/rpc/Rpc.ts +2 -2
- package/src/rpc/RpcBase.ts +2 -2
- package/src/rpc/RpcContract.ts +6 -6
- package/src/rpc/RpcSubscription.ts +1 -1
- package/src/rpc/transports/compatibility/EIP1193Transport.ts +4 -4
- package/src/rpc/transports/compatibility/Web3Transport.ts +1 -1
- package/src/services/TimelockService/ITimelockService.ts +2 -2
- package/src/services/TimelockService/TimelockService.ts +2 -2
- package/src/services/TimelockService/TimelockServiceFallbackSafe.ts +2 -2
- package/src/solidity/SlotsDump.ts +1 -1
- package/src/solidity/SlotsParser/MappingSettersResolver.ts +3 -3
- package/src/solidity/SlotsParser/SourceFile.ts +3 -3
- package/src/solidity/SolidityParser.ts +1 -1
- package/src/solidity/SourceCodeProvider.ts +1 -1
- package/src/solidity/storage/Accessor.spec.ts +1 -1
- package/src/solidity/storage/Accessor.ts +1 -1
- package/src/solidity/storage/SlotDynamicArray.ts +1 -1
- package/src/solidity/storage/SlotFixedArray.ts +1 -1
- package/src/solidity/storage/SlotsStorageTransport.ts +3 -3
- package/src/solidity/storage/handlers/SlotBytesHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotDynamicArrayHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotFixedArrayHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotValueConstantHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotValueHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotValueImmutableHandler.ts +4 -4
- package/src/tokens/TokenDataProvider.ts +2 -2
- package/src/tokens/TokenExchangeService.ts +1 -1
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.ts +2 -2
- package/src/tokens/TokenExchanges/AmmV2PriceQuote.ts +2 -2
- package/src/tokens/TokenOracles/amm/AmmV1Oracle.ts +2 -2
- package/src/tokens/TokenTransferService.ts +2 -2
- package/src/tokens/TokensService.ts +1 -1
- package/src/txs/ITxBuilderOptions.ts +1 -1
- package/src/txs/TxNonceManager.ts +1 -1
- package/src/txs/TxWriter.ts +15 -4
- package/src/txs/agents/BatchAgent.ts +1 -1
- package/src/txs/conditional/GasWatcherTx.ts +1 -1
- package/src/txs/receipt/TxLogParser.ts +1 -1
- package/src/utils/$crypto.ts +1 -1
- package/src/utils/$date.ts +1 -1
- package/src/utils/$hex.ts +1 -1
- package/src/utils/$logger.ts +1 -1
- package/src/utils/$machine.ts +2 -2
- package/src/utils/$traces.ts +1 -1
- package/src/wallets/EIP6963ProviderFactory.ts +4 -4
package/src/abi/abi-coder.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* When sending values to or receiving values from a [[Contract]], the
|
|
3
|
-
* data is generally encoded using the [ABI standard](link-solc-abi)
|
|
3
|
+
* data is generally encoded using the [ABI standard](link-solc-abi)
|
|
4
4
|
*
|
|
5
5
|
* The AbiCoder provides a utility to encode values to ABI data and
|
|
6
|
-
* decode values from ABI data
|
|
6
|
+
* decode values from ABI data
|
|
7
7
|
*
|
|
8
|
-
* Most of the time, developers should
|
|
9
|
-
* which further abstracts a lot of the finer details of ABI data
|
|
8
|
+
* Most of the time, developers should favor the [[Contract]] class,
|
|
9
|
+
* which further abstracts a lot of the finer details of ABI data
|
|
10
10
|
*
|
|
11
11
|
* @_section api/abi/abi-coder:ABI Encoding
|
|
12
12
|
*/
|
|
@@ -52,7 +52,7 @@ let defaultCoder: null | AbiCoder = null;
|
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* The **AbiCoder** is a low-level class responsible for encoding JavaScript
|
|
55
|
-
* values into binary data and decoding binary data into JavaScript values
|
|
55
|
+
* values into binary data and decoding binary data into JavaScript values
|
|
56
56
|
*/
|
|
57
57
|
export class AbiCoder {
|
|
58
58
|
|
|
@@ -83,7 +83,7 @@ export class AbiCoder {
|
|
|
83
83
|
if (match) {
|
|
84
84
|
let size = parseInt(match[2] || "256");
|
|
85
85
|
$require.True(size !== 0 && size <= 256 && (size % 8) === 0,
|
|
86
|
-
"
|
|
86
|
+
"Invalid " + match[1] + " bit length" + param);
|
|
87
87
|
return new NumberCoder(size / 8, (match[1] === "int"), param.name);
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -91,18 +91,18 @@ export class AbiCoder {
|
|
|
91
91
|
match = param.type.match(paramTypeBytes);
|
|
92
92
|
if (match) {
|
|
93
93
|
let size = parseInt(match[1]);
|
|
94
|
-
$require.True(size !== 0 && size <= 32, "
|
|
94
|
+
$require.True(size !== 0 && size <= 32, "Invalid bytes length" + param);
|
|
95
95
|
return new FixedBytesCoder(size, param.name);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
throw new Error(`
|
|
98
|
+
throw new Error(`Invalid type ${param.type}`);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
* Get the default values for the given %%types
|
|
102
|
+
* Get the default values for the given %%types%%
|
|
103
103
|
*
|
|
104
104
|
* For example, a ``uint`` is by default ``0`` and ``bool``
|
|
105
|
-
* is by default ``false
|
|
105
|
+
* is by default ``false``
|
|
106
106
|
*/
|
|
107
107
|
getDefaultValue(types: ReadonlyArray<string | ParamType>): Result {
|
|
108
108
|
const coders: Array<Coder> = types.map((type) => this.#getCoder(ParamType.from(type)));
|
|
@@ -111,7 +111,7 @@ export class AbiCoder {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* Encode the %%values%% as the %%types%% into ABI data
|
|
114
|
+
* Encode the %%values%% as the %%types%% into ABI data
|
|
115
115
|
*
|
|
116
116
|
* @returns DataHexstring
|
|
117
117
|
*/
|
|
@@ -125,7 +125,7 @@ export class AbiCoder {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
* Encode the %%values%% as the %%types%% into ABI data
|
|
128
|
+
* Encode the %%values%% as the %%types%% into ABI data
|
|
129
129
|
*
|
|
130
130
|
* @returns DataHexstring
|
|
131
131
|
*/
|
|
@@ -141,11 +141,11 @@ export class AbiCoder {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Decode the ABI %%data%% as the %%types%% into values
|
|
144
|
+
* Decode the ABI %%data%% as the %%types%% into values
|
|
145
145
|
*
|
|
146
146
|
* If %%loose%% decoding is enabled, then strict padding is
|
|
147
147
|
* not enforced. Some older versions of Solidity incorrectly
|
|
148
|
-
* padded event data emitted from ``external`` functions
|
|
148
|
+
* padded event data emitted from ``external`` functions
|
|
149
149
|
*/
|
|
150
150
|
decode(types: ReadonlyArray<string | ParamType | TAbiInput>, hex: string, opts?: {
|
|
151
151
|
loose?: boolean
|
|
@@ -172,9 +172,9 @@ export class AbiCoder {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
|
-
* Returns the shared singleton instance of a default [[AbiCoder]]
|
|
175
|
+
* Returns the shared singleton instance of a default [[AbiCoder]]
|
|
176
176
|
*
|
|
177
|
-
* On the first call, the instance is created internally
|
|
177
|
+
* On the first call, the instance is created internally
|
|
178
178
|
*/
|
|
179
179
|
static defaultAbiCoder(): AbiCoder {
|
|
180
180
|
if (defaultCoder == null) {
|
|
@@ -8,14 +8,14 @@ import { $require } from '@dequanto/utils/$require';
|
|
|
8
8
|
export const WordSize: number = 32;
|
|
9
9
|
const Padding = new Uint8Array(WordSize);
|
|
10
10
|
|
|
11
|
-
// Properties used to
|
|
12
|
-
// - `then` is used to detect
|
|
11
|
+
// Properties used to immediately pass through to the underlying object
|
|
12
|
+
// - `then` is used to detect whether an object is a Promise for await
|
|
13
13
|
const passProperties = [ "then" ];
|
|
14
14
|
|
|
15
15
|
const _guard = { };
|
|
16
16
|
|
|
17
17
|
function throwError(name: string, error: Error): never {
|
|
18
|
-
const wrapped = new Error(`
|
|
18
|
+
const wrapped = new Error(`Deferred error during ABI decoding was triggered by accessing ${ name }`);
|
|
19
19
|
(<any>wrapped).error = error;
|
|
20
20
|
throw wrapped;
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ function throwError(name: string, error: Error): never {
|
|
|
23
23
|
/**
|
|
24
24
|
* A [[Result]] is a sub-class of Array, which allows accessing any
|
|
25
25
|
* of its values either positionally by its index or, if keys are
|
|
26
|
-
* provided by its name
|
|
26
|
+
* provided by its name
|
|
27
27
|
*
|
|
28
28
|
* @_docloc: api/abi
|
|
29
29
|
*/
|
|
@@ -36,7 +36,7 @@ export class Result extends Array<any> {
|
|
|
36
36
|
* @private
|
|
37
37
|
*/
|
|
38
38
|
constructor(...args: Array<any>) {
|
|
39
|
-
// To properly
|
|
39
|
+
// To properly subclass Array so the other built-in
|
|
40
40
|
// functions work, the constructor has to behave fairly
|
|
41
41
|
// well. So, in the event we are created via fromItems()
|
|
42
42
|
// we build the read-only Result object we want, but on
|
|
@@ -54,8 +54,8 @@ export class Result extends Array<any> {
|
|
|
54
54
|
wrap = false;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
//
|
|
58
|
-
// is a special case in the super
|
|
57
|
+
// Cannot just pass in ...items because an array of length 1
|
|
58
|
+
// is a special case in the super
|
|
59
59
|
super(items.length);
|
|
60
60
|
items.forEach((item, index) => { this[index] = item; });
|
|
61
61
|
|
|
@@ -67,7 +67,7 @@ export class Result extends Array<any> {
|
|
|
67
67
|
return accum;
|
|
68
68
|
}, <Map<string, number>>(new Map()));
|
|
69
69
|
|
|
70
|
-
// Remove any key
|
|
70
|
+
// Remove any key that is not unique
|
|
71
71
|
this.#names = Object.freeze(items.map((item, index) => {
|
|
72
72
|
const name = names[index];
|
|
73
73
|
if (name != null && nameCounts.get(name) === 1) {
|
|
@@ -125,10 +125,10 @@ export class Result extends Array<any> {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
* Returns the Result as a normal Array
|
|
128
|
+
* Returns the Result as a normal Array
|
|
129
129
|
*
|
|
130
|
-
* This
|
|
131
|
-
* errors
|
|
130
|
+
* This throws if there are any outstanding deferred
|
|
131
|
+
* errors
|
|
132
132
|
*/
|
|
133
133
|
toArray(): Array<any> {
|
|
134
134
|
const result: Array<any> = [ ];
|
|
@@ -140,16 +140,16 @@ export class Result extends Array<any> {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* Returns the Result as an Object with each name-value pair
|
|
143
|
+
* Returns the Result as an Object with each name-value pair
|
|
144
144
|
*
|
|
145
|
-
* This
|
|
146
|
-
* any outstanding deferred errors
|
|
145
|
+
* This throws if any value is unnamed, or if there are
|
|
146
|
+
* any outstanding deferred errors
|
|
147
147
|
*/
|
|
148
148
|
toObject(): Record<string, any> {
|
|
149
149
|
return this.#names.reduce((accum, name, index) => {
|
|
150
150
|
$require.notNull(name, `UNSUPPORTED_OPERATION: value at index ${ index } unnamed`);
|
|
151
151
|
|
|
152
|
-
// Add values for names that
|
|
152
|
+
// Add values for names that do not conflict
|
|
153
153
|
if (!(name in accum)) {
|
|
154
154
|
accum[name] = this.getValue(name);
|
|
155
155
|
}
|
|
@@ -223,12 +223,12 @@ export class Result extends Array<any> {
|
|
|
223
223
|
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* Returns the value for %%name
|
|
226
|
+
* Returns the value for %%name%%
|
|
227
227
|
*
|
|
228
228
|
* Since it is possible to have a key whose name conflicts with
|
|
229
229
|
* a method on a [[Result]] or its superclass Array, or any
|
|
230
230
|
* JavaScript keyword, this ensures all named values are still
|
|
231
|
-
* accessible by name
|
|
231
|
+
* accessible by name
|
|
232
232
|
*/
|
|
233
233
|
getValue(name: string): any {
|
|
234
234
|
const index = this.#names.indexOf(name);
|
|
@@ -245,7 +245,7 @@ export class Result extends Array<any> {
|
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
247
|
* Creates a new [[Result]] for %%items%% with each entry
|
|
248
|
-
* also accessible by its corresponding name in %%keys
|
|
248
|
+
* also accessible by its corresponding name in %%keys%%
|
|
249
249
|
*/
|
|
250
250
|
static fromItems(items: Array<any>, keys?: Array<null | string>): Result {
|
|
251
251
|
return new Result(_guard, items, keys);
|
|
@@ -253,20 +253,20 @@ export class Result extends Array<any> {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* Returns all errors found in a [[Result]]
|
|
256
|
+
* Returns all errors found in a [[Result]]
|
|
257
257
|
*
|
|
258
258
|
* Since certain errors encountered when creating a [[Result]] do
|
|
259
259
|
* not impact the ability to continue parsing data, they are
|
|
260
260
|
* deferred until they are actually accessed. Hence a faulty string
|
|
261
|
-
* in an Event that is never used does not impact the program flow
|
|
261
|
+
* in an Event that is never used does not impact the program flow
|
|
262
262
|
*
|
|
263
|
-
* However, sometimes it may be useful to access, identify or
|
|
264
|
-
* validate correctness of a [[Result]]
|
|
263
|
+
* However, sometimes it may be useful to access, identify, or
|
|
264
|
+
* validate correctness of a [[Result]]
|
|
265
265
|
*
|
|
266
266
|
* @_docloc api/abi
|
|
267
267
|
*/
|
|
268
268
|
export function checkResultErrors(result: Result): Array<{ path: Array<string | number>, error: Error }> {
|
|
269
|
-
// Find the first error
|
|
269
|
+
// Find the first error, if any
|
|
270
270
|
const errors: Array<{ path: Array<string | number>, error: Error }> = [ ];
|
|
271
271
|
|
|
272
272
|
const checkErrors = function(path: Array<string | number>, object: any): void {
|
|
@@ -306,11 +306,11 @@ function getValue(value: bigint): Uint8Array {
|
|
|
306
306
|
export abstract class Coder {
|
|
307
307
|
|
|
308
308
|
// The coder name:
|
|
309
|
-
// - address, uint256, tuple, array, etc
|
|
309
|
+
// - address, uint256, tuple, array, etc
|
|
310
310
|
readonly name!: string;
|
|
311
311
|
|
|
312
312
|
// The fully expanded type, including composite types:
|
|
313
|
-
// - address, uint256, tuple(address,bytes), uint256[3][4][], etc
|
|
313
|
+
// - address, uint256, tuple(address,bytes), uint256[3][4][], etc
|
|
314
314
|
readonly type!: string;
|
|
315
315
|
|
|
316
316
|
// The localName bound in the signature, in this example it is "baz":
|
|
@@ -318,7 +318,7 @@ export abstract class Coder {
|
|
|
318
318
|
readonly localName!: string;
|
|
319
319
|
|
|
320
320
|
// Whether this type is dynamic:
|
|
321
|
-
// - Dynamic: bytes, string, address[], tuple(boolean[]), etc
|
|
321
|
+
// - Dynamic: bytes, string, address[], tuple(boolean[]), etc
|
|
322
322
|
// - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)
|
|
323
323
|
readonly dynamic!: boolean;
|
|
324
324
|
|
|
@@ -343,7 +343,7 @@ export abstract class Coder {
|
|
|
343
343
|
* @_ignore
|
|
344
344
|
*/
|
|
345
345
|
export class Writer {
|
|
346
|
-
// An array of WordSize
|
|
346
|
+
// An array of WordSize-length objects to concatenate
|
|
347
347
|
#data: Array<Uint8Array>;
|
|
348
348
|
#dataLength: number;
|
|
349
349
|
|
|
@@ -367,7 +367,7 @@ export class Writer {
|
|
|
367
367
|
return this.#writeData($buffer.ensure(writer.data));
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
//
|
|
370
|
+
// Array-like item; pad on the right to the *nearest* WordSize
|
|
371
371
|
writeBytes(value: Uint8Array): number {
|
|
372
372
|
let bytes = value;
|
|
373
373
|
const paddingOffset = bytes.length % WordSize;
|
|
@@ -382,8 +382,8 @@ export class Writer {
|
|
|
382
382
|
return this.#writeData(getValue(value));
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
// Inserts a numeric
|
|
386
|
-
// be used to
|
|
385
|
+
// Inserts a numeric placeholder, returning a callback that can
|
|
386
|
+
// be used to adjust the value later
|
|
387
387
|
writeUpdatableValue(): (value: bigint) => void {
|
|
388
388
|
const offset = this.#data.length;
|
|
389
389
|
this.#data.push(Padding);
|
|
@@ -398,10 +398,10 @@ export class Writer {
|
|
|
398
398
|
* @_ignore
|
|
399
399
|
*/
|
|
400
400
|
export class Reader {
|
|
401
|
-
// Allows incomplete unpadded data to be read; otherwise an error
|
|
401
|
+
// Allows incomplete unpadded data to be read; otherwise, an error
|
|
402
402
|
// is raised if attempting to overrun the buffer. This is required
|
|
403
403
|
// to deal with an old Solidity bug, in which event data for
|
|
404
|
-
// external (not public
|
|
404
|
+
// external (not public though) was tightly packed
|
|
405
405
|
readonly allowLoose!: boolean;
|
|
406
406
|
|
|
407
407
|
readonly #data: Uint8Array;
|
|
@@ -425,13 +425,13 @@ export class Reader {
|
|
|
425
425
|
if (this.allowLoose && loose && this.#offset + length <= this.#data.length) {
|
|
426
426
|
alignedLength = length;
|
|
427
427
|
} else {
|
|
428
|
-
throw new Error(`BUFFER_OVERRUN: data out
|
|
428
|
+
throw new Error(`BUFFER_OVERRUN: data out of bounds. Length: ${this.#data.length}; Offset: ${this.#offset}; AlignedLength: ${alignedLength};`);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
return this.#data.slice(this.#offset, this.#offset + alignedLength)
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
// Create a sub-reader with the same underlying data, but offset
|
|
434
|
+
// Create a sub-reader with the same underlying data, but with an offset
|
|
435
435
|
subReader(offset: number): Reader {
|
|
436
436
|
return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);
|
|
437
437
|
}
|
|
@@ -440,11 +440,11 @@ export class Reader {
|
|
|
440
440
|
readBytes(length: number, loose?: boolean): Uint8Array {
|
|
441
441
|
let bytes = this.#peekBytes(0, length, !!loose);
|
|
442
442
|
this.#offset += bytes.length;
|
|
443
|
-
// @TODO: Make sure the length..end bytes are all 0
|
|
443
|
+
// @TODO: Make sure the length..end bytes are all 0
|
|
444
444
|
return bytes.slice(0, length);
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
// Read a numeric
|
|
447
|
+
// Read a numeric value
|
|
448
448
|
readValue(): bigint {
|
|
449
449
|
return $buffer.toBigInt(this.readBytes(WordSize));
|
|
450
450
|
}
|