dequanto 0.2.38 → 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/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 +36 -21
- 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 +22 -22
- 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/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 +36 -21
- 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 +22 -22
- 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/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 +13 -14
- 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/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 +69 -56
- package/src/contracts/deploy/proxy/$proxyDeploy.ts +14 -14
- package/src/contracts/deploy/proxy/ProxyDeployment.ts +22 -22
- 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/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
|
@@ -53,9 +53,9 @@ export class ContractWriter implements IContractWriter {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* We split
|
|
57
|
-
* 1. This method prepares
|
|
58
|
-
* 2. With returned writer you can subscribe to events and/or wait for
|
|
56
|
+
* We split transaction sending into two awaitable steps:
|
|
57
|
+
* 1. This method prepares gas, nonce, etc., and sends the transaction.
|
|
58
|
+
* 2. With the returned writer, you can subscribe to events and/or wait for the transaction to be mined.
|
|
59
59
|
* @param account
|
|
60
60
|
* @param interfaceAbi
|
|
61
61
|
* @param params
|
|
@@ -74,7 +74,7 @@ export class ContractWriter implements IContractWriter {
|
|
|
74
74
|
): Promise<TxWriter> {
|
|
75
75
|
|
|
76
76
|
$require.notNull(account, 'Account parameter is undefined.');
|
|
77
|
-
$require.True(typeof account === 'object' || typeof account === 'string', `ContractWriter
|
|
77
|
+
$require.True(typeof account === 'object' || typeof account === 'string', `ContractWriter expects Account as the first parameter, got: ${ typeof account }`)
|
|
78
78
|
|
|
79
79
|
let value = typeof account !== 'string'
|
|
80
80
|
? account.value
|
|
@@ -87,10 +87,10 @@ export class ContractDeployer {
|
|
|
87
87
|
let artifacts = ctx.artifacts ?? './artifacts/';
|
|
88
88
|
let files = await $require.resolved(
|
|
89
89
|
Directory.readFilesAsync(artifacts, '**.json'),
|
|
90
|
-
`Artifact files not found for ${ctx.name}`
|
|
90
|
+
`Artifact files were not found for ${ctx.name}`
|
|
91
91
|
);
|
|
92
92
|
let file = files.find(x => x.uri.file === `${ctx.name}.json`);
|
|
93
|
-
$require.notNull(file, `File for
|
|
93
|
+
$require.notNull(file, `File for contract ${ctx.name} was not found in: \n ${ files.map(x => x.uri.toString()).join('\n') }`);
|
|
94
94
|
|
|
95
95
|
return this.fromMetaFile ({
|
|
96
96
|
...ctx,
|
|
@@ -129,7 +129,7 @@ export class ContractDeployer {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
private async fromMetaJson (ctx: TDeploymentByMetaJson) {
|
|
132
|
-
$require.notNull(ctx.json?.bytecode, 'Contract bytecode is expected in
|
|
132
|
+
$require.notNull(ctx.json?.bytecode, 'Contract bytecode is expected in JSON');
|
|
133
133
|
return this.fromBytecode({
|
|
134
134
|
...ctx,
|
|
135
135
|
bytecode: ctx.json.bytecode,
|
|
@@ -139,7 +139,7 @@ export class ContractDeployer {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
private async fromBytecode (ctx: TDeploymentWithBytecode) {
|
|
142
|
-
$require.True($is.Hex(ctx.bytecode), `
|
|
142
|
+
$require.True($is.Hex(ctx.bytecode), `Bytecode must be a hex string: ${ctx.bytecode}`);
|
|
143
143
|
|
|
144
144
|
let deployment = new ContractDeployment({
|
|
145
145
|
client: this.client,
|
|
@@ -27,27 +27,33 @@ import { DeploymentsStorage, IDeployment } from './storage/DeploymentsStorage';
|
|
|
27
27
|
type TDeploymentOptions = {
|
|
28
28
|
id?: string
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
// For proxy deployments: redeploys the implementation if the bytecode has not changed but the immutable arguments have changed.
|
|
31
|
+
immutablesKey?: string
|
|
32
|
+
|
|
33
|
+
// Older deployments did not have immutablesKey, so any proxy implementation with immutable variables would trigger redeployment.
|
|
34
|
+
checkImmutables?: boolean
|
|
35
|
+
|
|
36
|
+
/** Deploys the contract. */
|
|
31
37
|
force?: boolean
|
|
32
|
-
/**
|
|
38
|
+
/** Checks whether the local bytecode has changed and deploys if needed. */
|
|
33
39
|
latest?: boolean
|
|
34
40
|
|
|
35
41
|
verification?: boolean | 'silent'
|
|
36
42
|
|
|
37
|
-
//
|
|
43
|
+
// Used for the verification process.
|
|
38
44
|
proxyFor?: TAddress
|
|
39
45
|
|
|
40
46
|
deployment?: {
|
|
41
|
-
// Pending deployment transaction will be
|
|
47
|
+
// Pending deployment transaction will be rechecked.
|
|
42
48
|
tx?: TEth.Hex
|
|
43
|
-
// When false, the implementation
|
|
49
|
+
// When false, the implementation will not be updated in the proxy.
|
|
44
50
|
upgradeProxy?: boolean
|
|
45
|
-
// Owner, if
|
|
51
|
+
// Owner, if different from the deployer.
|
|
46
52
|
owner?: TEth.IAccount
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
type TVerificationOptions = TDeploymentOptions & {
|
|
50
|
-
//
|
|
56
|
+
// Otherwise, this will be fetched from the deployment transaction.
|
|
51
57
|
constructorParams?: any[]
|
|
52
58
|
}
|
|
53
59
|
|
|
@@ -79,7 +85,7 @@ export class Deployments {
|
|
|
79
85
|
Proxy?: Constructor<ContractBase>,
|
|
80
86
|
ProxyAdmin?: Constructor<IProxyAdmin>
|
|
81
87
|
directory?: string
|
|
82
|
-
//
|
|
88
|
+
// Part of the deployments filename.
|
|
83
89
|
name?: string
|
|
84
90
|
// TPlatform of a forked network
|
|
85
91
|
fork?: string
|
|
@@ -134,7 +140,7 @@ export class Deployments {
|
|
|
134
140
|
}): Promise<T> {
|
|
135
141
|
let contract = await this.getOrNull(Ctor, opts);
|
|
136
142
|
if (contract == null) {
|
|
137
|
-
throw new Error(`Deployment ${Ctor.name} ${opts?.id ?? ''} not found in ${this.client.platform} [${this.store.opts?.name ?? this.store.opts?.directory ?? ''}]`);
|
|
143
|
+
throw new Error(`Deployment ${Ctor.name} ${opts?.id ?? ''} was not found in ${this.client.platform} [${this.store.opts?.name ?? this.store.opts?.directory ?? ''}]`);
|
|
138
144
|
}
|
|
139
145
|
return contract;
|
|
140
146
|
}
|
|
@@ -160,7 +166,7 @@ export class Deployments {
|
|
|
160
166
|
}
|
|
161
167
|
|
|
162
168
|
/**
|
|
163
|
-
*
|
|
169
|
+
* Gets the deployment for Ctor, but returns the CtorWrapped instance. Useful for proxies, etc.
|
|
164
170
|
* e.g. deployments.getAs(SomeProxy, SomeImplementation);
|
|
165
171
|
*/
|
|
166
172
|
async getAs<TDeployed extends ContractBase, TWrapped extends ContractBase>(Ctor: Constructor<TDeployed>, CtorWrapped: Constructor<TWrapped>, opts?: {
|
|
@@ -181,7 +187,7 @@ export class Deployments {
|
|
|
181
187
|
let deployment = await this.store.getDeploymentInfo('', {
|
|
182
188
|
id: params.id
|
|
183
189
|
});
|
|
184
|
-
$require.notNull(deployment, `Deployment for ${params.id} not found`);
|
|
190
|
+
$require.notNull(deployment, `Deployment for ${params.id} was not found`);
|
|
185
191
|
await this.ensureVerification(params.Ctor, deployment, {
|
|
186
192
|
id: params.id,
|
|
187
193
|
constructorParams: params.constructorParams,
|
|
@@ -215,8 +221,14 @@ export class Deployments {
|
|
|
215
221
|
? (this.client.platform === 'hardhat' || this.opts?.checkBytecode !== false)
|
|
216
222
|
: (opts.latest);
|
|
217
223
|
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
/** For backward compatibility:
|
|
225
|
+
* For older deployments, the deployer should set this if immutablesKey is not present in the deployed state. */
|
|
226
|
+
let hasNewImmutables = opts.checkImmutables === true
|
|
227
|
+
? Boolean(currentDeployment.immutablesKey != opts.immutablesKey)
|
|
228
|
+
: Boolean(currentDeployment.immutablesKey && currentDeployment.immutablesKey != opts.immutablesKey);
|
|
229
|
+
|
|
230
|
+
if (opts.force !== true && requireLatest !== true && hasNewImmutables !== true) {
|
|
231
|
+
// Return the already deployed contract.
|
|
220
232
|
$contract.store.register(contract as any);
|
|
221
233
|
return {
|
|
222
234
|
contract,
|
|
@@ -224,9 +236,9 @@ export class Deployments {
|
|
|
224
236
|
};
|
|
225
237
|
}
|
|
226
238
|
if (requireLatest === true && opts.force !== true) {
|
|
227
|
-
// was already deployed. Check new bytecode hash
|
|
239
|
+
// The contract was already deployed. Check the new bytecode hash.
|
|
228
240
|
let isSame = await this.isSameBytecode(Ctor, currentDeployment);
|
|
229
|
-
if (isSame) {
|
|
241
|
+
if (isSame && hasNewImmutables !== true) {
|
|
230
242
|
$contract.store.register(contract as any);
|
|
231
243
|
return {
|
|
232
244
|
contract,
|
|
@@ -250,7 +262,7 @@ export class Deployments {
|
|
|
250
262
|
|
|
251
263
|
|
|
252
264
|
|
|
253
|
-
//
|
|
265
|
+
// Deploy the contract: new, forced, or latest.
|
|
254
266
|
|
|
255
267
|
let constructorArgs = opts.arguments ?? [];
|
|
256
268
|
let id = opts.id ?? Ctor.name;
|
|
@@ -270,6 +282,7 @@ export class Deployments {
|
|
|
270
282
|
let deployment = await this.store.saveDeployment(deployedContract, {
|
|
271
283
|
id,
|
|
272
284
|
name: Ctor.name,
|
|
285
|
+
immutablesKey: opts.immutablesKey,
|
|
273
286
|
bytecodeHash: this.getBytecodeHash(deployedBytecode)
|
|
274
287
|
}, receipt);
|
|
275
288
|
|
|
@@ -285,14 +298,11 @@ export class Deployments {
|
|
|
285
298
|
};
|
|
286
299
|
}
|
|
287
300
|
|
|
288
|
-
async ensureWithProxy<
|
|
289
|
-
T extends (TContract & TInitializers<TInit>),
|
|
290
|
-
TInit extends TFunction
|
|
291
|
-
>(
|
|
301
|
+
async ensureWithProxy<T extends TContract>(
|
|
292
302
|
CtorImpl: Constructor<T>,
|
|
293
303
|
opts?: TConstructorArgs<T> & TDeploymentOptions & TInitializerParams<T>
|
|
294
304
|
): Promise<{
|
|
295
|
-
//
|
|
305
|
+
// The implementation contract with the address set to the proxy.
|
|
296
306
|
contract: T
|
|
297
307
|
contractReceipt?: TEth.TxReceipt
|
|
298
308
|
contractProxy: IProxy,
|
|
@@ -304,6 +314,7 @@ export class Deployments {
|
|
|
304
314
|
|
|
305
315
|
let id = opts?.id ?? getImplementationId(CtorImpl);
|
|
306
316
|
let proxyId = `${id}Proxy`;
|
|
317
|
+
let immutablesKey = getImmutablesKey(opts?.arguments);
|
|
307
318
|
|
|
308
319
|
let {
|
|
309
320
|
contract: contractImpl,
|
|
@@ -312,6 +323,7 @@ export class Deployments {
|
|
|
312
323
|
} = await this.ensure(CtorImpl, {
|
|
313
324
|
arguments: opts?.arguments as any,
|
|
314
325
|
id: id,
|
|
326
|
+
immutablesKey,
|
|
315
327
|
force: opts?.force,
|
|
316
328
|
latest: this.opts?.checkBytecode !== false,
|
|
317
329
|
verification: opts?.verification,
|
|
@@ -342,7 +354,7 @@ export class Deployments {
|
|
|
342
354
|
})
|
|
343
355
|
|
|
344
356
|
if (contractImplDeployment.implementation == null) {
|
|
345
|
-
// Set the
|
|
357
|
+
// Set the proxy contract as the main address.
|
|
346
358
|
contractImplDeployment.implementation = contractImplDeployment.address;
|
|
347
359
|
contractImplDeployment.address = contractProxy.address;
|
|
348
360
|
|
|
@@ -364,7 +376,7 @@ export class Deployments {
|
|
|
364
376
|
}
|
|
365
377
|
|
|
366
378
|
/**
|
|
367
|
-
* Deploys the Beacon contract.
|
|
379
|
+
* Deploys the Beacon contract. The implementation is the target contract (can be a proxy or normal contract).
|
|
368
380
|
* https://docs.openzeppelin.com/contracts/5.x/api/proxy#beacon
|
|
369
381
|
**/
|
|
370
382
|
async ensureWithBeacon<
|
|
@@ -378,7 +390,7 @@ export class Deployments {
|
|
|
378
390
|
initialize?: ParametersFromSecond<T['initialize']>
|
|
379
391
|
}
|
|
380
392
|
): Promise<{
|
|
381
|
-
//
|
|
393
|
+
// The implementation contract with the address set to the Beacon proxy.
|
|
382
394
|
contract: T
|
|
383
395
|
contractReceipt?: TEth.TxReceipt
|
|
384
396
|
contractDeployment: IDeployment
|
|
@@ -389,7 +401,7 @@ export class Deployments {
|
|
|
389
401
|
contractBeaconProxyDeployment: IDeployment
|
|
390
402
|
}> {
|
|
391
403
|
|
|
392
|
-
$require.notEmpty(opts?.id, `ID is required for Beacon deployment, as
|
|
404
|
+
$require.notEmpty(opts?.id, `ID is required for Beacon deployment, as the implementation can have multiple Beacons`);
|
|
393
405
|
|
|
394
406
|
let beaconProxyId = opts.id;
|
|
395
407
|
let implId = beaconProxyId.includes('/')
|
|
@@ -426,7 +438,7 @@ export class Deployments {
|
|
|
426
438
|
implementation: {
|
|
427
439
|
address: implementationAddress,
|
|
428
440
|
initData: data,
|
|
429
|
-
// @TODO
|
|
441
|
+
// @TODO Implement migrations for Beacons.
|
|
430
442
|
migrationData: null
|
|
431
443
|
}
|
|
432
444
|
});
|
|
@@ -462,7 +474,7 @@ export class Deployments {
|
|
|
462
474
|
return true;
|
|
463
475
|
}
|
|
464
476
|
|
|
465
|
-
//
|
|
477
|
+
// Recheck v1.
|
|
466
478
|
if (deployment.bytecodeHash != null) {
|
|
467
479
|
let address = deployment.implementation ?? deployment.address;
|
|
468
480
|
let bytecode = await this.client.getCode(address);
|
|
@@ -480,8 +492,8 @@ export class Deployments {
|
|
|
480
492
|
let [ localDiff, onchainDiff ] = Str.getDifference(bytecodeLocal, bytecodeOnchain);
|
|
481
493
|
if (localDiff === '' || /^0+$/.test(localDiff)) {
|
|
482
494
|
this._logger.log(`${deployment.id} bytecode has only immutable data diff, assume unchanged`);
|
|
483
|
-
// Local deployedBytecode
|
|
484
|
-
//
|
|
495
|
+
// Local deployedBytecode does not contain immutable data.
|
|
496
|
+
// Instead, solc generates bytecode with 0 as the placeholder.
|
|
485
497
|
return true;
|
|
486
498
|
}
|
|
487
499
|
}
|
|
@@ -558,19 +570,19 @@ export class Deployments {
|
|
|
558
570
|
|
|
559
571
|
|
|
560
572
|
/**
|
|
561
|
-
* A simple method to configure
|
|
573
|
+
* A simple method to configure contract state.
|
|
562
574
|
*/
|
|
563
575
|
public async configure<T extends TContract, TValue>(Ctor: Constructor<T> | T, opts: {
|
|
564
576
|
id?: string;
|
|
565
577
|
|
|
566
|
-
// Latest value
|
|
578
|
+
// Latest value. If it differs from current, the updater will be executed.
|
|
567
579
|
value?: TValue
|
|
568
580
|
// Current value.
|
|
569
581
|
current?: TValue | Promise<TValue> | ((x: T) => Promise<TValue>);
|
|
570
582
|
shouldUpdate?: boolean | (() => boolean | Promise<boolean>)
|
|
571
583
|
updater: (x: T, value: TValue) => Promise<any>
|
|
572
584
|
|
|
573
|
-
//
|
|
585
|
+
// Logged with the old and new values.
|
|
574
586
|
title?: string
|
|
575
587
|
}) {
|
|
576
588
|
let x: T;
|
|
@@ -612,27 +624,19 @@ export class Deployments {
|
|
|
612
624
|
}
|
|
613
625
|
}
|
|
614
626
|
|
|
615
|
-
|
|
616
|
-
type
|
|
617
|
-
type
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
? ParametersFromSecond<T['initialize']>
|
|
624
|
-
: never
|
|
625
|
-
initializeV2?: T['initializeV2'] extends TFunction
|
|
626
|
-
? ParametersFromSecond<T['initializeV2']>
|
|
627
|
-
: never
|
|
628
|
-
initializeV3?: T['initializeV3'] extends TFunction
|
|
629
|
-
? ParametersFromSecond<T['initializeV3']>
|
|
630
|
-
: never
|
|
627
|
+
type TFunction = (...args: any[]) => any;
|
|
628
|
+
type TInitializerName = 'initialize' | `initializeV${number}`;
|
|
629
|
+
type TInitializerParams<T> = {
|
|
630
|
+
initialize?: T extends { initialize: infer TInit }
|
|
631
|
+
? TInit extends TFunction
|
|
632
|
+
? ParametersFromSecond<TInit>
|
|
633
|
+
: never
|
|
634
|
+
: any[];
|
|
631
635
|
} & {
|
|
632
|
-
[K in Extract<keyof T,
|
|
636
|
+
[K in Extract<keyof T, TInitializerName>]?: T[K] extends TFunction
|
|
633
637
|
? ParametersFromSecond<T[K]>
|
|
634
|
-
:
|
|
635
|
-
}
|
|
638
|
+
: never;
|
|
639
|
+
};
|
|
636
640
|
|
|
637
641
|
type TContract = ContractBase & { $constructor?: (...args: any[]) => any }
|
|
638
642
|
type TConstructorArgs<T extends TContract> = T['$constructor'] extends Function ? {
|
|
@@ -658,7 +662,7 @@ function isEqual(a, b) {
|
|
|
658
662
|
// Not strictly equal
|
|
659
663
|
return a == b;
|
|
660
664
|
}
|
|
661
|
-
//
|
|
665
|
+
// Check arrays.
|
|
662
666
|
if (Array.isArray(a) || Array.isArray(b)) {
|
|
663
667
|
if (a.length !== b.length) {
|
|
664
668
|
return false;
|
|
@@ -667,7 +671,7 @@ function isEqual(a, b) {
|
|
|
667
671
|
return isEqual(x, b[i]);
|
|
668
672
|
});
|
|
669
673
|
}
|
|
670
|
-
//
|
|
674
|
+
// Check objects.
|
|
671
675
|
for (let key in a) {
|
|
672
676
|
let aValue = a[key];
|
|
673
677
|
let bValue = b[key];
|
|
@@ -677,7 +681,7 @@ function isEqual(a, b) {
|
|
|
677
681
|
}
|
|
678
682
|
for (let key in b) {
|
|
679
683
|
if (key in a === false && b[key] != null) {
|
|
680
|
-
//
|
|
684
|
+
// Value is present in b, but not in a.
|
|
681
685
|
return false;
|
|
682
686
|
}
|
|
683
687
|
}
|
|
@@ -723,8 +727,8 @@ function serializeMigrationData(id: string, contract: ContractBase, opts: any) {
|
|
|
723
727
|
|
|
724
728
|
|
|
725
729
|
/**
|
|
726
|
-
*
|
|
727
|
-
* "FooV1" is actually the "Foo" contract
|
|
730
|
+
* Normalizes the contract name by removing any version suffix from the name.
|
|
731
|
+
* "FooV1" is actually the "Foo" contract.
|
|
728
732
|
*/
|
|
729
733
|
function getImplementationId (Ctor: Constructor<TContract>) {
|
|
730
734
|
let id = Ctor.name;
|
|
@@ -735,6 +739,15 @@ function getImplementationId (Ctor: Constructor<TContract>) {
|
|
|
735
739
|
return id;
|
|
736
740
|
}
|
|
737
741
|
|
|
742
|
+
|
|
743
|
+
function getImmutablesKey (args: any[]) {
|
|
744
|
+
if (args == null || args.length === 0) {
|
|
745
|
+
return null;
|
|
746
|
+
}
|
|
747
|
+
let key = args.map(arg => `${arg?.toString()}`).join('-');
|
|
748
|
+
return key;
|
|
749
|
+
}
|
|
750
|
+
|
|
738
751
|
namespace Str {
|
|
739
752
|
export function getDifference (a: TEth.Hex, b: TEth.Hex) {
|
|
740
753
|
if (a === b) {
|
|
@@ -20,7 +20,7 @@ export namespace $proxyDeploy {
|
|
|
20
20
|
variable: result.newVar,
|
|
21
21
|
path: serializePath(result.newPath, result.newVar),
|
|
22
22
|
conflicts: result.conflicts,
|
|
23
|
-
message: `${result.type}: Variable ${serializePath(result.newPath, result.newVar)}(${result.newVar.type}) at slot ${result.newVar.slot} conflicts ${conflicts}`
|
|
23
|
+
message: `${result.type}: Variable ${serializePath(result.newPath, result.newVar)}(${result.newVar.type}) at slot ${result.newVar.slot} conflicts with ${conflicts}`
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
return null;
|
|
@@ -34,15 +34,15 @@ export namespace $proxyDeploy {
|
|
|
34
34
|
|
|
35
35
|
ctx ??= {};
|
|
36
36
|
|
|
37
|
-
// When resolving state variables
|
|
38
|
-
//
|
|
37
|
+
// When resolving state variables, we append '$' characters to overridden variables to avoid name conflicts.
|
|
38
|
+
// Also check for __gap with a possible '$' suffix.
|
|
39
39
|
let rgxGap = /^_+gap\$*$/;
|
|
40
40
|
let oldMemory = oldVars.map(getMemoryPosition);
|
|
41
41
|
let oldLastSlot = alot(oldVars).max(x => x.slot);
|
|
42
42
|
for (let i = 0; i < newVars.length; i++) {
|
|
43
43
|
let newVar = newVars[i];
|
|
44
44
|
if (newVar.slot > oldLastSlot) {
|
|
45
|
-
//
|
|
45
|
+
// A new variable was added after the last slot in the current deployment.
|
|
46
46
|
if (ctx.isExtendableMemory === false) {
|
|
47
47
|
return new BaseError(
|
|
48
48
|
ELayoutError.MEMORY_OVERFLOW,
|
|
@@ -52,8 +52,8 @@ export namespace $proxyDeploy {
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
// Find the new variable name in old storage
|
|
56
|
-
// Exclude
|
|
55
|
+
// Find the new variable name in old storage.
|
|
56
|
+
// Exclude variables at the same position, as they might be pushed logically down by the __gap pattern.
|
|
57
57
|
let oldVarWithName = oldVars.find(x => x.name === newVar.name);
|
|
58
58
|
if (oldVarWithName != null && !Variables.eqLocation(oldVarWithName, newVar) && !rgxGap.test(newVar.name)) {
|
|
59
59
|
return new BaseError(
|
|
@@ -69,7 +69,7 @@ export namespace $proxyDeploy {
|
|
|
69
69
|
let oldVarAtSamePos = oldVars.find(x => x.slot === newVar.slot && x.position === newVar.position);
|
|
70
70
|
if (oldVarAtSamePos != null) {
|
|
71
71
|
if (oldVarAtSamePos.type === newVar.type) {
|
|
72
|
-
//
|
|
72
|
+
// The new variable is the same.
|
|
73
73
|
if (oldVarAtSamePos.name !== newVar.name) {
|
|
74
74
|
let oldVarWithName = oldVars.find(x => x.name === newVar.name);
|
|
75
75
|
if (oldVarWithName != null) {
|
|
@@ -229,7 +229,7 @@ export namespace $proxyDeploy {
|
|
|
229
229
|
newPath?: string
|
|
230
230
|
oldPath?: string
|
|
231
231
|
|
|
232
|
-
//
|
|
232
|
+
// Root storage is extendable, but when comparing base array types or structs, memory is limited by outer next-variable slots.
|
|
233
233
|
isExtendableMemory?: boolean
|
|
234
234
|
|
|
235
235
|
isLastVariable?: boolean
|
|
@@ -239,13 +239,13 @@ export namespace $proxyDeploy {
|
|
|
239
239
|
TYPE_MISMATCH = 'TYPE_MISMATCH',
|
|
240
240
|
TYPE_COLLISION = 'TYPE_COLLISION',
|
|
241
241
|
|
|
242
|
-
/**
|
|
242
|
+
/** Throws an error if memory is not extendable. */
|
|
243
243
|
ARRAY_LENGTH_MISMATCH = 'ARRAY_LENGTH_MISMATCH',
|
|
244
244
|
|
|
245
|
-
/**
|
|
245
|
+
/** In arrays, memory for a single item is not extendable, but it is extendable in contract root storage or mapping values. */
|
|
246
246
|
MEMORY_OVERFLOW = 'MEMORY_OVERFLOW',
|
|
247
247
|
|
|
248
|
-
/** Variables on same slot with different names (rename possible)
|
|
248
|
+
/** Variables on the same slot with different names (rename possible), while the same variable also exists in the old layout on a different slot. */
|
|
249
249
|
NAME_MISMATCH = 'NAME_MISMATCH'
|
|
250
250
|
}
|
|
251
251
|
class BaseError {
|
|
@@ -274,7 +274,7 @@ export namespace $proxyDeploy {
|
|
|
274
274
|
|
|
275
275
|
function getMemoryPosition ($var: ISlotVarDefinition) {
|
|
276
276
|
if (isDynamicVariable($var)) {
|
|
277
|
-
//
|
|
277
|
+
// Dynamic variables occupy a single slot.
|
|
278
278
|
return {
|
|
279
279
|
variable: $var,
|
|
280
280
|
offset: $var.slot * 256,
|
|
@@ -300,12 +300,12 @@ export namespace $proxyDeploy {
|
|
|
300
300
|
function requireBoth (a: ISlotVarDefinition, b: ISlotVarDefinition, aCheck: boolean, bCheck: boolean) {
|
|
301
301
|
if (!aCheck) {
|
|
302
302
|
return {
|
|
303
|
-
error: `Current variable
|
|
303
|
+
error: `Current variable ${a.name}(${a.type}) is not dynamic, but the new one is: ${b.name}(${b.type})`
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
if (!bCheck) {
|
|
307
307
|
return {
|
|
308
|
-
error: `Current variable
|
|
308
|
+
error: `Current variable ${a.name}(${a.type}) is dynamic, but the new one is not: ${b.name}(${b.type})`
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
}
|