Commit graph

48 commits

Author SHA1 Message Date
f840069ecb
update copyright dates 2026-02-11 13:02:12 +00:00
09e70c4bf3
whitespace (82 files) 2025-10-06 09:40:47 +00:00
2b7080c227
subprocess.run(): use text arg (10 files) 2025-10-03 10:34:04 +00:00
ef2e7789b5
scripts/create-token.py: move Solidity code template to external file 2025-03-25 09:46:01 +00:00
e54f039690
update copyright dates 2025-02-16 14:42:27 +00:00
de6750a34b
whitespace: scripts, setup.py, other 2024-10-18 10:32:11 +00:00
5150ca586b
update file header 2024-10-18 10:32:06 +00:00
f6843a3fcd
opts.py: refactor usage(), version(), show_hash_presets() 2024-10-08 12:56:00 +00:00
5f22d2fbde
scripts/create-token.py: support solc version 0.8.26 2024-07-08 10:51:21 +00:00
8e46932475
update copyright dates 2024-01-19 11:05:10 +00:00
ArchLinux Container
e847f8802d
scripts/create-token.py: silence Solidity warnings 2023-12-12 10:19:51 +00:00
4c49a6e59c
launch test and helper scripts with main.launch() 2023-12-12 10:19:51 +00:00
64d7434f59
scripts: add script_init mod 2023-12-12 10:19:50 +00:00
7140b76100
minor cleanups 2023-12-12 10:19:49 +00:00
7b32c412d5
pylint (test suite) - imports 2023-10-11 12:58:51 +00:00
01430166e5
whitespace, comments, docstrings (test suite) 2023-10-11 12:58:51 +00:00
f626fc2e05
missing import fixes throughout 2023-10-03 14:27:57 +00:00
11ee212fe8
helper scripts: import cleanups 2023-10-03 14:27:56 +00:00
9e1935ad19
opts.init() -> Config() 2023-04-04 16:04:10 +00:00
c7adb56e38
Config API, Part I
This patch eliminates the global configuration variables `opt` and `g`, making
all functions and class instances locally configurable.  Configuration data is
passed to functions and constructors via the `cfg` parameter and made available
to methods in `self.cfg`.

Local configuration free from dependence on the command line will enable the
creation of multiple, independently configured instances of MMGen’s data
objects within a single process.

Potential applications include testing (tracking wallets configured to interact
with spawned processes, for example) and the use of MMGen as a library for
other projects.

This patch completes most of the work required to enable the API.  The full
implementation will appear in a forthcoming commit.
2023-03-28 18:14:37 +00:00
78e882143c
whitespace, cleanups, imports throughout [73 files changed] 2023-03-27 10:49:04 +00:00
1aeefd64ae
update copyright dates 2023-01-03 10:36:07 +00:00
830d07cde2
minor fixes 2022-04-23 14:36:08 +00:00
71d7986391
minor fixes and cleanups 2022-02-06 13:28:44 +00:00
41376eb515
new MMGenSystemExit exception; remove rdie(), ydie() 2022-02-05 13:32:56 +00:00
1a896d9af9
update copyright dates 2022-01-04 19:51:22 +00:00
906f0320d1
minor fixes and cleanups 2021-09-23 21:15:32 +00:00
9c5f4de936
scripts/create-token.py, test.py oneshot_warning; minor fixes 2021-09-05 18:40:44 +00:00
530571f610
scripts/create-token.py: cleanups, sanity checks 2021-09-04 18:34:09 +00:00
eaeeef97c0
test.py ethdev: update solc to v0.8.7, update precompiled contract data 2021-09-03 20:17:25 +00:00
4742255ad2
test.py ethdev, scripts/create-token.py: cleanups 2021-09-03 20:17:25 +00:00
cb7f38370b
Update copyright dates 2021-02-19 20:09:06 +03:00
c3f185e8b0
eliminate use of global vars g.proto, g.coin, g.rpc and others
This patch eliminates nearly all the global variables that changed during the
execution of scripts.  With a few minor exceptions, global vars are now used
only during initialization or reserved for cfg file / cmdline options and other
unchanging values.

The result is a code base that's much more maintainable and extensible and less
error-prone.  The autosigning code, which supports signing of transactions for
multiple protocols and networks, has been greatly simplified.

Doing away with globals required many changes throughout the code base, and
other related (and not so related) changes and cleanups were made along the
way, resulting in an enormous patch.

Additional code changes include:

    - tx.py: complete reorganization of TX classes and use of nesting

    - protocol.py: separation of Regtest and Testnet into distinct subclasses
      with separate address and transaction files and file extensions

    - new module help.py for the help notes, loaded on demand

    - addr.py: rewrite of the address file label parsing code

    - tx.py,tw.py: use of generators to create formatted text

User-visible changes include:

    - importing of addresses for tokens not yet in the user's tracking wallet
      is now performed with the `--token-addr` option instead of `--token`

Testing:

    Testing this patch requires a full run of the test suite as described on the
    Test-Suite wiki page.
2020-05-28 09:53:34 +00:00
9489b1cb2d
string formatting, whitespace, minor cleanups throughout 2020-05-26 14:53:44 +00:00
673b97b3b8
update copyright dates 2020-02-18 14:07:27 +00:00
6cf4fcc7e4
Use subprocess.run() throughout, related cleanups 2019-10-23 09:31:21 +00:00
017ecef3bc
[opts]: separate code from text in opts_data
- When parsing opts, opts.init() now looks only at string values from
  opts_data.  Global variables are evaluated only when printing help text,
  after the variables are initialized
2019-03-26 15:59:37 +03:00
634fb2e444
py3port: use dictionary comprehensions where applicable 2019-03-16 20:45:44 +03:00
514c1100ee Update copyright dates 2019-02-12 21:35:12 +03:00
80564f6efd py3port: allow solc v0.5.1 or v0.5.3, update ethdev test vectors accordingly 2019-02-10 22:25:03 +03:00
fb07b089be py3port: ERC20: support/require Solidity compiler version 0.5.3 2019-02-06 14:05:37 +03:00
c2675c15ed
py3port: headers 2018-11-17 23:34:04 +03:00
44eb299442
py3port: revert some changes made by 2to3 2018-11-01 20:34:29 +03:00
04329b6757
py3port: use encode() and decode() where applicable 2018-10-31 17:16:00 +03:00
949e42ebf4
py3port: 2to3 on all files
The result of running 2to3-2.7 on all Python files in the repository.
2018-10-30 19:31:14 +03:00
f0fea335eb
py3port: update hashbangs
This is the first commit of the MMGen Python 3 port.  Branch 'py3port', against
master branch commit ab06ca4

Commits are groupings of similar or related changes: automatic changes first,
followed by repetitive and global changes, followed by specific ones

All commits until the final one will leave the branch in a broken state
2018-10-30 19:23:12 +03:00
d4eb8f6ac0
Full Ethereum Classic (ETC) + ERC20 token support
As with ETH transacting support, this feature is in beta phase

All key functionality works, for both ETC and ETC tokens:
- Tracking wallet: getbalance, twview, listaddresses
- TX create, send, sign
- TX bumping
- ERC20 token creation, deployment

For usage details, see https://github.com/mmgen/mmgen/wiki/Altcoin-and-Forkcoin-Support

Differences from ETH:
- Start Parity with --jsonrpc-port=8555 (or --ports-shift=10) and --chain=classic
- Launch MMGen commands with --coin=etc
2018-10-02 21:09:48 +03:00
881d55993f
ERC20 token support (create/deploy, TX create/sign/send)
This feature is EXPERIMENTAL.  Until v0.9.9 is released, mainnet use is
strictly at your own risk!

To test on dev chain, run 'test/test.py -e ethdev'

To test on Kovan, add '--testnet=1' option to all commands below

Transaction example:

    Generate some ETH addresses with your default wallet:
    $ mmgen-addrgen --coin=eth 1-5

    Create an EOS token tracking wallet and import the addresses into it:
    $ mmgen-addrimport --coin=eth --token=86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0 ABCDABCD-ETH[1-5].addrs

    Send 10+ EOS from an exchange or another wallet to address ABCDABCD:E:1

    Create a TX sending 10 EOS to address aabbccdd..., with change to ABCDABCD:E:2:
    $ mmgen-txcreate --coin=eth --token=eos aabbccddaabbccddaabbccddaabbccddaabbccdd,10 ABCDABCD:E:2

    On your offline machine, sign the TX:
    $ mmgen-txsign --coin=eth --token=eos ABC123-EOS[10,50000].rawtx

    On your online machine, send the TX:
    $ mmgen-txsend --coin=eth --token=eos ABC123-EOS[10,50000].sigtx

    View your EOS tracking wallet:
    $ mmgen-tool --coin=eth --token=eos twview

Token creation/deployment example:

    Install the Solidity compiler ('solc') on your system.

    Create a token 'MFT' with default parameters, owned by ddeeff... (ABCDABCD:E:1):
    $ scripts/create-token.py --symbol=MFT --name='My First Token' ddeeffddeeffddeeffddeeffddeeffddeeffddee

    Deploy the token on the ETH blockchain:
    $ mmgen-txdo --coin=eth --tx-gas=200000 --contract-data=SafeMath.bin
    $ mmgen-txdo --coin=eth --tx-gas=250000 --contract-data=Owned.bin
    $ mmgen-txdo --coin=eth --tx-gas=1100000 --contract-data=Token.bin
    ...
    Token address: abcd1234abcd1234abcd1234abcd1234abcd1234

    Create an MFT token tracking wallet and import your ETH addresses into it:
    $ mmgen-addrimport --coin=eth --token=abcd1234abcd1234abcd1234abcd1234abcd1234 ABCDABCD-ETH[1-5].addrs

    View your MFT tracking wallet:
    $ mmgen-tool --coin=eth --token=mft twview
2018-07-25 15:57:04 +03:00