dequanto 0.0.1 → 0.0.7
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/.circleci/config.yml +28 -0
- package/actions/contracts.act.ts +50 -0
- package/actions/logs.act.ts +7 -0
- package/actions/safe.act.ts +7 -0
- package/actions/tokens.act.ts +20 -2
- package/configs/defi.yml +24 -0
- package/configs/dequanto.yml +49 -2
- package/contracts/abi/gnosis/GnosisSafe.json +979 -0
- package/contracts/gen/base/{ERC20Base.ts → ERC20Base/ERC20Base.ts} +136 -90
- package/contracts/gen/eth/WETHBase.ts +35 -35
- package/contracts/gnosis/GnosisSafe.ts +750 -0
- package/contracts/openzeppelin/AccessControl.json +206 -0
- package/contracts/openzeppelin/AccessControl.ts +236 -0
- package/contracts/openzeppelin/AccessControlCrossChain.json +219 -0
- package/contracts/openzeppelin/AccessControlCrossChain.ts +247 -0
- package/contracts/openzeppelin/AccessControlEnumerable.json +249 -0
- package/contracts/openzeppelin/AccessControlEnumerable.ts +258 -0
- package/contracts/openzeppelin/Address.json +1 -0
- package/contracts/openzeppelin/Address.ts +83 -0
- package/contracts/openzeppelin/Arrays.json +1 -0
- package/contracts/openzeppelin/Arrays.ts +83 -0
- package/contracts/openzeppelin/Base64.json +1 -0
- package/contracts/openzeppelin/Base64.ts +83 -0
- package/contracts/openzeppelin/BeaconProxy.json +71 -0
- package/contracts/openzeppelin/BeaconProxy.ts +163 -0
- package/contracts/openzeppelin/BitMaps.json +1 -0
- package/contracts/openzeppelin/BitMaps.ts +83 -0
- package/contracts/openzeppelin/Checkpoints.json +1 -0
- package/contracts/openzeppelin/Checkpoints.ts +83 -0
- package/contracts/openzeppelin/Clones.json +1 -0
- package/contracts/openzeppelin/Clones.ts +83 -0
- package/contracts/openzeppelin/ConditionalEscrow.json +156 -0
- package/contracts/openzeppelin/ConditionalEscrow.ts +236 -0
- package/contracts/openzeppelin/Context.json +1 -0
- package/contracts/openzeppelin/Context.ts +83 -0
- package/contracts/openzeppelin/Counters.json +1 -0
- package/contracts/openzeppelin/Counters.ts +83 -0
- package/contracts/openzeppelin/Create2.json +1 -0
- package/contracts/openzeppelin/Create2.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabled.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabled.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledAMB.json +13 -0
- package/contracts/openzeppelin/CrossChainEnabledAMB.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL1.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL1.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL2.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL2.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledOptimism.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabledOptimism.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledPolygonChild.json +30 -0
- package/contracts/openzeppelin/CrossChainEnabledPolygonChild.ts +90 -0
- package/contracts/openzeppelin/DoubleEndedQueue.json +12 -0
- package/contracts/openzeppelin/DoubleEndedQueue.ts +83 -0
- package/contracts/openzeppelin/ECDSA.json +1 -0
- package/contracts/openzeppelin/ECDSA.ts +83 -0
- package/contracts/openzeppelin/EIP712.json +1 -0
- package/contracts/openzeppelin/EIP712.ts +83 -0
- package/contracts/openzeppelin/ERC1155.json +325 -0
- package/contracts/openzeppelin/ERC1155.ts +276 -0
- package/contracts/openzeppelin/ERC1155Burnable.json +360 -0
- package/contracts/openzeppelin/ERC1155Burnable.ts +298 -0
- package/contracts/openzeppelin/ERC1155Holder.json +99 -0
- package/contracts/openzeppelin/ERC1155Holder.ts +112 -0
- package/contracts/openzeppelin/ERC1155Pausable.json +353 -0
- package/contracts/openzeppelin/ERC1155Pausable.ts +345 -0
- package/contracts/openzeppelin/ERC1155PresetMinterPauser.json +734 -0
- package/contracts/openzeppelin/ERC1155PresetMinterPauser.ts +608 -0
- package/contracts/openzeppelin/ERC1155Receiver.json +99 -0
- package/contracts/openzeppelin/ERC1155Receiver.ts +112 -0
- package/contracts/openzeppelin/ERC1155Supply.json +352 -0
- package/contracts/openzeppelin/ERC1155Supply.ts +298 -0
- package/contracts/openzeppelin/ERC1155URIStorage.json +314 -0
- package/contracts/openzeppelin/ERC1155URIStorage.ts +276 -0
- package/contracts/openzeppelin/ERC165.json +21 -0
- package/contracts/openzeppelin/ERC165.ts +90 -0
- package/contracts/openzeppelin/ERC165Checker.json +1 -0
- package/contracts/openzeppelin/ERC165Checker.ts +83 -0
- package/contracts/openzeppelin/ERC165Storage.json +21 -0
- package/contracts/openzeppelin/ERC165Storage.ts +90 -0
- package/contracts/openzeppelin/ERC1820Implementer.json +26 -0
- package/contracts/openzeppelin/ERC1820Implementer.ts +90 -0
- package/contracts/openzeppelin/ERC1967Proxy.json +71 -0
- package/contracts/openzeppelin/ERC1967Proxy.ts +163 -0
- package/contracts/openzeppelin/ERC1967Upgrade.json +47 -0
- package/contracts/openzeppelin/ERC1967Upgrade.ts +163 -0
- package/contracts/openzeppelin/ERC20.json +288 -0
- package/contracts/openzeppelin/ERC20.ts +251 -0
- package/contracts/openzeppelin/ERC20Burnable.json +303 -0
- package/contracts/openzeppelin/ERC20Burnable.ts +273 -0
- package/contracts/openzeppelin/ERC20Capped.json +285 -0
- package/contracts/openzeppelin/ERC20Capped.ts +262 -0
- package/contracts/openzeppelin/ERC20FlashMint.json +349 -0
- package/contracts/openzeppelin/ERC20FlashMint.ts +284 -0
- package/contracts/openzeppelin/ERC20Pausable.json +311 -0
- package/contracts/openzeppelin/ERC20Pausable.ts +320 -0
- package/contracts/openzeppelin/ERC20Permit.json +347 -0
- package/contracts/openzeppelin/ERC20Permit.ts +284 -0
- package/contracts/openzeppelin/ERC20PresetFixedSupply.json +329 -0
- package/contracts/openzeppelin/ERC20PresetFixedSupply.ts +273 -0
- package/contracts/openzeppelin/ERC20PresetMinterPauser.json +663 -0
- package/contracts/openzeppelin/ERC20PresetMinterPauser.ts +583 -0
- package/contracts/openzeppelin/ERC20Snapshot.json +328 -0
- package/contracts/openzeppelin/ERC20Snapshot.ts +302 -0
- package/contracts/openzeppelin/ERC20Votes.json +584 -0
- package/contracts/openzeppelin/ERC20Votes.ts +430 -0
- package/contracts/openzeppelin/ERC20VotesComp.json +627 -0
- package/contracts/openzeppelin/ERC20VotesComp.ts +452 -0
- package/contracts/openzeppelin/ERC20Wrapper.json +333 -0
- package/contracts/openzeppelin/ERC20Wrapper.ts +284 -0
- package/contracts/openzeppelin/ERC2771Context.json +21 -0
- package/contracts/openzeppelin/ERC2771Context.ts +90 -0
- package/contracts/openzeppelin/ERC2981.json +50 -0
- package/contracts/openzeppelin/ERC2981.ts +101 -0
- package/contracts/openzeppelin/ERC4626.json +662 -0
- package/contracts/openzeppelin/ERC4626.ts +485 -0
- package/contracts/openzeppelin/ERC721.json +348 -0
- package/contracts/openzeppelin/ERC721.ts +295 -0
- package/contracts/openzeppelin/ERC721Burnable.json +345 -0
- package/contracts/openzeppelin/ERC721Burnable.ts +306 -0
- package/contracts/openzeppelin/ERC721Enumerable.json +388 -0
- package/contracts/openzeppelin/ERC721Enumerable.ts +328 -0
- package/contracts/openzeppelin/ERC721Holder.json +36 -0
- package/contracts/openzeppelin/ERC721Holder.ts +90 -0
- package/contracts/openzeppelin/ERC721Pausable.json +371 -0
- package/contracts/openzeppelin/ERC721Pausable.ts +364 -0
- package/contracts/openzeppelin/ERC721PresetMinterPauserAutoId.json +742 -0
- package/contracts/openzeppelin/ERC721PresetMinterPauserAutoId.ts +638 -0
- package/contracts/openzeppelin/ERC721Royalty.json +361 -0
- package/contracts/openzeppelin/ERC721Royalty.ts +306 -0
- package/contracts/openzeppelin/ERC721URIStorage.json +332 -0
- package/contracts/openzeppelin/ERC721URIStorage.ts +295 -0
- package/contracts/openzeppelin/ERC721Votes.json +546 -0
- package/contracts/openzeppelin/ERC721Votes.ts +441 -0
- package/contracts/openzeppelin/ERC777.json +578 -0
- package/contracts/openzeppelin/ERC777.ts +473 -0
- package/contracts/openzeppelin/ERC777PresetFixedSupply.json +588 -0
- package/contracts/openzeppelin/ERC777PresetFixedSupply.ts +473 -0
- package/contracts/openzeppelin/EnumerableMap.json +1 -0
- package/contracts/openzeppelin/EnumerableMap.ts +83 -0
- package/contracts/openzeppelin/EnumerableSet.json +1 -0
- package/contracts/openzeppelin/EnumerableSet.ts +83 -0
- package/contracts/openzeppelin/Escrow.json +137 -0
- package/contracts/openzeppelin/Escrow.ts +225 -0
- package/contracts/openzeppelin/Governor.json +866 -0
- package/contracts/openzeppelin/Governor.ts +525 -0
- package/contracts/openzeppelin/GovernorCompatibilityBravo.json +1181 -0
- package/contracts/openzeppelin/GovernorCompatibilityBravo.ts +654 -0
- package/contracts/openzeppelin/GovernorCountingSimple.json +895 -0
- package/contracts/openzeppelin/GovernorCountingSimple.ts +536 -0
- package/contracts/openzeppelin/GovernorPreventLateQuorum.json +930 -0
- package/contracts/openzeppelin/GovernorPreventLateQuorum.ts +605 -0
- package/contracts/openzeppelin/GovernorProposalThreshold.json +866 -0
- package/contracts/openzeppelin/GovernorProposalThreshold.ts +525 -0
- package/contracts/openzeppelin/GovernorSettings.json +962 -0
- package/contracts/openzeppelin/GovernorSettings.ts +645 -0
- package/contracts/openzeppelin/GovernorTimelockCompound.json +990 -0
- package/contracts/openzeppelin/GovernorTimelockCompound.ts +638 -0
- package/contracts/openzeppelin/GovernorTimelockControl.json +983 -0
- package/contracts/openzeppelin/GovernorTimelockControl.ts +627 -0
- package/contracts/openzeppelin/GovernorVotes.json +879 -0
- package/contracts/openzeppelin/GovernorVotes.ts +536 -0
- package/contracts/openzeppelin/GovernorVotesComp.json +879 -0
- package/contracts/openzeppelin/GovernorVotesComp.ts +536 -0
- package/contracts/openzeppelin/GovernorVotesQuorumFraction.json +937 -0
- package/contracts/openzeppelin/GovernorVotesQuorumFraction.ts +598 -0
- package/contracts/openzeppelin/IAMB.json +327 -0
- package/contracts/openzeppelin/IAMB.ts +331 -0
- package/contracts/openzeppelin/IAccessControl.json +174 -0
- package/contracts/openzeppelin/IAccessControl.ts +214 -0
- package/contracts/openzeppelin/IAccessControlEnumerable.json +217 -0
- package/contracts/openzeppelin/IAccessControlEnumerable.ts +236 -0
- package/contracts/openzeppelin/IArbSys.json +270 -0
- package/contracts/openzeppelin/IArbSys.ts +233 -0
- package/contracts/openzeppelin/IBeacon.json +15 -0
- package/contracts/openzeppelin/IBeacon.ts +90 -0
- package/contracts/openzeppelin/IBridge.json +296 -0
- package/contracts/openzeppelin/IBridge.ts +287 -0
- package/contracts/openzeppelin/ICompoundTimelock.json +415 -0
- package/contracts/openzeppelin/ICompoundTimelock.ts +389 -0
- package/contracts/openzeppelin/ICrossDomainMessenger.json +101 -0
- package/contracts/openzeppelin/ICrossDomainMessenger.ts +181 -0
- package/contracts/openzeppelin/IERC1155.json +295 -0
- package/contracts/openzeppelin/IERC1155.ts +265 -0
- package/contracts/openzeppelin/IERC1155MetadataURI.json +314 -0
- package/contracts/openzeppelin/IERC1155MetadataURI.ts +276 -0
- package/contracts/openzeppelin/IERC1155Receiver.json +99 -0
- package/contracts/openzeppelin/IERC1155Receiver.ts +112 -0
- package/contracts/openzeppelin/IERC1271.json +26 -0
- package/contracts/openzeppelin/IERC1271.ts +90 -0
- package/contracts/openzeppelin/IERC1363.json +373 -0
- package/contracts/openzeppelin/IERC1363.ts +252 -0
- package/contracts/openzeppelin/IERC1363Receiver.json +36 -0
- package/contracts/openzeppelin/IERC1363Receiver.ts +90 -0
- package/contracts/openzeppelin/IERC1363Spender.json +31 -0
- package/contracts/openzeppelin/IERC1363Spender.ts +90 -0
- package/contracts/openzeppelin/IERC165.json +21 -0
- package/contracts/openzeppelin/IERC165.ts +90 -0
- package/contracts/openzeppelin/IERC1820Implementer.json +26 -0
- package/contracts/openzeppelin/IERC1820Implementer.ts +90 -0
- package/contracts/openzeppelin/IERC1820Registry.json +215 -0
- package/contracts/openzeppelin/IERC1820Registry.ts +218 -0
- package/contracts/openzeppelin/IERC1822Proxiable.json +15 -0
- package/contracts/openzeppelin/IERC1822Proxiable.ts +90 -0
- package/contracts/openzeppelin/IERC20.json +185 -0
- package/contracts/openzeppelin/IERC20.ts +196 -0
- package/contracts/openzeppelin/IERC20Metadata.json +224 -0
- package/contracts/openzeppelin/IERC20Metadata.ts +229 -0
- package/contracts/openzeppelin/IERC20Permit.json +77 -0
- package/contracts/openzeppelin/IERC20Permit.ts +112 -0
- package/contracts/openzeppelin/IERC2612.json +77 -0
- package/contracts/openzeppelin/IERC2612.ts +112 -0
- package/contracts/openzeppelin/IERC2981.json +50 -0
- package/contracts/openzeppelin/IERC2981.ts +101 -0
- package/contracts/openzeppelin/IERC3156FlashBorrower.json +41 -0
- package/contracts/openzeppelin/IERC3156FlashBorrower.ts +90 -0
- package/contracts/openzeppelin/IERC3156FlashLender.json +79 -0
- package/contracts/openzeppelin/IERC3156FlashLender.ts +112 -0
- package/contracts/openzeppelin/IERC4626.json +614 -0
- package/contracts/openzeppelin/IERC4626.ts +463 -0
- package/contracts/openzeppelin/IERC721.json +287 -0
- package/contracts/openzeppelin/IERC721.ts +262 -0
- package/contracts/openzeppelin/IERC721Enumerable.json +343 -0
- package/contracts/openzeppelin/IERC721Enumerable.ts +295 -0
- package/contracts/openzeppelin/IERC721Metadata.json +332 -0
- package/contracts/openzeppelin/IERC721Metadata.ts +295 -0
- package/contracts/openzeppelin/IERC721Receiver.json +36 -0
- package/contracts/openzeppelin/IERC721Receiver.ts +90 -0
- package/contracts/openzeppelin/IERC777.json +393 -0
- package/contracts/openzeppelin/IERC777.ts +360 -0
- package/contracts/openzeppelin/IERC777Recipient.json +40 -0
- package/contracts/openzeppelin/IERC777Recipient.ts +90 -0
- package/contracts/openzeppelin/IERC777Sender.json +40 -0
- package/contracts/openzeppelin/IERC777Sender.ts +90 -0
- package/contracts/openzeppelin/IFxMessageProcessor.json +25 -0
- package/contracts/openzeppelin/IFxMessageProcessor.ts +90 -0
- package/contracts/openzeppelin/IGovernor.json +683 -0
- package/contracts/openzeppelin/IGovernor.ts +448 -0
- package/contracts/openzeppelin/IGovernorCompatibilityBravo.json +913 -0
- package/contracts/openzeppelin/IGovernorCompatibilityBravo.ts +522 -0
- package/contracts/openzeppelin/IGovernorTimelock.json +768 -0
- package/contracts/openzeppelin/IGovernorTimelock.ts +510 -0
- package/contracts/openzeppelin/IInbox.json +377 -0
- package/contracts/openzeppelin/IInbox.ts +273 -0
- package/contracts/openzeppelin/IMessageProvider.json +34 -0
- package/contracts/openzeppelin/IMessageProvider.ts +134 -0
- package/contracts/openzeppelin/IOutbox.json +179 -0
- package/contracts/openzeppelin/IOutbox.ts +218 -0
- package/contracts/openzeppelin/IVotes.json +184 -0
- package/contracts/openzeppelin/IVotes.ts +196 -0
- package/contracts/openzeppelin/Initializable.json +15 -0
- package/contracts/openzeppelin/Initializable.ts +105 -0
- package/contracts/openzeppelin/LibAMB.json +1 -0
- package/contracts/openzeppelin/LibAMB.ts +83 -0
- package/contracts/openzeppelin/LibArbitrumL1.json +1 -0
- package/contracts/openzeppelin/LibArbitrumL1.ts +83 -0
- package/contracts/openzeppelin/LibArbitrumL2.json +15 -0
- package/contracts/openzeppelin/LibArbitrumL2.ts +90 -0
- package/contracts/openzeppelin/LibOptimism.json +1 -0
- package/contracts/openzeppelin/LibOptimism.ts +83 -0
- package/contracts/openzeppelin/Math.json +1 -0
- package/contracts/openzeppelin/Math.ts +83 -0
- package/contracts/openzeppelin/MerkleProof.json +1 -0
- package/contracts/openzeppelin/MerkleProof.ts +83 -0
- package/contracts/openzeppelin/MinimalForwarder.json +143 -0
- package/contracts/openzeppelin/MinimalForwarder.ts +112 -0
- package/contracts/openzeppelin/Multicall.json +21 -0
- package/contracts/openzeppelin/Multicall.ts +90 -0
- package/contracts/openzeppelin/Ownable.json +54 -0
- package/contracts/openzeppelin/Ownable.ts +134 -0
- package/contracts/openzeppelin/Pausable.json +41 -0
- package/contracts/openzeppelin/Pausable.ts +141 -0
- package/contracts/openzeppelin/PaymentSplitter.json +304 -0
- package/contracts/openzeppelin/PaymentSplitter.ts +281 -0
- package/contracts/openzeppelin/Proxy.json +10 -0
- package/contracts/openzeppelin/Proxy.ts +83 -0
- package/contracts/openzeppelin/ProxyAdmin.json +151 -0
- package/contracts/openzeppelin/ProxyAdmin.ts +189 -0
- package/contracts/openzeppelin/PullPayment.json +34 -0
- package/contracts/openzeppelin/PullPayment.ts +101 -0
- package/contracts/openzeppelin/ReentrancyGuard.json +1 -0
- package/contracts/openzeppelin/ReentrancyGuard.ts +83 -0
- package/contracts/openzeppelin/RefundEscrow.json +226 -0
- package/contracts/openzeppelin/RefundEscrow.ts +349 -0
- package/contracts/openzeppelin/SafeCast.json +1 -0
- package/contracts/openzeppelin/SafeCast.ts +83 -0
- package/contracts/openzeppelin/SafeERC20.json +1 -0
- package/contracts/openzeppelin/SafeERC20.ts +83 -0
- package/contracts/openzeppelin/SafeMath.json +1 -0
- package/contracts/openzeppelin/SafeMath.ts +83 -0
- package/contracts/openzeppelin/SignatureChecker.json +1 -0
- package/contracts/openzeppelin/SignatureChecker.ts +83 -0
- package/contracts/openzeppelin/SignedMath.json +1 -0
- package/contracts/openzeppelin/SignedMath.ts +83 -0
- package/contracts/openzeppelin/SignedSafeMath.json +1 -0
- package/contracts/openzeppelin/SignedSafeMath.ts +83 -0
- package/contracts/openzeppelin/StorageSlot.json +1 -0
- package/contracts/openzeppelin/StorageSlot.ts +83 -0
- package/contracts/openzeppelin/Strings.json +1 -0
- package/contracts/openzeppelin/Strings.ts +83 -0
- package/contracts/openzeppelin/TimelockController.json +867 -0
- package/contracts/openzeppelin/TimelockController.ts +583 -0
- package/contracts/openzeppelin/Timers.json +1 -0
- package/contracts/openzeppelin/Timers.ts +83 -0
- package/contracts/openzeppelin/TokenTimelock.json +69 -0
- package/contracts/openzeppelin/TokenTimelock.ts +123 -0
- package/contracts/openzeppelin/TransparentUpgradeableProxy.json +146 -0
- package/contracts/openzeppelin/TransparentUpgradeableProxy.ts +214 -0
- package/contracts/openzeppelin/UUPSUpgradeable.json +91 -0
- package/contracts/openzeppelin/UUPSUpgradeable.ts +192 -0
- package/contracts/openzeppelin/UpgradeableBeacon.json +104 -0
- package/contracts/openzeppelin/UpgradeableBeacon.ts +185 -0
- package/contracts/openzeppelin/VestingWallet.json +193 -0
- package/contracts/openzeppelin/VestingWallet.ts +208 -0
- package/contracts/openzeppelin/Votes.json +216 -0
- package/contracts/openzeppelin/Votes.ts +218 -0
- package/data/evm/eventHashes.json +19314 -0
- package/data/evm/events.json +19314 -0
- package/data/evm/functionHashes.json +121138 -0
- package/data/evm/functions.json +121140 -0
- package/data/tokens/coingecko.json +137409 -0
- package/dist/contracts/gen/base/ERC20Base/ERC20Base.js +94 -0
- package/dist/contracts/gnosis/GnosisSafe.js +357 -0
- package/dist/src/BlockchainExplorer/BlockChainExplorerFactory.js +114 -20
- package/dist/src/BlockchainExplorer/BlockChainExplorerProvider.js +8 -0
- package/dist/src/BlockchainExplorer/Bscscan.js +1 -0
- package/dist/src/BlockchainExplorer/Etherscan.js +14 -4
- package/dist/src/BlockchainExplorer/Evmscan.js +9 -0
- package/dist/src/BlockchainExplorer/Polyscan.js +1 -0
- package/dist/src/ChainAccountProvider.js +89 -0
- package/dist/src/ChainAccountsService.js +20 -2
- package/dist/src/Config.js +76 -0
- package/dist/src/blocks/BlockDateResolver.js +9 -8
- package/dist/src/bridges/hop/HopBridge.js +5 -2
- package/dist/src/chains/PlatformFactory.js +2 -2
- package/dist/src/chains/arbitrum/ArbWeb3Client.js +5 -24
- package/dist/src/chains/arbitrum/TokensServiceArbitrum.js +18 -0
- package/dist/src/chains/boba/BobaWeb3Client.js +5 -33
- package/dist/src/chains/xdai/XDaiWeb3Client.js +6 -30
- package/dist/src/class/SubjectKind.js +9 -0
- package/dist/src/class/SubjectStream.js +104 -0
- package/dist/src/class/Subscription.js +13 -0
- package/dist/src/clients/BscWeb3Client.js +5 -24
- package/dist/src/clients/ClientEventsStream.js +62 -18
- package/dist/src/clients/ClientPool.js +115 -55
- package/dist/src/clients/EthWeb3Client.js +7 -22
- package/dist/src/clients/EvmWeb3Client.js +25 -0
- package/dist/src/clients/HardhatWeb3Client.js +19 -40
- package/dist/src/clients/PolyWeb3Client.js +5 -51
- package/dist/src/clients/Web3Client.js +355 -10
- package/dist/src/clients/Web3ClientFactory.js +15 -0
- package/dist/src/clients/debug/ClientDebugMethods.js +64 -0
- package/dist/src/clients/utils/ClientEndpoints.js +6 -0
- package/dist/src/clients/utils/TxFactory.js +7 -12
- package/dist/src/contracts/Contract.js +2 -1
- package/dist/src/contracts/ContractAbiProvider.js +58 -0
- package/dist/src/contracts/ContractBase.js +161 -26
- package/dist/src/contracts/ContractReader.js +78 -2
- package/dist/src/contracts/ContractStorageReaderBase.js +15 -0
- package/dist/src/contracts/ContractStream.js +21 -8
- package/dist/src/contracts/ContractWriter.js +47 -20
- package/dist/src/contracts/TxContract.js +6 -3
- package/dist/src/contracts/common/ERC20.js +1 -1
- package/dist/src/contracts/utils/AbiDeserializer.js +15 -5
- package/dist/src/contracts/utils/InputDataUtils.js +5 -2
- package/dist/src/env/BigIntSerializer.js +2 -1
- package/dist/src/evm/EVM.js +214 -0
- package/dist/src/evm/OpcodesWalker.js +137 -0
- package/dist/src/evm/Stack.js +57 -0
- package/dist/src/evm/interfaces/IJumps.js +2 -0
- package/dist/src/evm/interfaces/IMemory.js +2 -0
- package/dist/src/evm/interfaces/IOpcode.js +2 -0
- package/dist/src/evm/interfaces/IStorage.js +2 -0
- package/dist/src/evm/opcodes/add.js +50 -0
- package/dist/src/evm/opcodes/addmod.js +19 -0
- package/dist/src/evm/opcodes/address.js +17 -0
- package/dist/src/evm/opcodes/and.js +56 -0
- package/dist/src/evm/opcodes/balance.js +22 -0
- package/dist/src/evm/opcodes/blockhash.js +22 -0
- package/dist/src/evm/opcodes/byte.js +30 -0
- package/dist/src/evm/opcodes/call.js +48 -0
- package/dist/src/evm/opcodes/callcode.js +48 -0
- package/dist/src/evm/opcodes/calldatacopy.js +27 -0
- package/dist/src/evm/opcodes/calldataload.js +33 -0
- package/dist/src/evm/opcodes/calldatasize.js +16 -0
- package/dist/src/evm/opcodes/caller.js +17 -0
- package/dist/src/evm/opcodes/callvalue.js +16 -0
- package/dist/src/evm/opcodes/codecopy.js +31 -0
- package/dist/src/evm/opcodes/codesize.js +16 -0
- package/dist/src/evm/opcodes/coinbase.js +16 -0
- package/dist/src/evm/opcodes/create.js +35 -0
- package/dist/src/evm/opcodes/create2.js +34 -0
- package/dist/src/evm/opcodes/delegatecall.js +44 -0
- package/dist/src/evm/opcodes/difficulty.js +16 -0
- package/dist/src/evm/opcodes/div.js +33 -0
- package/dist/src/evm/opcodes/dup.js +6 -0
- package/dist/src/evm/opcodes/eq.js +69 -0
- package/dist/src/evm/opcodes/exp.js +30 -0
- package/dist/src/evm/opcodes/extcodecopy.js +35 -0
- package/dist/src/evm/opcodes/extcodehash.js +22 -0
- package/dist/src/evm/opcodes/extcodesize.js +22 -0
- package/dist/src/evm/opcodes/gas.js +16 -0
- package/dist/src/evm/opcodes/gaslimit.js +16 -0
- package/dist/src/evm/opcodes/gasprice.js +16 -0
- package/dist/src/evm/opcodes/gt.js +36 -0
- package/dist/src/evm/opcodes/invalid.js +18 -0
- package/dist/src/evm/opcodes/iszero.js +51 -0
- package/dist/src/evm/opcodes/jump.js +66 -0
- package/dist/src/evm/opcodes/jumpdest.js +5 -0
- package/dist/src/evm/opcodes/jumpi.js +298 -0
- package/dist/src/evm/opcodes/log.js +74 -0
- package/dist/src/evm/opcodes/lt.js +36 -0
- package/dist/src/evm/opcodes/mload.js +28 -0
- package/dist/src/evm/opcodes/mod.js +30 -0
- package/dist/src/evm/opcodes/msize.js +16 -0
- package/dist/src/evm/opcodes/mstore.js +30 -0
- package/dist/src/evm/opcodes/mul.js +34 -0
- package/dist/src/evm/opcodes/mulmod.js +19 -0
- package/dist/src/evm/opcodes/not.js +28 -0
- package/dist/src/evm/opcodes/number.js +16 -0
- package/dist/src/evm/opcodes/or.js +30 -0
- package/dist/src/evm/opcodes/origin.js +16 -0
- package/dist/src/evm/opcodes/pc.js +5 -0
- package/dist/src/evm/opcodes/pop.js +5 -0
- package/dist/src/evm/opcodes/push.js +6 -0
- package/dist/src/evm/opcodes/return.js +70 -0
- package/dist/src/evm/opcodes/returndatacopy.js +31 -0
- package/dist/src/evm/opcodes/returndatasize.js +16 -0
- package/dist/src/evm/opcodes/revert.js +57 -0
- package/dist/src/evm/opcodes/sar.js +30 -0
- package/dist/src/evm/opcodes/selfdestruct.js +23 -0
- package/dist/src/evm/opcodes/sha3.js +56 -0
- package/dist/src/evm/opcodes/shl.js +35 -0
- package/dist/src/evm/opcodes/shr.js +30 -0
- package/dist/src/evm/opcodes/signextend.js +19 -0
- package/dist/src/evm/opcodes/sload.js +140 -0
- package/dist/src/evm/opcodes/sstore.js +189 -0
- package/dist/src/evm/opcodes/staticcall.js +44 -0
- package/dist/src/evm/opcodes/stop.js +17 -0
- package/dist/src/evm/opcodes/sub.js +30 -0
- package/dist/src/evm/opcodes/swap.js +6 -0
- package/dist/src/evm/opcodes/timestamp.js +16 -0
- package/dist/src/evm/opcodes/xor.js +30 -0
- package/dist/src/evm/opcodes.js +192 -0
- package/dist/src/evm/tx.class.js +154 -0
- package/dist/src/evm/utils/BigNumber.js +14 -0
- package/dist/src/evm/utils/hex.js +44 -0
- package/dist/src/evm/utils/opcodes.js +217 -0
- package/dist/src/evm/utils/stringify.js +14 -0
- package/dist/src/evm/utils/stringifyEvents.js +38 -0
- package/dist/src/evm/utils/stringifyFunctions.js +70 -0
- package/dist/src/evm/utils/stringifyInstructions.js +44 -0
- package/dist/src/evm/utils/stringifyMappings.js +62 -0
- package/dist/src/evm/utils/stringifyStructs.js +16 -0
- package/dist/src/evm/utils/stringifyVariables.js +33 -0
- package/dist/src/gen/ContractStorageReaderTemplate.js +11 -0
- package/dist/src/gen/Generator.js +37 -16
- package/dist/src/gen/GeneratorFromAbi.js +225 -72
- package/dist/src/gen/GeneratorStorageReader.js +89 -0
- package/dist/src/gen/utils/$gen.js +14 -0
- package/dist/src/gen/utils/Str.js +47 -0
- package/dist/src/hardhat/HardhatProvider.js +177 -0
- package/dist/src/indexer/BlocksTxIndexer.js +19 -7
- package/dist/src/indexer/handlers/BlocksWalker.js +65 -54
- package/dist/src/loggers/LoggerService.js +8 -5
- package/dist/src/models/TAccount.js +2 -0
- package/dist/src/ns/NameService.js +3 -0
- package/dist/src/ns/utils/$ns.js +6 -3
- package/dist/src/safe/$gnosis.js +23 -0
- package/dist/src/safe/GnosisSafeFactory.js +27 -0
- package/dist/src/safe/GnosisSafeHandler.js +361 -0
- package/dist/src/safe/transport/FileServiceTransport.js +92 -0
- package/dist/src/safe/transport/GnosisServiceTransport.js +78 -0
- package/dist/src/safe/transport/ISafeServiceTransport.js +2 -0
- package/dist/src/safe/transport/InMemoryServiceTransport.js +56 -0
- package/dist/src/solidity/SlotsParser.js +594 -0
- package/dist/src/solidity/SlotsStorage.js +158 -0
- package/dist/src/solidity/storage/Accessor.js +126 -0
- package/dist/src/solidity/storage/SlotDynamicArray.js +17 -0
- package/dist/src/solidity/storage/SlotFixedArray.js +28 -0
- package/dist/src/solidity/storage/SlotsStorageHandler.js +10 -0
- package/dist/src/solidity/storage/SlotsStorageTransport.js +126 -0
- package/dist/src/solidity/storage/handlers/SlotDynamicArrayHandler.js +47 -0
- package/dist/src/solidity/storage/handlers/SlotFixedArrayHandler.js +50 -0
- package/dist/src/solidity/storage/handlers/SlotMappingHandler.js +42 -0
- package/dist/src/solidity/storage/handlers/SlotStringHandler.js +109 -0
- package/dist/src/solidity/storage/handlers/SlotStructHandler.js +45 -0
- package/dist/src/solidity/storage/handlers/SlotValueHandler.js +30 -0
- package/dist/src/solidity/utils/$str.js +38 -0
- package/dist/src/solidity/utils/$types.js +22 -0
- package/dist/src/structs/PackedRanges.js +8 -1
- package/dist/src/tokens/TokenDataProvider.js +251 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js +3 -1
- package/dist/src/tokens/TokenExchanges/AmmV2ExchangeBase.js +4 -4
- package/dist/src/tokens/TokenExchanges/PancakeswapExchange.js +4 -7
- package/dist/src/tokens/TokenExchanges/SushiswapPolygonExchange.js +4 -5
- package/dist/src/tokens/TokenExchanges/UniswapExchange.js +4 -7
- package/dist/src/tokens/TokenOracles/AmmPriceV2Oracle.js +2 -4
- package/dist/src/tokens/TokenOracles/CoingeckoOracle.js +12 -0
- package/dist/src/tokens/TokenOracles/TokenPriceStore.js +1 -1
- package/dist/src/tokens/TokenProviders/TPChain.js +14 -7
- package/dist/src/tokens/TokenProviders/TPCoingecko.js +117 -0
- package/dist/src/tokens/TokenProviders/TPConfig.js +46 -0
- package/dist/src/tokens/TokenProviders/TPExplorer.js +35 -0
- package/dist/src/tokens/TokenService.js +5 -2
- package/dist/src/tokens/TokenTransferService.js +28 -18
- package/dist/src/tokens/TokensService.js +32 -177
- package/dist/src/tokens/TokensServiceFactory.js +13 -1
- package/dist/src/txs/TxDataBuilder.js +54 -22
- package/dist/src/txs/TxLogger.js +3 -3
- package/dist/src/txs/TxWriter.js +169 -37
- package/dist/src/txs/receipt/TxLogParser.js +11 -1
- package/dist/src/txs/receipt/TxLogsTransfer.js +14 -13
- package/dist/src/txs/receipt/TxTopicProvider.js +10 -6
- package/dist/src/txs/sig-transports/SigFileTransport.js +48 -0
- package/dist/src/utils/$abiParser.js +55 -20
- package/dist/src/utils/$abiType.js +184 -3
- package/dist/src/utils/$abiUtils.js +54 -5
- package/dist/src/utils/$account.js +30 -0
- package/dist/src/utils/$address.js +8 -0
- package/dist/src/utils/$bigint.js +52 -3
- package/dist/src/utils/$block.js +16 -0
- package/dist/src/utils/$bloom.js +42 -0
- package/dist/src/utils/$buffer.js +94 -0
- package/dist/src/utils/$cli.js +20 -0
- package/dist/src/utils/$color.js +171 -0
- package/dist/src/utils/$config.js +65 -5
- package/dist/src/utils/$const.js +4 -0
- package/dist/src/utils/$contract.js +20 -2
- package/dist/src/utils/$crypto.js +25 -0
- package/dist/src/utils/$csv.js +17 -27
- package/dist/src/utils/$date.js +129 -25
- package/dist/src/utils/$gas.js +15 -0
- package/dist/src/utils/$hex.js +77 -0
- package/dist/src/utils/$is.js +24 -21
- package/dist/src/utils/$logger.js +56 -3
- package/dist/src/utils/$machine.js +77 -0
- package/dist/src/utils/$number.js +24 -1
- package/dist/src/utils/$path.js +17 -0
- package/dist/src/utils/$promise.js +81 -0
- package/dist/src/utils/$require.js +15 -1
- package/dist/src/utils/$secret.js +29 -0
- package/dist/src/utils/$sign.js +96 -14
- package/dist/src/utils/$signRaw.js +48 -0
- package/dist/src/utils/$signSerializer.js +5 -4
- package/dist/src/utils/$txData.js +19 -0
- package/hardhat.config.js +21 -1
- package/package.json +28 -14
- package/readme.md +21 -4
- package/src/BlockchainExplorer/BlockChainExplorerFactory.ts +149 -39
- package/src/BlockchainExplorer/BlockChainExplorerProvider.ts +10 -0
- package/src/BlockchainExplorer/Bscscan.ts +1 -0
- package/src/BlockchainExplorer/Etherscan.ts +17 -5
- package/src/BlockchainExplorer/Evmscan.ts +8 -0
- package/src/BlockchainExplorer/IBlockChainExplorer.ts +3 -2
- package/src/BlockchainExplorer/Polyscan.ts +1 -0
- package/src/ChainAccountProvider.ts +84 -0
- package/src/ChainAccountsService.ts +21 -2
- package/src/Config.ts +85 -0
- package/src/blocks/BlockDateResolver.ts +10 -12
- package/src/bridges/hop/HopBridge.ts +9 -2
- package/src/bridges/hop/contracts/polygon/Dai_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Dai_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Dai_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Eth_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Eth_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Eth_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Matic_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Matic_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Matic_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdc_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdc_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdc_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdt_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdt_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdt_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Wbtc_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Wbtc_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Wbtc_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/models/IBridge.ts +1 -1
- package/src/chains/PlatformFactory.ts +3 -2
- package/src/chains/arbitrum/ArbWeb3Client.ts +7 -22
- package/src/chains/arbitrum/TokensServiceArbitrum.ts +19 -0
- package/src/chains/boba/BobaWeb3Client.ts +5 -33
- package/src/chains/xdai/XDaiWeb3Client.ts +6 -32
- package/src/class/SubjectKind.ts +5 -0
- package/src/class/SubjectStream.ts +111 -0
- package/src/class/Subscription.ts +7 -0
- package/src/clients/BscWeb3Client.ts +5 -22
- package/src/clients/ClientEventsStream.ts +86 -19
- package/src/clients/ClientPool.ts +145 -61
- package/src/clients/EthWeb3Client.ts +8 -21
- package/src/clients/EvmWeb3Client.ts +26 -0
- package/src/clients/HardhatWeb3Client.ts +17 -39
- package/src/clients/PolyWeb3Client.ts +5 -54
- package/src/clients/Web3Client.ts +430 -32
- package/src/clients/Web3ClientFactory.ts +17 -1
- package/src/clients/debug/ClientDebugMethods.ts +75 -0
- package/src/clients/interfaces/IWeb3Client.ts +33 -5
- package/src/clients/interfaces/IWeb3EndpointOptions.ts +6 -0
- package/src/clients/utils/ClientEndpoints.ts +6 -0
- package/src/clients/utils/TxFactory.ts +13 -13
- package/src/contracts/Contract.ts +3 -2
- package/src/contracts/ContractAbiProvider.ts +68 -0
- package/src/contracts/ContractBase.ts +205 -36
- package/src/contracts/ContractReader.ts +116 -3
- package/src/contracts/ContractStorageReaderBase.ts +26 -0
- package/src/contracts/ContractStream.ts +24 -6
- package/src/contracts/ContractWriter.ts +58 -28
- package/src/contracts/TxContract.ts +7 -4
- package/src/contracts/common/ERC20.ts +1 -1
- package/src/contracts/utils/AbiDeserializer.ts +16 -7
- package/src/contracts/utils/InputDataUtils.ts +8 -6
- package/src/env/BigIntSerializer.ts +3 -1
- package/src/evm/EVM.ts +246 -0
- package/src/evm/OpcodesWalker.ts +149 -0
- package/src/evm/Stack.ts +58 -0
- package/src/evm/interfaces/IJumps.ts +3 -0
- package/src/evm/interfaces/IMemory.ts +3 -0
- package/src/evm/interfaces/IOpcode.ts +11 -0
- package/src/evm/interfaces/IStorage.ts +3 -0
- package/src/evm/opcodes/add.ts +49 -0
- package/src/evm/opcodes/addmod.ts +19 -0
- package/src/evm/opcodes/address.ts +22 -0
- package/src/evm/opcodes/and.ts +58 -0
- package/src/evm/opcodes/balance.ts +25 -0
- package/src/evm/opcodes/blockhash.ts +25 -0
- package/src/evm/opcodes/byte.ts +34 -0
- package/src/evm/opcodes/call.ts +69 -0
- package/src/evm/opcodes/callcode.ts +69 -0
- package/src/evm/opcodes/calldatacopy.ts +36 -0
- package/src/evm/opcodes/calldataload.ts +40 -0
- package/src/evm/opcodes/calldatasize.ts +21 -0
- package/src/evm/opcodes/caller.ts +22 -0
- package/src/evm/opcodes/callvalue.ts +21 -0
- package/src/evm/opcodes/codecopy.ts +37 -0
- package/src/evm/opcodes/codesize.ts +21 -0
- package/src/evm/opcodes/coinbase.ts +21 -0
- package/src/evm/opcodes/create.ts +42 -0
- package/src/evm/opcodes/create2.ts +41 -0
- package/src/evm/opcodes/delegatecall.ts +63 -0
- package/src/evm/opcodes/difficulty.ts +21 -0
- package/src/evm/opcodes/div.ts +35 -0
- package/src/evm/opcodes/dup.ts +7 -0
- package/src/evm/opcodes/eq.ts +92 -0
- package/src/evm/opcodes/exp.ts +34 -0
- package/src/evm/opcodes/extcodecopy.ts +42 -0
- package/src/evm/opcodes/extcodehash.ts +25 -0
- package/src/evm/opcodes/extcodesize.ts +25 -0
- package/src/evm/opcodes/gas.ts +21 -0
- package/src/evm/opcodes/gaslimit.ts +21 -0
- package/src/evm/opcodes/gasprice.ts +21 -0
- package/src/evm/opcodes/gt.ts +39 -0
- package/src/evm/opcodes/invalid.ts +24 -0
- package/src/evm/opcodes/iszero.ts +48 -0
- package/src/evm/opcodes/jump.ts +66 -0
- package/src/evm/opcodes/jumpdest.ts +6 -0
- package/src/evm/opcodes/jumpi.ts +367 -0
- package/src/evm/opcodes/log.ts +89 -0
- package/src/evm/opcodes/lt.ts +39 -0
- package/src/evm/opcodes/mload.ts +30 -0
- package/src/evm/opcodes/mod.ts +33 -0
- package/src/evm/opcodes/msize.ts +21 -0
- package/src/evm/opcodes/mstore.ts +33 -0
- package/src/evm/opcodes/mul.ts +38 -0
- package/src/evm/opcodes/mulmod.ts +19 -0
- package/src/evm/opcodes/not.ts +30 -0
- package/src/evm/opcodes/number.ts +21 -0
- package/src/evm/opcodes/or.ts +33 -0
- package/src/evm/opcodes/origin.ts +21 -0
- package/src/evm/opcodes/pc.ts +7 -0
- package/src/evm/opcodes/pop.ts +6 -0
- package/src/evm/opcodes/push.ts +8 -0
- package/src/evm/opcodes/return.ts +78 -0
- package/src/evm/opcodes/returndatacopy.ts +37 -0
- package/src/evm/opcodes/returndatasize.ts +21 -0
- package/src/evm/opcodes/revert.ts +64 -0
- package/src/evm/opcodes/sar.ts +33 -0
- package/src/evm/opcodes/selfdestruct.ts +26 -0
- package/src/evm/opcodes/sha3.ts +63 -0
- package/src/evm/opcodes/shl.ts +42 -0
- package/src/evm/opcodes/shr.ts +33 -0
- package/src/evm/opcodes/signextend.ts +25 -0
- package/src/evm/opcodes/sload.ts +190 -0
- package/src/evm/opcodes/sstore.ts +259 -0
- package/src/evm/opcodes/staticcall.ts +63 -0
- package/src/evm/opcodes/stop.ts +22 -0
- package/src/evm/opcodes/sub.ts +33 -0
- package/src/evm/opcodes/swap.ts +7 -0
- package/src/evm/opcodes/timestamp.ts +21 -0
- package/src/evm/opcodes/xor.ts +33 -0
- package/src/evm/opcodes.ts +207 -0
- package/src/evm/tx.class.ts +137 -0
- package/src/evm/utils/BigNumber.ts +9 -0
- package/src/evm/utils/hex.ts +37 -0
- package/src/evm/utils/opcodes.ts +213 -0
- package/src/evm/utils/stringify.ts +12 -0
- package/src/evm/utils/stringifyEvents.ts +37 -0
- package/src/evm/utils/stringifyFunctions.ts +41 -0
- package/src/evm/utils/stringifyInstructions.ts +38 -0
- package/src/evm/utils/stringifyMappings.ts +65 -0
- package/src/evm/utils/stringifyStructs.ts +16 -0
- package/src/evm/utils/stringifyVariables.ts +32 -0
- package/src/gen/ContractStorageReaderTemplate.ts +18 -0
- package/src/gen/ContractTemplate.ts +41 -7
- package/src/gen/Generator.ts +50 -19
- package/src/gen/GeneratorFromAbi.ts +239 -67
- package/src/gen/GeneratorStorageReader.ts +113 -0
- package/src/gen/utils/$gen.ts +11 -0
- package/src/gen/utils/Str.ts +40 -0
- package/src/handlers/TokenHandler.ts +1 -1
- package/src/hardhat/HardhatProvider.ts +207 -0
- package/src/indexer/BlocksTxIndexer.ts +36 -10
- package/src/indexer/handlers/BlocksWalker.ts +81 -62
- package/src/indexer/handlers/TxQueueLoader.ts +7 -7
- package/src/json/JsonObjectStore.ts +1 -1
- package/src/loggers/LoggerService.ts +9 -5
- package/src/loggers/TxLoggerService.ts +1 -1
- package/src/models/IToken.ts +9 -0
- package/src/models/TAccount.ts +30 -0
- package/src/models/TBufferLike.ts +2 -2
- package/src/models/TPlatform.ts +1 -1
- package/src/ns/NameService.ts +3 -0
- package/src/ns/utils/$ns.ts +3 -4
- package/src/safe/$gnosis.ts +20 -0
- package/src/safe/GnosisSafeFactory.ts +40 -0
- package/src/safe/GnosisSafeHandler.ts +432 -0
- package/src/safe/transport/FileServiceTransport.ts +115 -0
- package/src/safe/transport/GnosisServiceTransport.ts +83 -0
- package/src/safe/transport/ISafeServiceTransport.ts +26 -0
- package/src/safe/transport/InMemoryServiceTransport.ts +79 -0
- package/src/solidity/SlotsParser.ts +650 -0
- package/src/solidity/SlotsStorage.ts +177 -0
- package/src/solidity/storage/Accessor.spec.ts +45 -0
- package/src/solidity/storage/Accessor.ts +136 -0
- package/src/solidity/storage/SlotDynamicArray.ts +46 -0
- package/src/solidity/storage/SlotFixedArray.ts +31 -0
- package/src/solidity/storage/SlotsStorageHandler.ts +17 -0
- package/src/solidity/storage/SlotsStorageTransport.ts +152 -0
- package/src/solidity/storage/handlers/SlotDynamicArrayHandler.ts +52 -0
- package/src/solidity/storage/handlers/SlotFixedArrayHandler.ts +52 -0
- package/src/solidity/storage/handlers/SlotMappingHandler.ts +52 -0
- package/src/solidity/storage/handlers/SlotStringHandler.ts +130 -0
- package/src/solidity/storage/handlers/SlotStructHandler.ts +46 -0
- package/src/solidity/storage/handlers/SlotValueHandler.ts +36 -0
- package/src/solidity/utils/$str.ts +36 -0
- package/src/solidity/utils/$types.ts +16 -0
- package/src/structs/PackedRanges.ts +9 -3
- package/src/tokens/TokenDataProvider.ts +271 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.ts +3 -1
- package/src/tokens/TokenExchanges/AmmV2ExchangeBase.ts +4 -3
- package/src/tokens/TokenExchanges/OneInchExchange.ts +1 -1
- package/src/tokens/TokenExchanges/PancakeswapExchange.ts +5 -10
- package/src/tokens/TokenExchanges/SushiswapPolygonExchange.ts +8 -5
- package/src/tokens/TokenExchanges/UniswapExchange.ts +6 -9
- package/src/tokens/TokenOracles/AmmPriceV2Oracle.ts +5 -5
- package/src/tokens/TokenOracles/CoingeckoOracle.ts +13 -0
- package/src/tokens/TokenOracles/TokenPriceStore.ts +1 -1
- package/src/tokens/TokenPriceService.ts +0 -1
- package/src/tokens/TokenProviders/ITokenProvider.ts +1 -1
- package/src/tokens/TokenProviders/TPChain.ts +20 -8
- package/src/tokens/TokenProviders/TPCoingecko.ts +121 -0
- package/src/tokens/TokenProviders/TPConfig.ts +53 -0
- package/src/tokens/TokenProviders/TPExplorer.ts +41 -0
- package/src/tokens/TokenService.ts +6 -3
- package/src/tokens/TokenSwapService.ts +1 -1
- package/src/tokens/TokenTransferService.ts +40 -24
- package/src/tokens/TokensService.ts +34 -179
- package/src/tokens/TokensServiceFactory.ts +13 -1
- package/src/tokens/defi/ISwapService.ts +1 -1
- package/src/tokens/defi/paraswap/Paraswap.ts +2 -1
- package/src/txs/ITxConfig.ts +1 -1
- package/src/txs/TxDataBuilder.ts +78 -34
- package/src/txs/TxLogger.ts +4 -4
- package/src/txs/TxWriter.ts +245 -48
- package/src/txs/conditional/GasWatcherTx.ts +0 -1
- package/src/txs/receipt/ITxLogItem.ts +8 -5
- package/src/txs/receipt/TxLogParser.ts +13 -2
- package/src/txs/receipt/TxLogsTransfer.ts +15 -15
- package/src/txs/receipt/TxTopicInMemoryProvider.ts +1 -1
- package/src/txs/receipt/TxTopicProvider.ts +7 -7
- package/src/txs/sig-transports/SigFileTransport.ts +52 -0
- package/src/utils/$abiParser.spec.ts +90 -0
- package/src/utils/$abiParser.ts +60 -25
- package/src/utils/$abiType.ts +195 -5
- package/src/utils/$abiUtils.ts +57 -6
- package/src/utils/$account.ts +30 -0
- package/src/utils/$address.ts +5 -0
- package/src/utils/$bigint.ts +56 -3
- package/src/utils/$block.ts +14 -1
- package/src/utils/$bloom.ts +43 -0
- package/src/utils/$buffer.ts +114 -0
- package/src/utils/$cli.ts +16 -0
- package/src/utils/$color.ts +211 -0
- package/src/utils/$config.ts +70 -7
- package/src/utils/$const.ts +1 -0
- package/src/utils/$contract.ts +21 -3
- package/src/utils/$crypto.ts +33 -0
- package/src/utils/$csv.ts +23 -7
- package/src/utils/$date.ts +194 -40
- package/src/utils/$gas.ts +17 -0
- package/src/utils/$hex.ts +72 -0
- package/src/utils/$is.ts +24 -22
- package/src/utils/$logger.ts +60 -2
- package/src/utils/$machine.ts +85 -0
- package/src/utils/$number.ts +24 -1
- package/src/utils/$path.ts +17 -1
- package/src/utils/$promise.ts +101 -0
- package/src/utils/$require.ts +15 -1
- package/src/utils/$secret.ts +27 -0
- package/src/utils/$sign.ts +115 -16
- package/src/utils/$signRaw.ts +50 -0
- package/src/utils/$signSerializer.ts +8 -6
- package/src/utils/$txData.ts +16 -0
- package/src/utils/$wallet.ts +1 -1
- package/test/Batch.spec.ts +89 -0
- package/test/BlockChainExplorer.spec.ts +33 -0
- package/test/ChainAccount.spec.ts +1 -1
- package/test/client.spec.ts +10 -11
- package/test/config.js +8 -0
- package/test/config.spec.ts +31 -0
- package/test/ecrecover.spec.ts +49 -0
- package/test/fixtures/contracts/Counter.sol +25 -0
- package/test/fixtures/contracts/Ecrecover.sol +33 -0
- package/test/fixtures/contracts/Foo.sol +32 -0
- package/test/fixtures/contracts/Foo.ts +78 -0
- package/test/fixtures/contracts/FreeToken.sol +263 -0
- package/test/fixtures/explorer/0xfbD2aa7efA2B46Ce3c58D7ab0D92C176c71499C0.html +2788 -0
- package/test/fixtures/gnosis/GnosisSafe.sol +422 -0
- package/test/fixtures/gnosis/GnosisSafeL2.sol +86 -0
- package/test/fixtures/gnosis/accessors/SimulateTxAccessor.sol +52 -0
- package/test/fixtures/gnosis/base/Executor.sol +27 -0
- package/test/fixtures/gnosis/base/FallbackManager.sol +53 -0
- package/test/fixtures/gnosis/base/GuardManager.sol +62 -0
- package/test/fixtures/gnosis/base/ModuleManager.sol +133 -0
- package/test/fixtures/gnosis/base/OwnerManager.sol +149 -0
- package/test/fixtures/gnosis/common/Enum.sol +8 -0
- package/test/fixtures/gnosis/common/EtherPaymentFallback.sol +13 -0
- package/test/fixtures/gnosis/common/SecuredTokenTransfer.sol +35 -0
- package/test/fixtures/gnosis/common/SelfAuthorized.sol +16 -0
- package/test/fixtures/gnosis/common/SignatureDecoder.sol +36 -0
- package/test/fixtures/gnosis/common/Singleton.sol +11 -0
- package/test/fixtures/gnosis/common/StorageAccessible.sol +47 -0
- package/test/fixtures/gnosis/external/GnosisSafeMath.sol +54 -0
- package/test/fixtures/gnosis/interfaces/ERC1155TokenReceiver.sol +49 -0
- package/test/fixtures/gnosis/interfaces/ERC721TokenReceiver.sol +24 -0
- package/test/fixtures/gnosis/interfaces/ERC777TokensRecipient.sol +13 -0
- package/test/fixtures/gnosis/interfaces/IERC165.sol +15 -0
- package/test/fixtures/gnosis/interfaces/ISignatureValidator.sol +20 -0
- package/test/fixtures/gnosis/interfaces/ViewStorageAccessible.sol +11 -0
- package/test/fixtures/gnosis/libraries/CreateCall.sol +30 -0
- package/test/fixtures/gnosis/libraries/GnosisSafeStorage.sol +21 -0
- package/test/fixtures/gnosis/libraries/MultiSend.sol +66 -0
- package/test/fixtures/gnosis/libraries/MultiSendCallOnly.sol +61 -0
- package/test/fixtures/gnosis/libraries/SignMessageLib.sol +34 -0
- package/test/fixtures/gnosis/proxies/GnosisSafeProxy.sol +44 -0
- package/test/fixtures/gnosis/proxies/GnosisSafeProxyFactory.sol +107 -0
- package/test/fixtures/gnosis/proxies/IProxyCreationCallback.sol +12 -0
- package/test/fixtures/scan/WETH.sol +1533 -0
- package/test/fixtures/slots/FooStorage.sol +8 -0
- package/test/fixtures/slots/FooStorageBase.sol +6 -0
- package/test/fixtures/slots/Vault.sol +85 -0
- package/test/generate/class.spec.ts +144 -6
- package/test/generate/evm.spec.ts +64 -0
- package/test/generate/openzeppelin.spec.ts +18 -0
- package/test/generate/slotreader.spec.ts +34 -0
- package/test/hardhat/TestNode.ts +37 -9
- package/test/hardhat/deploy.spec.ts +22 -0
- package/test/indexer/BlocksWalker.spec.ts +51 -0
- package/test/ns.spec.ts +4 -0
- package/test/receipt.spec.ts +1 -4
- package/test/safe/tx.act.ts +194 -0
- package/test/solidity/SlotsParser.spec.ts +186 -0
- package/test/solidity/SlotsReader.spec.ts +168 -0
- package/test/solidity/Storage.spec.ts +328 -0
- package/test/structs/PackedRanges.spec.ts +56 -0
- package/test/subscriptions.spec.ts +127 -0
- package/test/token.spec.ts +11 -0
- package/test/utils/abi-types.spec.ts +31 -0
- package/test/utils/abi-utils.spec.ts +23 -0
- package/test/utils/bigint.spec.ts +0 -1
- package/test/utils/date.spec.ts +3 -2
- package/test/utils/logbloom.spec.ts +17 -0
- package/test/utils/number.spec.ts +14 -3
- package/test/utils/sign.spec.ts +43 -7
- package/src/ChainAccounts.ts +0 -72
- package/src/structs/PackedRanges.spec.ts +0 -38
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity >=0.7.0 <0.9.0;
|
|
3
|
+
|
|
4
|
+
import "./base/ModuleManager.sol";
|
|
5
|
+
import "./base/OwnerManager.sol";
|
|
6
|
+
import "./base/FallbackManager.sol";
|
|
7
|
+
import "./base/GuardManager.sol";
|
|
8
|
+
import "./common/EtherPaymentFallback.sol";
|
|
9
|
+
import "./common/Singleton.sol";
|
|
10
|
+
import "./common/SignatureDecoder.sol";
|
|
11
|
+
import "./common/SecuredTokenTransfer.sol";
|
|
12
|
+
import "./common/StorageAccessible.sol";
|
|
13
|
+
import "./interfaces/ISignatureValidator.sol";
|
|
14
|
+
import "./external/GnosisSafeMath.sol";
|
|
15
|
+
|
|
16
|
+
/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.
|
|
17
|
+
/// @author Stefan George - <stefan@gnosis.io>
|
|
18
|
+
/// @author Richard Meissner - <richard@gnosis.io>
|
|
19
|
+
contract GnosisSafe is
|
|
20
|
+
EtherPaymentFallback,
|
|
21
|
+
Singleton,
|
|
22
|
+
ModuleManager,
|
|
23
|
+
OwnerManager,
|
|
24
|
+
SignatureDecoder,
|
|
25
|
+
SecuredTokenTransfer,
|
|
26
|
+
ISignatureValidatorConstants,
|
|
27
|
+
FallbackManager,
|
|
28
|
+
StorageAccessible,
|
|
29
|
+
GuardManager
|
|
30
|
+
{
|
|
31
|
+
using GnosisSafeMath for uint256;
|
|
32
|
+
|
|
33
|
+
string public constant VERSION = "1.3.0";
|
|
34
|
+
|
|
35
|
+
// keccak256(
|
|
36
|
+
// "EIP712Domain(uint256 chainId,address verifyingContract)"
|
|
37
|
+
// );
|
|
38
|
+
bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;
|
|
39
|
+
|
|
40
|
+
// keccak256(
|
|
41
|
+
// "SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)"
|
|
42
|
+
// );
|
|
43
|
+
bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;
|
|
44
|
+
|
|
45
|
+
event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);
|
|
46
|
+
event ApproveHash(bytes32 indexed approvedHash, address indexed owner);
|
|
47
|
+
event SignMsg(bytes32 indexed msgHash);
|
|
48
|
+
event ExecutionFailure(bytes32 txHash, uint256 payment);
|
|
49
|
+
event ExecutionSuccess(bytes32 txHash, uint256 payment);
|
|
50
|
+
|
|
51
|
+
uint256 public nonce;
|
|
52
|
+
bytes32 private _deprecatedDomainSeparator;
|
|
53
|
+
// Mapping to keep track of all message hashes that have been approved by ALL REQUIRED owners
|
|
54
|
+
mapping(bytes32 => uint256) public signedMessages;
|
|
55
|
+
// Mapping to keep track of all hashes (message or transaction) that have been approved by ANY owners
|
|
56
|
+
mapping(address => mapping(bytes32 => uint256)) public approvedHashes;
|
|
57
|
+
|
|
58
|
+
// This constructor ensures that this contract can only be used as a master copy for Proxy contracts
|
|
59
|
+
constructor() {
|
|
60
|
+
// By setting the threshold it is not possible to call setup anymore,
|
|
61
|
+
// so we create a Safe with 0 owners and threshold 1.
|
|
62
|
+
// This is an unusable Safe, perfect for the singleton
|
|
63
|
+
threshold = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/// @dev Setup function sets initial storage of contract.
|
|
67
|
+
/// @param _owners List of Safe owners.
|
|
68
|
+
/// @param _threshold Number of required confirmations for a Safe transaction.
|
|
69
|
+
/// @param to Contract address for optional delegate call.
|
|
70
|
+
/// @param data Data payload for optional delegate call.
|
|
71
|
+
/// @param fallbackHandler Handler for fallback calls to this contract
|
|
72
|
+
/// @param paymentToken Token that should be used for the payment (0 is ETH)
|
|
73
|
+
/// @param payment Value that should be paid
|
|
74
|
+
/// @param paymentReceiver Address that should receive the payment (or 0 if tx.origin)
|
|
75
|
+
function setup(
|
|
76
|
+
address[] calldata _owners,
|
|
77
|
+
uint256 _threshold,
|
|
78
|
+
address to,
|
|
79
|
+
bytes calldata data,
|
|
80
|
+
address fallbackHandler,
|
|
81
|
+
address paymentToken,
|
|
82
|
+
uint256 payment,
|
|
83
|
+
address payable paymentReceiver
|
|
84
|
+
) external {
|
|
85
|
+
// setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice
|
|
86
|
+
setupOwners(_owners, _threshold);
|
|
87
|
+
if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);
|
|
88
|
+
// As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules
|
|
89
|
+
setupModules(to, data);
|
|
90
|
+
|
|
91
|
+
if (payment > 0) {
|
|
92
|
+
// To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)
|
|
93
|
+
// baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment
|
|
94
|
+
handlePayment(payment, 0, 1, paymentToken, paymentReceiver);
|
|
95
|
+
}
|
|
96
|
+
emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.
|
|
100
|
+
/// Note: The fees are always transferred, even if the user transaction fails.
|
|
101
|
+
/// @param to Destination address of Safe transaction.
|
|
102
|
+
/// @param value Ether value of Safe transaction.
|
|
103
|
+
/// @param data Data payload of Safe transaction.
|
|
104
|
+
/// @param operation Operation type of Safe transaction.
|
|
105
|
+
/// @param safeTxGas Gas that should be used for the Safe transaction.
|
|
106
|
+
/// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)
|
|
107
|
+
/// @param gasPrice Gas price that should be used for the payment calculation.
|
|
108
|
+
/// @param gasToken Token address (or 0 if ETH) that is used for the payment.
|
|
109
|
+
/// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
|
|
110
|
+
/// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})
|
|
111
|
+
function execTransaction(
|
|
112
|
+
address to,
|
|
113
|
+
uint256 value,
|
|
114
|
+
bytes calldata data,
|
|
115
|
+
Enum.Operation operation,
|
|
116
|
+
uint256 safeTxGas,
|
|
117
|
+
uint256 baseGas,
|
|
118
|
+
uint256 gasPrice,
|
|
119
|
+
address gasToken,
|
|
120
|
+
address payable refundReceiver,
|
|
121
|
+
bytes memory signatures
|
|
122
|
+
) public payable virtual returns (bool success) {
|
|
123
|
+
bytes32 txHash;
|
|
124
|
+
// Use scope here to limit variable lifetime and prevent `stack too deep` errors
|
|
125
|
+
{
|
|
126
|
+
bytes memory txHashData =
|
|
127
|
+
encodeTransactionData(
|
|
128
|
+
// Transaction info
|
|
129
|
+
to,
|
|
130
|
+
value,
|
|
131
|
+
data,
|
|
132
|
+
operation,
|
|
133
|
+
safeTxGas,
|
|
134
|
+
// Payment info
|
|
135
|
+
baseGas,
|
|
136
|
+
gasPrice,
|
|
137
|
+
gasToken,
|
|
138
|
+
refundReceiver,
|
|
139
|
+
// Signature info
|
|
140
|
+
nonce
|
|
141
|
+
);
|
|
142
|
+
// Increase nonce and execute transaction.
|
|
143
|
+
nonce++;
|
|
144
|
+
txHash = keccak256(txHashData);
|
|
145
|
+
checkSignatures(txHash, txHashData, signatures);
|
|
146
|
+
}
|
|
147
|
+
address guard = getGuard();
|
|
148
|
+
{
|
|
149
|
+
if (guard != address(0)) {
|
|
150
|
+
Guard(guard).checkTransaction(
|
|
151
|
+
// Transaction info
|
|
152
|
+
to,
|
|
153
|
+
value,
|
|
154
|
+
data,
|
|
155
|
+
operation,
|
|
156
|
+
safeTxGas,
|
|
157
|
+
// Payment info
|
|
158
|
+
baseGas,
|
|
159
|
+
gasPrice,
|
|
160
|
+
gasToken,
|
|
161
|
+
refundReceiver,
|
|
162
|
+
// Signature info
|
|
163
|
+
signatures,
|
|
164
|
+
msg.sender
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)
|
|
169
|
+
// We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150
|
|
170
|
+
require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, "GS010");
|
|
171
|
+
// Use scope here to limit variable lifetime and prevent `stack too deep` errors
|
|
172
|
+
{
|
|
173
|
+
uint256 gasUsed = gasleft();
|
|
174
|
+
// If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)
|
|
175
|
+
// We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas
|
|
176
|
+
success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);
|
|
177
|
+
gasUsed = gasUsed.sub(gasleft());
|
|
178
|
+
// If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful
|
|
179
|
+
// This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert
|
|
180
|
+
require(success || safeTxGas != 0 || gasPrice != 0, "GS013");
|
|
181
|
+
// We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls
|
|
182
|
+
uint256 payment = 0;
|
|
183
|
+
if (gasPrice > 0) {
|
|
184
|
+
payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);
|
|
185
|
+
}
|
|
186
|
+
if (success) emit ExecutionSuccess(txHash, payment);
|
|
187
|
+
else emit ExecutionFailure(txHash, payment);
|
|
188
|
+
}
|
|
189
|
+
{
|
|
190
|
+
if (guard != address(0)) {
|
|
191
|
+
Guard(guard).checkAfterExecution(txHash, success);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function handlePayment(
|
|
197
|
+
uint256 gasUsed,
|
|
198
|
+
uint256 baseGas,
|
|
199
|
+
uint256 gasPrice,
|
|
200
|
+
address gasToken,
|
|
201
|
+
address payable refundReceiver
|
|
202
|
+
) private returns (uint256 payment) {
|
|
203
|
+
// solhint-disable-next-line avoid-tx-origin
|
|
204
|
+
address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;
|
|
205
|
+
if (gasToken == address(0)) {
|
|
206
|
+
// For ETH we will only adjust the gas price to not be higher than the actual used gas price
|
|
207
|
+
payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);
|
|
208
|
+
require(receiver.send(payment), "GS011");
|
|
209
|
+
} else {
|
|
210
|
+
payment = gasUsed.add(baseGas).mul(gasPrice);
|
|
211
|
+
require(transferToken(gasToken, receiver, payment), "GS012");
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.
|
|
217
|
+
* @param dataHash Hash of the data (could be either a message hash or transaction hash)
|
|
218
|
+
* @param data That should be signed (this is passed to an external validator contract)
|
|
219
|
+
* @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.
|
|
220
|
+
*/
|
|
221
|
+
function checkSignatures(
|
|
222
|
+
bytes32 dataHash,
|
|
223
|
+
bytes memory data,
|
|
224
|
+
bytes memory signatures
|
|
225
|
+
) public view {
|
|
226
|
+
// Load threshold to avoid multiple storage loads
|
|
227
|
+
uint256 _threshold = threshold;
|
|
228
|
+
// Check that a threshold is set
|
|
229
|
+
require(_threshold > 0, "GS001");
|
|
230
|
+
checkNSignatures(dataHash, data, signatures, _threshold);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.
|
|
235
|
+
* @param dataHash Hash of the data (could be either a message hash or transaction hash)
|
|
236
|
+
* @param data That should be signed (this is passed to an external validator contract)
|
|
237
|
+
* @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.
|
|
238
|
+
* @param requiredSignatures Amount of required valid signatures.
|
|
239
|
+
*/
|
|
240
|
+
function checkNSignatures(
|
|
241
|
+
bytes32 dataHash,
|
|
242
|
+
bytes memory data,
|
|
243
|
+
bytes memory signatures,
|
|
244
|
+
uint256 requiredSignatures
|
|
245
|
+
) public view {
|
|
246
|
+
// Check that the provided signature data is not too short
|
|
247
|
+
require(signatures.length >= requiredSignatures.mul(65), "GS020");
|
|
248
|
+
// There cannot be an owner with address 0.
|
|
249
|
+
address lastOwner = address(0);
|
|
250
|
+
address currentOwner;
|
|
251
|
+
uint8 v;
|
|
252
|
+
bytes32 r;
|
|
253
|
+
bytes32 s;
|
|
254
|
+
uint256 i;
|
|
255
|
+
for (i = 0; i < requiredSignatures; i++) {
|
|
256
|
+
(v, r, s) = signatureSplit(signatures, i);
|
|
257
|
+
if (v == 0) {
|
|
258
|
+
// If v is 0 then it is a contract signature
|
|
259
|
+
// When handling contract signatures the address of the contract is encoded into r
|
|
260
|
+
currentOwner = address(uint160(uint256(r)));
|
|
261
|
+
|
|
262
|
+
// Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes
|
|
263
|
+
// This check is not completely accurate, since it is possible that more signatures than the threshold are send.
|
|
264
|
+
// Here we only check that the pointer is not pointing inside the part that is being processed
|
|
265
|
+
require(uint256(s) >= requiredSignatures.mul(65), "GS021");
|
|
266
|
+
|
|
267
|
+
// Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)
|
|
268
|
+
require(uint256(s).add(32) <= signatures.length, "GS022");
|
|
269
|
+
|
|
270
|
+
// Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length
|
|
271
|
+
uint256 contractSignatureLen;
|
|
272
|
+
// solhint-disable-next-line no-inline-assembly
|
|
273
|
+
assembly {
|
|
274
|
+
contractSignatureLen := mload(add(add(signatures, s), 0x20))
|
|
275
|
+
}
|
|
276
|
+
require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, "GS023");
|
|
277
|
+
|
|
278
|
+
// Check signature
|
|
279
|
+
bytes memory contractSignature;
|
|
280
|
+
// solhint-disable-next-line no-inline-assembly
|
|
281
|
+
assembly {
|
|
282
|
+
// The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s
|
|
283
|
+
contractSignature := add(add(signatures, s), 0x20)
|
|
284
|
+
}
|
|
285
|
+
require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, "GS024");
|
|
286
|
+
} else if (v == 1) {
|
|
287
|
+
// If v is 1 then it is an approved hash
|
|
288
|
+
// When handling approved hashes the address of the approver is encoded into r
|
|
289
|
+
currentOwner = address(uint160(uint256(r)));
|
|
290
|
+
// Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction
|
|
291
|
+
require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, "GS025");
|
|
292
|
+
} else if (v > 30) {
|
|
293
|
+
// If v > 30 then default va (27,28) has been adjusted for eth_sign flow
|
|
294
|
+
// To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover
|
|
295
|
+
currentOwner = ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", dataHash)), v - 4, r, s);
|
|
296
|
+
} else {
|
|
297
|
+
// Default is the ecrecover flow with the provided data hash
|
|
298
|
+
// Use ecrecover with the messageHash for EOA signatures
|
|
299
|
+
currentOwner = ecrecover(dataHash, v, r, s);
|
|
300
|
+
}
|
|
301
|
+
require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, "GS026");
|
|
302
|
+
lastOwner = currentOwner;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/// @dev Allows to estimate a Safe transaction.
|
|
307
|
+
/// This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.
|
|
308
|
+
/// Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`
|
|
309
|
+
/// @param to Destination address of Safe transaction.
|
|
310
|
+
/// @param value Ether value of Safe transaction.
|
|
311
|
+
/// @param data Data payload of Safe transaction.
|
|
312
|
+
/// @param operation Operation type of Safe transaction.
|
|
313
|
+
/// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).
|
|
314
|
+
/// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.
|
|
315
|
+
function requiredTxGas(
|
|
316
|
+
address to,
|
|
317
|
+
uint256 value,
|
|
318
|
+
bytes calldata data,
|
|
319
|
+
Enum.Operation operation
|
|
320
|
+
) external returns (uint256) {
|
|
321
|
+
uint256 startGas = gasleft();
|
|
322
|
+
// We don't provide an error message here, as we use it to return the estimate
|
|
323
|
+
require(execute(to, value, data, operation, gasleft()));
|
|
324
|
+
uint256 requiredGas = startGas - gasleft();
|
|
325
|
+
// Convert response to string and return via error message
|
|
326
|
+
revert(string(abi.encodePacked(requiredGas)));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.
|
|
331
|
+
* @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.
|
|
332
|
+
*/
|
|
333
|
+
function approveHash(bytes32 hashToApprove) external {
|
|
334
|
+
require(owners[msg.sender] != address(0), "GS030");
|
|
335
|
+
approvedHashes[msg.sender][hashToApprove] = 1;
|
|
336
|
+
emit ApproveHash(hashToApprove, msg.sender);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/// @dev Returns the chain id used by this contract.
|
|
340
|
+
function getChainId() public view returns (uint256) {
|
|
341
|
+
uint256 id;
|
|
342
|
+
// solhint-disable-next-line no-inline-assembly
|
|
343
|
+
assembly {
|
|
344
|
+
id := chainid()
|
|
345
|
+
}
|
|
346
|
+
return id;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function domainSeparator() public view returns (bytes32) {
|
|
350
|
+
return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/// @dev Returns the bytes that are hashed to be signed by owners.
|
|
354
|
+
/// @param to Destination address.
|
|
355
|
+
/// @param value Ether value.
|
|
356
|
+
/// @param data Data payload.
|
|
357
|
+
/// @param operation Operation type.
|
|
358
|
+
/// @param safeTxGas Gas that should be used for the safe transaction.
|
|
359
|
+
/// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)
|
|
360
|
+
/// @param gasPrice Maximum gas price that should be used for this transaction.
|
|
361
|
+
/// @param gasToken Token address (or 0 if ETH) that is used for the payment.
|
|
362
|
+
/// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
|
|
363
|
+
/// @param _nonce Transaction nonce.
|
|
364
|
+
/// @return Transaction hash bytes.
|
|
365
|
+
function encodeTransactionData(
|
|
366
|
+
address to,
|
|
367
|
+
uint256 value,
|
|
368
|
+
bytes calldata data,
|
|
369
|
+
Enum.Operation operation,
|
|
370
|
+
uint256 safeTxGas,
|
|
371
|
+
uint256 baseGas,
|
|
372
|
+
uint256 gasPrice,
|
|
373
|
+
address gasToken,
|
|
374
|
+
address refundReceiver,
|
|
375
|
+
uint256 _nonce
|
|
376
|
+
) public view returns (bytes memory) {
|
|
377
|
+
bytes32 safeTxHash =
|
|
378
|
+
keccak256(
|
|
379
|
+
abi.encode(
|
|
380
|
+
SAFE_TX_TYPEHASH,
|
|
381
|
+
to,
|
|
382
|
+
value,
|
|
383
|
+
keccak256(data),
|
|
384
|
+
operation,
|
|
385
|
+
safeTxGas,
|
|
386
|
+
baseGas,
|
|
387
|
+
gasPrice,
|
|
388
|
+
gasToken,
|
|
389
|
+
refundReceiver,
|
|
390
|
+
_nonce
|
|
391
|
+
)
|
|
392
|
+
);
|
|
393
|
+
return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/// @dev Returns hash to be signed by owners.
|
|
397
|
+
/// @param to Destination address.
|
|
398
|
+
/// @param value Ether value.
|
|
399
|
+
/// @param data Data payload.
|
|
400
|
+
/// @param operation Operation type.
|
|
401
|
+
/// @param safeTxGas Fas that should be used for the safe transaction.
|
|
402
|
+
/// @param baseGas Gas costs for data used to trigger the safe transaction.
|
|
403
|
+
/// @param gasPrice Maximum gas price that should be used for this transaction.
|
|
404
|
+
/// @param gasToken Token address (or 0 if ETH) that is used for the payment.
|
|
405
|
+
/// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
|
|
406
|
+
/// @param _nonce Transaction nonce.
|
|
407
|
+
/// @return Transaction hash.
|
|
408
|
+
function getTransactionHash(
|
|
409
|
+
address to,
|
|
410
|
+
uint256 value,
|
|
411
|
+
bytes calldata data,
|
|
412
|
+
Enum.Operation operation,
|
|
413
|
+
uint256 safeTxGas,
|
|
414
|
+
uint256 baseGas,
|
|
415
|
+
uint256 gasPrice,
|
|
416
|
+
address gasToken,
|
|
417
|
+
address refundReceiver,
|
|
418
|
+
uint256 _nonce
|
|
419
|
+
) public view returns (bytes32) {
|
|
420
|
+
return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));
|
|
421
|
+
}
|
|
422
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity >=0.7.0 <0.9.0;
|
|
3
|
+
|
|
4
|
+
import "./GnosisSafe.sol";
|
|
5
|
+
|
|
6
|
+
/// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.
|
|
7
|
+
/// @author Stefan George - <stefan@gnosis.io>
|
|
8
|
+
/// @author Richard Meissner - <richard@gnosis.io>
|
|
9
|
+
contract GnosisSafeL2 is GnosisSafe {
|
|
10
|
+
event SafeMultiSigTransaction(
|
|
11
|
+
address to,
|
|
12
|
+
uint256 value,
|
|
13
|
+
bytes data,
|
|
14
|
+
Enum.Operation operation,
|
|
15
|
+
uint256 safeTxGas,
|
|
16
|
+
uint256 baseGas,
|
|
17
|
+
uint256 gasPrice,
|
|
18
|
+
address gasToken,
|
|
19
|
+
address payable refundReceiver,
|
|
20
|
+
bytes signatures,
|
|
21
|
+
// We combine nonce, sender and threshold into one to avoid stack too deep
|
|
22
|
+
// Dev note: additionalInfo should not contain `bytes`, as this complicates decoding
|
|
23
|
+
bytes additionalInfo
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
event SafeModuleTransaction(address module, address to, uint256 value, bytes data, Enum.Operation operation);
|
|
27
|
+
|
|
28
|
+
/// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.
|
|
29
|
+
/// Note: The fees are always transferred, even if the user transaction fails.
|
|
30
|
+
/// @param to Destination address of Safe transaction.
|
|
31
|
+
/// @param value Ether value of Safe transaction.
|
|
32
|
+
/// @param data Data payload of Safe transaction.
|
|
33
|
+
/// @param operation Operation type of Safe transaction.
|
|
34
|
+
/// @param safeTxGas Gas that should be used for the Safe transaction.
|
|
35
|
+
/// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)
|
|
36
|
+
/// @param gasPrice Gas price that should be used for the payment calculation.
|
|
37
|
+
/// @param gasToken Token address (or 0 if ETH) that is used for the payment.
|
|
38
|
+
/// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
|
|
39
|
+
/// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})
|
|
40
|
+
function execTransaction(
|
|
41
|
+
address to,
|
|
42
|
+
uint256 value,
|
|
43
|
+
bytes calldata data,
|
|
44
|
+
Enum.Operation operation,
|
|
45
|
+
uint256 safeTxGas,
|
|
46
|
+
uint256 baseGas,
|
|
47
|
+
uint256 gasPrice,
|
|
48
|
+
address gasToken,
|
|
49
|
+
address payable refundReceiver,
|
|
50
|
+
bytes memory signatures
|
|
51
|
+
) public payable override returns (bool) {
|
|
52
|
+
bytes memory additionalInfo;
|
|
53
|
+
{
|
|
54
|
+
additionalInfo = abi.encode(nonce, msg.sender, threshold);
|
|
55
|
+
}
|
|
56
|
+
emit SafeMultiSigTransaction(
|
|
57
|
+
to,
|
|
58
|
+
value,
|
|
59
|
+
data,
|
|
60
|
+
operation,
|
|
61
|
+
safeTxGas,
|
|
62
|
+
baseGas,
|
|
63
|
+
gasPrice,
|
|
64
|
+
gasToken,
|
|
65
|
+
refundReceiver,
|
|
66
|
+
signatures,
|
|
67
|
+
additionalInfo
|
|
68
|
+
);
|
|
69
|
+
return super.execTransaction(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, signatures);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// @dev Allows a Module to execute a Safe transaction without any further confirmations.
|
|
73
|
+
/// @param to Destination address of module transaction.
|
|
74
|
+
/// @param value Ether value of module transaction.
|
|
75
|
+
/// @param data Data payload of module transaction.
|
|
76
|
+
/// @param operation Operation type of module transaction.
|
|
77
|
+
function execTransactionFromModule(
|
|
78
|
+
address to,
|
|
79
|
+
uint256 value,
|
|
80
|
+
bytes memory data,
|
|
81
|
+
Enum.Operation operation
|
|
82
|
+
) public override returns (bool success) {
|
|
83
|
+
emit SafeModuleTransaction(msg.sender, to, value, data, operation);
|
|
84
|
+
success = super.execTransactionFromModule(to, value, data, operation);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity >=0.7.0 <0.9.0;
|
|
3
|
+
|
|
4
|
+
import "../base/Executor.sol";
|
|
5
|
+
|
|
6
|
+
/// @title Simulate Transaction Accessor - can be used with StorageAccessible to simulate Safe transactions
|
|
7
|
+
/// @author Richard Meissner - <richard@gnosis.pm>
|
|
8
|
+
contract SimulateTxAccessor is Executor {
|
|
9
|
+
address private immutable accessorSingleton;
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
accessorSingleton = address(this);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
modifier onlyDelegateCall() {
|
|
16
|
+
require(address(this) != accessorSingleton, "SimulateTxAccessor should only be called via delegatecall");
|
|
17
|
+
_;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function simulate(
|
|
21
|
+
address to,
|
|
22
|
+
uint256 value,
|
|
23
|
+
bytes calldata data,
|
|
24
|
+
Enum.Operation operation
|
|
25
|
+
)
|
|
26
|
+
external
|
|
27
|
+
onlyDelegateCall()
|
|
28
|
+
returns (
|
|
29
|
+
uint256 estimate,
|
|
30
|
+
bool success,
|
|
31
|
+
bytes memory returnData
|
|
32
|
+
)
|
|
33
|
+
{
|
|
34
|
+
uint256 startGas = gasleft();
|
|
35
|
+
success = execute(to, value, data, operation, gasleft());
|
|
36
|
+
estimate = startGas - gasleft();
|
|
37
|
+
// solhint-disable-next-line no-inline-assembly
|
|
38
|
+
assembly {
|
|
39
|
+
// Load free memory location
|
|
40
|
+
let ptr := mload(0x40)
|
|
41
|
+
// We allocate memory for the return data by setting the free memory location to
|
|
42
|
+
// current free memory location + data size + 32 bytes for data size value
|
|
43
|
+
mstore(0x40, add(ptr, add(returndatasize(), 0x20)))
|
|
44
|
+
// Store the size
|
|
45
|
+
mstore(ptr, returndatasize())
|
|
46
|
+
// Store the data
|
|
47
|
+
returndatacopy(add(ptr, 0x20), 0, returndatasize())
|
|
48
|
+
// Point the return data to the correct memory location
|
|
49
|
+
returnData := ptr
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity >=0.7.0 <0.9.0;
|
|
3
|
+
import "../common/Enum.sol";
|
|
4
|
+
|
|
5
|
+
/// @title Executor - A contract that can execute transactions
|
|
6
|
+
/// @author Richard Meissner - <richard@gnosis.pm>
|
|
7
|
+
contract Executor {
|
|
8
|
+
function execute(
|
|
9
|
+
address to,
|
|
10
|
+
uint256 value,
|
|
11
|
+
bytes memory data,
|
|
12
|
+
Enum.Operation operation,
|
|
13
|
+
uint256 txGas
|
|
14
|
+
) internal returns (bool success) {
|
|
15
|
+
if (operation == Enum.Operation.DelegateCall) {
|
|
16
|
+
// solhint-disable-next-line no-inline-assembly
|
|
17
|
+
assembly {
|
|
18
|
+
success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
// solhint-disable-next-line no-inline-assembly
|
|
22
|
+
assembly {
|
|
23
|
+
success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity >=0.7.0 <0.9.0;
|
|
3
|
+
|
|
4
|
+
import "../common/SelfAuthorized.sol";
|
|
5
|
+
|
|
6
|
+
/// @title Fallback Manager - A contract that manages fallback calls made to this contract
|
|
7
|
+
/// @author Richard Meissner - <richard@gnosis.pm>
|
|
8
|
+
contract FallbackManager is SelfAuthorized {
|
|
9
|
+
event ChangedFallbackHandler(address handler);
|
|
10
|
+
|
|
11
|
+
// keccak256("fallback_manager.handler.address")
|
|
12
|
+
bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;
|
|
13
|
+
|
|
14
|
+
function internalSetFallbackHandler(address handler) internal {
|
|
15
|
+
bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;
|
|
16
|
+
// solhint-disable-next-line no-inline-assembly
|
|
17
|
+
assembly {
|
|
18
|
+
sstore(slot, handler)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// @dev Allows to add a contract to handle fallback calls.
|
|
23
|
+
/// Only fallback calls without value and with data will be forwarded.
|
|
24
|
+
/// This can only be done via a Safe transaction.
|
|
25
|
+
/// @param handler contract to handle fallback calls.
|
|
26
|
+
function setFallbackHandler(address handler) public authorized {
|
|
27
|
+
internalSetFallbackHandler(handler);
|
|
28
|
+
emit ChangedFallbackHandler(handler);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// solhint-disable-next-line payable-fallback,no-complex-fallback
|
|
32
|
+
fallback() external {
|
|
33
|
+
bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;
|
|
34
|
+
// solhint-disable-next-line no-inline-assembly
|
|
35
|
+
assembly {
|
|
36
|
+
let handler := sload(slot)
|
|
37
|
+
if iszero(handler) {
|
|
38
|
+
return(0, 0)
|
|
39
|
+
}
|
|
40
|
+
calldatacopy(0, 0, calldatasize())
|
|
41
|
+
// The msg.sender address is shifted to the left by 12 bytes to remove the padding
|
|
42
|
+
// Then the address without padding is stored right after the calldata
|
|
43
|
+
mstore(calldatasize(), shl(96, caller()))
|
|
44
|
+
// Add 20 bytes for the address appended add the end
|
|
45
|
+
let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)
|
|
46
|
+
returndatacopy(0, 0, returndatasize())
|
|
47
|
+
if iszero(success) {
|
|
48
|
+
revert(0, returndatasize())
|
|
49
|
+
}
|
|
50
|
+
return(0, returndatasize())
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|