From 1e422b2c2b72b4b58ca75ecad0e91552e13bd1cc Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 10 Mar 2025 14:28:55 +0000 Subject: [PATCH] support Rust Ethereum client (Reth) Tested on Linux only Testing: $ test/cmdtest.py --coin=eth --daemon-id=reth ethdev --- MANIFEST.in | 1 + mmgen/daemon.py | 2 +- mmgen/data/version | 2 +- mmgen/proto/eth/daemon.py | 14 +++++- mmgen/proto/eth/params.py | 2 + mmgen/proto/eth/rpc.py | 6 ++- mmgen/proto/eth/tx/status.py | 2 +- test/cmdtest_d/ct_ethdev.py | 47 ++++++++++++++++--- test/daemontest_d/ut_rpc.py | 2 +- .../bin/{ => geth}/mm1/ERC20Interface.bin | 0 .../ref/ethereum/bin/{ => geth}/mm1/Owned.bin | 0 .../ethereum/bin/{ => geth}/mm1/SafeMath.bin | 0 .../ref/ethereum/bin/{ => geth}/mm1/Token.bin | 0 .../bin/{ => geth}/mm2/ERC20Interface.bin | 0 .../ref/ethereum/bin/{ => geth}/mm2/Owned.bin | 0 .../ethereum/bin/{ => geth}/mm2/SafeMath.bin | 0 .../ref/ethereum/bin/{ => geth}/mm2/Token.bin | 0 .../ethereum/bin/reth/mm1/ERC20Interface.bin | 0 test/ref/ethereum/bin/reth/mm1/Owned.bin | 1 + test/ref/ethereum/bin/reth/mm1/SafeMath.bin | 1 + test/ref/ethereum/bin/reth/mm1/Token.bin | 1 + .../ethereum/bin/reth/mm2/ERC20Interface.bin | 0 test/ref/ethereum/bin/reth/mm2/Owned.bin | 1 + test/ref/ethereum/bin/reth/mm2/SafeMath.bin | 1 + test/ref/ethereum/bin/reth/mm2/Token.bin | 1 + 25 files changed, 71 insertions(+), 13 deletions(-) rename test/ref/ethereum/bin/{ => geth}/mm1/ERC20Interface.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm1/Owned.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm1/SafeMath.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm1/Token.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm2/ERC20Interface.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm2/Owned.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm2/SafeMath.bin (100%) rename test/ref/ethereum/bin/{ => geth}/mm2/Token.bin (100%) create mode 100644 test/ref/ethereum/bin/reth/mm1/ERC20Interface.bin create mode 100644 test/ref/ethereum/bin/reth/mm1/Owned.bin create mode 100644 test/ref/ethereum/bin/reth/mm1/SafeMath.bin create mode 100644 test/ref/ethereum/bin/reth/mm1/Token.bin create mode 100644 test/ref/ethereum/bin/reth/mm2/ERC20Interface.bin create mode 100644 test/ref/ethereum/bin/reth/mm2/Owned.bin create mode 100644 test/ref/ethereum/bin/reth/mm2/SafeMath.bin create mode 100644 test/ref/ethereum/bin/reth/mm2/Token.bin diff --git a/MANIFEST.in b/MANIFEST.in index ffb665c3..dd014752 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,6 +16,7 @@ include test/*/*.py include test/ref/* include test/ref/*/* include test/ref/*/*/*/* +include test/ref/*/*/*/*/* include test/overlay/fakemods/mmgen/*.py include test/overlay/fakemods/mmgen/*/*.py include test/overlay/fakemods/mmgen/*/*/*/*.py diff --git a/mmgen/daemon.py b/mmgen/daemon.py index 7aaa67a3..81a7e5d3 100755 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -287,7 +287,7 @@ class CoinDaemon(Daemon): 'BCH': _cd(['bitcoin_cash_node']), 'LTC': _cd(['litecoin_core']), 'XMR': _cd(['monero']), - 'ETH': _cd(['geth', 'erigon', 'openethereum']), + 'ETH': _cd(['geth', 'reth', 'erigon', 'openethereum']), 'ETC': _cd(['parity']), } diff --git a/mmgen/data/version b/mmgen/data/version index eaaddb10..cb4d67a4 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -15.1.dev18 +15.1.dev19 diff --git a/mmgen/proto/eth/daemon.py b/mmgen/proto/eth/daemon.py index 0f6b4771..4e926036 100755 --- a/mmgen/proto/eth/daemon.py +++ b/mmgen/proto/eth/daemon.py @@ -113,19 +113,29 @@ class geth_daemon(ethereum_daemon): def init_subclass(self): self.coind_args = list_gen( - ['--verbosity=0'], + ['node', self.id == 'reth'], + ['--quiet', self.id == 'reth'], + ['--verbosity=0', self.id == 'geth'], ['--ipcdisable'], # IPC-RPC: if path to socket is longer than 108 chars, geth fails to start ['--http'], ['--http.api=eth,web3,txpool'], [f'--http.port={self.rpc_port}'], [f'--authrpc.port={self.authrpc_port}'], [f'--port={self.p2p_port}', self.p2p_port], # geth binds p2p port even with --maxpeers=0 - ['--maxpeers=0', not self.opt.online], + ['--maxpeers=0', self.id == 'geth' and not self.opt.online], [f'--datadir={self.datadir}', self.non_dfl_datadir], ['--holesky', self.network=='testnet'], ['--dev', self.network=='regtest'], ) +class reth_daemon(geth_daemon): + daemon_data = _dd('Reth', 1002002, '1.2.2') + version_pat = r'reth/v(\d+)\.(\d+)\.(\d+)' + exec_fn = 'reth' + datadirs = { + 'linux': [gc.home_dir, '.local', 'share', 'reth'], + } + # https://github.com/ledgerwatch/erigon class erigon_daemon(geth_daemon): daemon_data = _dd('Erigon', 2022099099, '2022.99.99') diff --git a/mmgen/proto/eth/params.py b/mmgen/proto/eth/params.py index db78bae6..748a2b98 100755 --- a/mmgen/proto/eth/params.py +++ b/mmgen/proto/eth/params.py @@ -38,6 +38,7 @@ class mainnet(CoinProtocol.DummyWIF, CoinProtocol.Secp256k1): avg_bdi = 15 decimal_prec = 36 + # https://www.chainid.dev chain_ids = { 1: 'ethereum', # ethereum mainnet 2: 'morden', # morden testnet (deprecated) @@ -50,6 +51,7 @@ class mainnet(CoinProtocol.DummyWIF, CoinProtocol.Secp256k1): 17: 'developmentchain', # parity dev chain 1337: 'developmentchain', # geth dev chain 711: 'ethereum', # geth mainnet (empty chain) + 17000: 'holesky', # proof-of-stake testnet } coin_cfg_opts = ( diff --git a/mmgen/proto/eth/rpc.py b/mmgen/proto/eth/rpc.py index fa583ef9..be55291f 100755 --- a/mmgen/proto/eth/rpc.py +++ b/mmgen/proto/eth/rpc.py @@ -25,6 +25,10 @@ class daemon_warning(oneshot_warning_group): color = 'yellow' message = 'Geth has not been tested on mainnet. You may experience problems.' + class reth: + color = 'yellow' + message = 'Reth has not been tested on mainnet. You may experience problems.' + class erigon: color = 'red' message = 'Erigon support is EXPERIMENTAL. Use at your own risk!!!' @@ -80,7 +84,7 @@ class EthereumRPCClient(RPCClient, metaclass=AsyncInit): self.caps += ('full_node',) self.chainID = None if ci is None else Int(ci, 16) # parity/oe return chainID only for dev chain self.chain = (await self.call('parity_chain')).replace(' ', '_').replace('_testnet', '') - elif self.daemon.id in ('geth', 'erigon'): + elif self.daemon.id in ('geth', 'reth', 'erigon'): if self.daemon.network == 'mainnet': daemon_warning(self.daemon.id) self.caps += ('full_node',) diff --git a/mmgen/proto/eth/tx/status.py b/mmgen/proto/eth/tx/status.py index 03e77928..6e50e178 100755 --- a/mmgen/proto/eth/tx/status.py +++ b/mmgen/proto/eth/tx/status.py @@ -33,7 +33,7 @@ class Status(TxBase.Status): return False if tx.rpc.daemon.id in ('parity', 'openethereum'): pool = [x['hash'] for x in await tx.rpc.call('parity_pendingTransactions')] - elif tx.rpc.daemon.id in ('geth', 'erigon'): + elif tx.rpc.daemon.id in ('geth', 'reth', 'erigon'): res = await tx.rpc.call('txpool_content') pool = list(res['pending']) + list(res['queued']) return '0x'+tx.coin_txid in pool diff --git a/test/cmdtest_d/ct_ethdev.py b/test/cmdtest_d/ct_ethdev.py index 7f982064..868ad91c 100755 --- a/test/cmdtest_d/ct_ethdev.py +++ b/test/cmdtest_d/ct_ethdev.py @@ -20,7 +20,7 @@ test.cmdtest_d.ct_ethdev: Ethdev tests for the cmdtest.py test suite """ -import sys, os, re, shutil, asyncio, json +import sys, time, os, re, shutil, asyncio, json from decimal import Decimal from collections import namedtuple from subprocess import run, PIPE, DEVNULL @@ -66,6 +66,15 @@ dfl_sid = '98831F3A' dfl_devaddr = '00a329c0648769a73afac7f9381e08fb43dbea72' dfl_devkey = '4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7' +def get_reth_dev_keypair(): + from mmgen.bip39 import bip39 + from mmgen.bip_hd import MasterNode + mn = 'test test test test test test test test test test test junk' # See ‘reth node --help’ + seed = bip39().generate_seed(mn.split()) + m = MasterNode(cfg, seed) + node = m.to_chain(idx=0, coin='eth').derive_private(0) + return (node.key.hex(), node.address) + burn_addr = 'deadbeef'*5 burn_addr2 = 'beadcafe'*5 @@ -85,6 +94,16 @@ def set_vbals(daemon_id): vbal6 = '999904.14880104212345678' vbal7 = '999902.91891764212345678' vbal9 = '1.2262504' + elif daemon_id == 'reth': + vbal1 = '1.2288334' + vbal2 = '99.996560752' + vbal3 = '1.23142525' + vbal3 = '1.2314176' + vbal4 = '127.0287834' + vbal5 = '999904.14775104212345678' + vbal6 = '999904.14880104212345678' + vbal7 = '999902.91891764212345678' + vbal9 = '1.2262504' else: vbal1 = '1.2288396' vbal2 = '99.997088092' @@ -409,6 +428,10 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): from mmgen.daemon import CoinDaemon self.daemon = CoinDaemon( cfg, self.proto.coin+'_rt', test_suite=True) + if self.daemon.id == 'reth': + global dfl_devkey, dfl_devaddr + dfl_devkey, dfl_devaddr = get_reth_dev_keypair() + set_vbals(self.daemon.id) self.using_solc = check_solc_ver() @@ -432,16 +455,21 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): from mmgen.rpc import rpc_init return await rpc_init(cfg, self.proto) + def mining_delay(self): # workaround for mining race condition in dev mode + if self.daemon.id == 'reth': + time.sleep(0.5) + async def setup(self): self.spawn('', msg_only=True) d = self.daemon if not self.using_solc: - srcdir = os.path.join(self.tr.repo_root, 'test', 'ref', 'ethereum', 'bin') + subdir = 'reth' if d.id == 'reth' else 'geth' + srcdir = os.path.join(self.tr.repo_root, 'test', 'ref', 'ethereum', 'bin', subdir) from shutil import copytree - for d in ('mm1', 'mm2'): - copytree(os.path.join(srcdir, d), os.path.join(self.tmpdir, d)) + for _ in ('mm1', 'mm2'): + copytree(os.path.join(srcdir, _), os.path.join(self.tmpdir, _)) if d.id in ('geth', 'erigon'): self.genesis_setup(d) @@ -575,6 +603,8 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): [f'--coin={self.proto.coin}', '--regtest=1', 'eth_getBalance', '0x'+dfl_devaddr, 'latest']) if self.daemon.id == 'geth': t.expect('0x33b2e3c91ec0e9113986000') + elif self.daemon.id == 'reth': + t.expect('0xd3c21bcecceda1000000') return t async def _wallet_upgrade(self, src_fn, expect1, expect2=None): @@ -763,6 +793,7 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): return self.bal(n='3') def tx_status(self, ext, expect_str, expect_str2='', add_args=[], exit_val=0): + self.mining_delay() ext = ext.format('-α' if cfg.debug_utf8 else '') txfile = self.get_file_with_ext(ext, no_dot=True) t = self.spawn( @@ -893,6 +924,7 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): return self.bal(n='5') def bal(self, n): + self.mining_delay() t = self.spawn('mmgen-tool', self.eth_args + ['twview', 'wide=1']) text = t.read(strip_color=True) for addr, amt in bals(n): @@ -903,6 +935,7 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): return t def token_bal(self, n=None): + self.mining_delay() t = self.spawn('mmgen-tool', self.eth_args + ['--token=mm1', 'twview', 'wide=1']) text = t.read(strip_color=True) for addr, _amt1, _amt2 in token_bals(n): @@ -982,8 +1015,8 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): return self.token_compile(token_data) async def get_tx_receipt(self, txid): - if self.daemon.id == 'geth': # yet another Geth bug - await asyncio.sleep(0.5) + if self.daemon.id in ('geth', 'reth'): # workaround for mining race condition in dev mode + await asyncio.sleep(1 if self.daemon.id == 'reth' else 0.5) from mmgen.tx import NewTX tx = await NewTX(cfg=cfg, proto=self.proto, target='tx') tx.rpc = await self.rpc @@ -1313,6 +1346,8 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared): def _txcreate_refresh_balances(self, bals, args, total, adj_total, total_coin): + self.mining_delay() + if total_coin is None: total_coin = self.proto.coin diff --git a/test/daemontest_d/ut_rpc.py b/test/daemontest_d/ut_rpc.py index 03f331b6..672716a1 100755 --- a/test/daemontest_d/ut_rpc.py +++ b/test/daemontest_d/ut_rpc.py @@ -201,7 +201,7 @@ class unit_tests: 'rpc_port': 32323, # ignored 'btc_tw_name': 'ignored', 'tw_name': 'also-ignored', - 'eth_testnet_chain_names': ['goerli', 'foo', 'bar', 'baz'], + 'eth_testnet_chain_names': ['goerli', 'holesky', 'foo', 'bar', 'baz'], }) async def erigon(self, name, ut): diff --git a/test/ref/ethereum/bin/mm1/ERC20Interface.bin b/test/ref/ethereum/bin/geth/mm1/ERC20Interface.bin similarity index 100% rename from test/ref/ethereum/bin/mm1/ERC20Interface.bin rename to test/ref/ethereum/bin/geth/mm1/ERC20Interface.bin diff --git a/test/ref/ethereum/bin/mm1/Owned.bin b/test/ref/ethereum/bin/geth/mm1/Owned.bin similarity index 100% rename from test/ref/ethereum/bin/mm1/Owned.bin rename to test/ref/ethereum/bin/geth/mm1/Owned.bin diff --git a/test/ref/ethereum/bin/mm1/SafeMath.bin b/test/ref/ethereum/bin/geth/mm1/SafeMath.bin similarity index 100% rename from test/ref/ethereum/bin/mm1/SafeMath.bin rename to test/ref/ethereum/bin/geth/mm1/SafeMath.bin diff --git a/test/ref/ethereum/bin/mm1/Token.bin b/test/ref/ethereum/bin/geth/mm1/Token.bin similarity index 100% rename from test/ref/ethereum/bin/mm1/Token.bin rename to test/ref/ethereum/bin/geth/mm1/Token.bin diff --git a/test/ref/ethereum/bin/mm2/ERC20Interface.bin b/test/ref/ethereum/bin/geth/mm2/ERC20Interface.bin similarity index 100% rename from test/ref/ethereum/bin/mm2/ERC20Interface.bin rename to test/ref/ethereum/bin/geth/mm2/ERC20Interface.bin diff --git a/test/ref/ethereum/bin/mm2/Owned.bin b/test/ref/ethereum/bin/geth/mm2/Owned.bin similarity index 100% rename from test/ref/ethereum/bin/mm2/Owned.bin rename to test/ref/ethereum/bin/geth/mm2/Owned.bin diff --git a/test/ref/ethereum/bin/mm2/SafeMath.bin b/test/ref/ethereum/bin/geth/mm2/SafeMath.bin similarity index 100% rename from test/ref/ethereum/bin/mm2/SafeMath.bin rename to test/ref/ethereum/bin/geth/mm2/SafeMath.bin diff --git a/test/ref/ethereum/bin/mm2/Token.bin b/test/ref/ethereum/bin/geth/mm2/Token.bin similarity index 100% rename from test/ref/ethereum/bin/mm2/Token.bin rename to test/ref/ethereum/bin/geth/mm2/Token.bin diff --git a/test/ref/ethereum/bin/reth/mm1/ERC20Interface.bin b/test/ref/ethereum/bin/reth/mm1/ERC20Interface.bin new file mode 100644 index 00000000..e69de29b diff --git a/test/ref/ethereum/bin/reth/mm1/Owned.bin b/test/ref/ethereum/bin/reth/mm1/Owned.bin new file mode 100644 index 00000000..a59ab085 --- /dev/null +++ b/test/ref/ethereum/bin/reth/mm1/Owned.bin @@ -0,0 +1 @@ +6080604052348015600f57600080fd5b50600080546001600160a01b031916331790556101ca806100316000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806379ba5097146100515780638da5cb5b1461005b578063d4ee1d901461008a578063f2fde38b1461009d575b600080fd5b6100596100b0565b005b60005461006e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60015461006e906001600160a01b031681565b6100596100ab366004610164565b61012b565b6001546001600160a01b031633146100c757600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b0316331461014257600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561017657600080fd5b81356001600160a01b038116811461018d57600080fd5b939250505056fea2646970667358221220bcd3e32a06d3bc97ce1339e72449373355373643c31c80385ca5f89938aca39c64736f6c634300081a0033 \ No newline at end of file diff --git a/test/ref/ethereum/bin/reth/mm1/SafeMath.bin b/test/ref/ethereum/bin/reth/mm1/SafeMath.bin new file mode 100644 index 00000000..15f55c7f --- /dev/null +++ b/test/ref/ethereum/bin/reth/mm1/SafeMath.bin @@ -0,0 +1 @@ +6080604052348015600f57600080fd5b506102018061001f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063a293d1e814610051578063b5931f7c14610076578063d05c78da14610089578063e6cb90131461009c575b600080fd5b61006461005f366004610134565b6100af565b60405190815260200160405180910390f35b610064610084366004610134565b6100cf565b610064610097366004610134565b6100e7565b6100646100aa366004610134565b610119565b6000828211156100be57600080fd5b6100c8828461016c565b9392505050565b60008082116100dd57600080fd5b6100c8828461017f565b60006100f382846101a1565b905082158061010a575081610108848361017f565b145b61011357600080fd5b92915050565b600061012582846101b8565b90508281101561011357600080fd5b6000806040838503121561014757600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561011357610113610156565b60008261019c57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761011357610113610156565b808201808211156101135761011361015656fea264697066735822122081e009254874ff32aa4fa09f9d8a315bf6a4e9e870bfb5d8b4e6611f659ed84964736f6c634300081a0033 \ No newline at end of file diff --git a/test/ref/ethereum/bin/reth/mm1/Token.bin b/test/ref/ethereum/bin/reth/mm1/Token.bin new file mode 100644 index 00000000..6678dafc --- /dev/null +++ b/test/ref/ethereum/bin/reth/mm1/Token.bin @@ -0,0 +1 @@ +608060405234801561001057600080fd5b50600080546001600160a01b0319163317905560408051808201909152600381527f4d4d3100000000000000000000000000000000000000000000000000000000006020820152600290610064908261021c565b5060408051808201909152600d81527f4d4d47656e20546f6b656e20310000000000000000000000000000000000000060208201526003906100a6908261021c565b506004805460ff191660121790556a52b7d2dcc80cd2e4000000600581905573f39fd6e51aad88f6f4ce6ab8827279cfffb92266600081815260066020527fc50c4d60f8bbb6a70920d195c8852bc6d816d9f7bc643b500261fc4d9a03f08c839055604051919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9161013e9190815260200190565b60405180910390a36102da565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600181811c9082168061018e57607f821691505b6020821081036101c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561021757806000526020600020601f840160051c810160208510156101f45750805b601f840160051c820191505b818110156102145760008155600101610200565b50505b505050565b81516001600160401b038111156102355761023561014b565b61024981610243845461017a565b846101cd565b6020601f82116001811461027d57600083156102655750848201515b600019600385901b1c1916600184901b178455610214565b600084815260208120601f198516915b828110156102ad578785015182556020948501946001909201910161028d565b50848210156102cb5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6109d4806102e96000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806395d89b41116100ad578063d4ee1d9011610071578063d4ee1d901461026a578063dc39d06d1461027d578063dd62ed3e14610290578063e6cb9013146102c9578063f2fde38b146102dc57600080fd5b806395d89b4114610216578063a293d1e81461021e578063a9059cbb14610231578063b5931f7c14610244578063d05c78da1461025757600080fd5b8063313ce567116100f4578063313ce567146101905780633eaaf86b146101af57806370a08231146101b857806379ba5097146101e15780638da5cb5b146101eb57600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016757806323b872dd1461017d575b600080fd5b61012e6102ef565b60405161013b919061078c565b60405180910390f35b6101576101523660046107f6565b61037d565b604051901515815260200161013b565b61016f6103ea565b60405190815260200161013b565b61015761018b366004610820565b610428565b60045461019d9060ff1681565b60405160ff909116815260200161013b565b61016f60055481565b61016f6101c636600461085d565b6001600160a01b031660009081526006602052604090205490565b6101e9610526565b005b6000546101fe906001600160a01b031681565b6040516001600160a01b03909116815260200161013b565b61012e6105a1565b61016f61022c366004610878565b6105ae565b61015761023f3660046107f6565b6105ce565b61016f610252366004610878565b610665565b61016f610265366004610878565b61067d565b6001546101fe906001600160a01b031681565b61015761028b3660046107f6565b6106a9565b61016f61029e36600461089a565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b61016f6102d7366004610878565b610738565b6101e96102ea36600461085d565b610753565b600380546102fc906108cd565b80601f0160208091040260200160405190810160405280929190818152602001828054610328906108cd565b80156103755780601f1061034a57610100808354040283529160200191610375565b820191906000526020600020905b81548152906001019060200180831161035857829003601f168201915b505050505081565b3360008181526007602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103d89086815260200190565b60405180910390a35060015b92915050565b600080805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854600554610423919061091d565b905090565b6001600160a01b03831660009081526006602052604081205461044b90836105ae565b6001600160a01b038516600090815260066020908152604080832093909355600781528282203383529052205461048290836105ae565b6001600160a01b0380861660009081526007602090815260408083203384528252808320949094559186168152600690915220546104c09083610738565b6001600160a01b0380851660008181526006602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105149086815260200190565b60405180910390a35060019392505050565b6001546001600160a01b0316331461053d57600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600280546102fc906108cd565b6000828211156105bd57600080fd5b6105c7828461091d565b9392505050565b336000908152600660205260408120546105e890836105ae565b33600090815260066020526040808220929092556001600160a01b038516815220546106149083610738565b6001600160a01b0384166000818152600660205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103d89086815260200190565b600080821161067357600080fd5b6105c78284610930565b60006106898284610952565b90508215806106a057508161069e8483610930565b145b6103e457600080fd5b600080546001600160a01b031633146106c157600080fd5b60005460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490529084169063a9059cbb906044016020604051808303816000875af1158015610714573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c79190610969565b6000610744828461098b565b9050828110156103e457600080fd5b6000546001600160a01b0316331461076a57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b602081526000825180602084015260005b818110156107ba576020818601810151604086840101520161079d565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146107f157600080fd5b919050565b6000806040838503121561080957600080fd5b610812836107da565b946020939093013593505050565b60008060006060848603121561083557600080fd5b61083e846107da565b925061084c602085016107da565b929592945050506040919091013590565b60006020828403121561086f57600080fd5b6105c7826107da565b6000806040838503121561088b57600080fd5b50508035926020909101359150565b600080604083850312156108ad57600080fd5b6108b6836107da565b91506108c4602084016107da565b90509250929050565b600181811c908216806108e157607f821691505b60208210810361090157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156103e4576103e4610907565b60008261094d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103e4576103e4610907565b60006020828403121561097b57600080fd5b815180151581146105c757600080fd5b808201808211156103e4576103e461090756fea2646970667358221220299ee83885ce93b80837471c34fe20f092548246f4c35a17d0119e232d83d1f164736f6c634300081a0033 \ No newline at end of file diff --git a/test/ref/ethereum/bin/reth/mm2/ERC20Interface.bin b/test/ref/ethereum/bin/reth/mm2/ERC20Interface.bin new file mode 100644 index 00000000..e69de29b diff --git a/test/ref/ethereum/bin/reth/mm2/Owned.bin b/test/ref/ethereum/bin/reth/mm2/Owned.bin new file mode 100644 index 00000000..4bd32f2e --- /dev/null +++ b/test/ref/ethereum/bin/reth/mm2/Owned.bin @@ -0,0 +1 @@ +6080604052348015600f57600080fd5b50600080546001600160a01b031916331790556101ca806100316000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806379ba5097146100515780638da5cb5b1461005b578063d4ee1d901461008a578063f2fde38b1461009d575b600080fd5b6100596100b0565b005b60005461006e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60015461006e906001600160a01b031681565b6100596100ab366004610164565b61012b565b6001546001600160a01b031633146100c757600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b0316331461014257600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561017657600080fd5b81356001600160a01b038116811461018d57600080fd5b939250505056fea2646970667358221220099e0ef07629964c2926acd072d60ab552ff4e436a34052b97f44c2afb36e84664736f6c634300081a0033 \ No newline at end of file diff --git a/test/ref/ethereum/bin/reth/mm2/SafeMath.bin b/test/ref/ethereum/bin/reth/mm2/SafeMath.bin new file mode 100644 index 00000000..8bb6bcf5 --- /dev/null +++ b/test/ref/ethereum/bin/reth/mm2/SafeMath.bin @@ -0,0 +1 @@ +6080604052348015600f57600080fd5b506102018061001f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063a293d1e814610051578063b5931f7c14610076578063d05c78da14610089578063e6cb90131461009c575b600080fd5b61006461005f366004610134565b6100af565b60405190815260200160405180910390f35b610064610084366004610134565b6100cf565b610064610097366004610134565b6100e7565b6100646100aa366004610134565b610119565b6000828211156100be57600080fd5b6100c8828461016c565b9392505050565b60008082116100dd57600080fd5b6100c8828461017f565b60006100f382846101a1565b905082158061010a575081610108848361017f565b145b61011357600080fd5b92915050565b600061012582846101b8565b90508281101561011357600080fd5b6000806040838503121561014757600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561011357610113610156565b60008261019c57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761011357610113610156565b808201808211156101135761011361015656fea264697066735822122045f0003b01e5d932310b9838629204723acd115b8e8d8a25145a9d08e21cce6164736f6c634300081a0033 \ No newline at end of file diff --git a/test/ref/ethereum/bin/reth/mm2/Token.bin b/test/ref/ethereum/bin/reth/mm2/Token.bin new file mode 100644 index 00000000..1ba72416 --- /dev/null +++ b/test/ref/ethereum/bin/reth/mm2/Token.bin @@ -0,0 +1 @@ +608060405234801561001057600080fd5b50600080546001600160a01b0319163317905560408051808201909152600381527f4d4d3200000000000000000000000000000000000000000000000000000000006020820152600290610064908261021c565b5060408051808201909152600d81527f4d4d47656e20546f6b656e20320000000000000000000000000000000000000060208201526003906100a6908261021c565b506004805460ff191660121790556a52b7d2dcc80cd2e4000000600581905573f39fd6e51aad88f6f4ce6ab8827279cfffb92266600081815260066020527fc50c4d60f8bbb6a70920d195c8852bc6d816d9f7bc643b500261fc4d9a03f08c839055604051919290917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9161013e9190815260200190565b60405180910390a36102da565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600181811c9082168061018e57607f821691505b6020821081036101c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561021757806000526020600020601f840160051c810160208510156101f45750805b601f840160051c820191505b818110156102145760008155600101610200565b50505b505050565b81516001600160401b038111156102355761023561014b565b61024981610243845461017a565b846101cd565b6020601f82116001811461027d57600083156102655750848201515b600019600385901b1c1916600184901b178455610214565b600084815260208120601f198516915b828110156102ad578785015182556020948501946001909201910161028d565b50848210156102cb5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6109d4806102e96000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806395d89b41116100ad578063d4ee1d9011610071578063d4ee1d901461026a578063dc39d06d1461027d578063dd62ed3e14610290578063e6cb9013146102c9578063f2fde38b146102dc57600080fd5b806395d89b4114610216578063a293d1e81461021e578063a9059cbb14610231578063b5931f7c14610244578063d05c78da1461025757600080fd5b8063313ce567116100f4578063313ce567146101905780633eaaf86b146101af57806370a08231146101b857806379ba5097146101e15780638da5cb5b146101eb57600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016757806323b872dd1461017d575b600080fd5b61012e6102ef565b60405161013b919061078c565b60405180910390f35b6101576101523660046107f6565b61037d565b604051901515815260200161013b565b61016f6103ea565b60405190815260200161013b565b61015761018b366004610820565b610428565b60045461019d9060ff1681565b60405160ff909116815260200161013b565b61016f60055481565b61016f6101c636600461085d565b6001600160a01b031660009081526006602052604090205490565b6101e9610526565b005b6000546101fe906001600160a01b031681565b6040516001600160a01b03909116815260200161013b565b61012e6105a1565b61016f61022c366004610878565b6105ae565b61015761023f3660046107f6565b6105ce565b61016f610252366004610878565b610665565b61016f610265366004610878565b61067d565b6001546101fe906001600160a01b031681565b61015761028b3660046107f6565b6106a9565b61016f61029e36600461089a565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b61016f6102d7366004610878565b610738565b6101e96102ea36600461085d565b610753565b600380546102fc906108cd565b80601f0160208091040260200160405190810160405280929190818152602001828054610328906108cd565b80156103755780601f1061034a57610100808354040283529160200191610375565b820191906000526020600020905b81548152906001019060200180831161035857829003601f168201915b505050505081565b3360008181526007602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103d89086815260200190565b60405180910390a35060015b92915050565b600080805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854600554610423919061091d565b905090565b6001600160a01b03831660009081526006602052604081205461044b90836105ae565b6001600160a01b038516600090815260066020908152604080832093909355600781528282203383529052205461048290836105ae565b6001600160a01b0380861660009081526007602090815260408083203384528252808320949094559186168152600690915220546104c09083610738565b6001600160a01b0380851660008181526006602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105149086815260200190565b60405180910390a35060019392505050565b6001546001600160a01b0316331461053d57600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600280546102fc906108cd565b6000828211156105bd57600080fd5b6105c7828461091d565b9392505050565b336000908152600660205260408120546105e890836105ae565b33600090815260066020526040808220929092556001600160a01b038516815220546106149083610738565b6001600160a01b0384166000818152600660205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103d89086815260200190565b600080821161067357600080fd5b6105c78284610930565b60006106898284610952565b90508215806106a057508161069e8483610930565b145b6103e457600080fd5b600080546001600160a01b031633146106c157600080fd5b60005460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490529084169063a9059cbb906044016020604051808303816000875af1158015610714573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c79190610969565b6000610744828461098b565b9050828110156103e457600080fd5b6000546001600160a01b0316331461076a57600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b602081526000825180602084015260005b818110156107ba576020818601810151604086840101520161079d565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146107f157600080fd5b919050565b6000806040838503121561080957600080fd5b610812836107da565b946020939093013593505050565b60008060006060848603121561083557600080fd5b61083e846107da565b925061084c602085016107da565b929592945050506040919091013590565b60006020828403121561086f57600080fd5b6105c7826107da565b6000806040838503121561088b57600080fd5b50508035926020909101359150565b600080604083850312156108ad57600080fd5b6108b6836107da565b91506108c4602084016107da565b90509250929050565b600181811c908216806108e157607f821691505b60208210810361090157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156103e4576103e4610907565b60008261094d57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103e4576103e4610907565b60006020828403121561097b57600080fd5b815180151581146105c757600080fd5b808201808211156103e4576103e461090756fea2646970667358221220a9285bb1b6a5e31fb138eb27f50737df642ae8dae073851057d3f502291d5ee564736f6c634300081a0033 \ No newline at end of file