@leapdao/split-tx
v1.0.1
Published
Lightweight (1.2Kb zipped) CLI to encode/decode `splitERC20` call of [PaymentSplitter contract](https://github.com/leapdao/leap-contracts/blob/master/contracts/misc/PaymentSplitter.sol).
Downloads
4
Readme
Splitter contract message data encoder/decoder
Lightweight (1.2Kb zipped) CLI to encode/decode splitERC20
call of PaymentSplitter contract.
Usage
Decode
npx @leapdao/split-tx decode <message data>
Encode
npx @leapdao/split-tx encode <address 1> <value 1> [<address 2> <value 2> ...] [<token address>]
DAI split (default)
Example:
$ npx @leapdao/split-tx encode 0x0b03dd1c2D88c9Af8caF287c3063776B7d07D441 100 0x33f9Cd1cCC15211B3468ff52b2052b5f7D6C5D86 200 0x0e9cc8982a24472364F74E9290D337d1C62D9E63 125.5
Output:
Token to split: 0x6b175474e89094c44da98b954eedeac495271d0f
split:
100.0 → 0x0b03dd1c2D88c9Af8caF287c3063776B7d07D441
200.0 → 0x33f9Cd1cCC15211B3468ff52b2052b5f7D6C5D86
125.5 → 0x0e9cc8982a24472364F74E9290D337d1C62D9E63
Total: 425.5
Message data for splitERC20 call:
0x5669312a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000b03dd1c2d88c9af8caf287c3063776b7d07d44100000000000000000000000033f9cd1ccc15211b3468ff52b2052b5f7d6c5d860000000000000000000000000e9cc8982a24472364f74e9290d337d1c62d9e6300000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac6200000000000000000000000000000000000000000000000000006cda991128f860000
Custom token split
$ npx @leapdao/split-tx encode 0x0b03dd1c2D88c9Af8caF287c3063776B7d07D441 100 0x33f9Cd1cCC15211B3468ff52b2052b5f7D6C5D86 200 0x0e9cc8982a24472364F74E9290D337d1C62D9E63 125.5 0x78230e69d6e6449db1e11904e0bd81c018454d7a
Output:
Token to split: 0x78230e69d6e6449db1e11904e0bd81c018454d7a
split:
100.0 → 0x0b03dd1c2D88c9Af8caF287c3063776B7d07D441
200.0 → 0x33f9Cd1cCC15211B3468ff52b2052b5f7D6C5D86
125.5 → 0x0e9cc8982a24472364F74E9290D337d1C62D9E63
Total: 425.5
Message data for splitERC20 call:
0x5669312a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000078230e69d6e6449db1e11904e0bd81c018454d7a00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000b03dd1c2d88c9af8caf287c3063776b7d07d44100000000000000000000000033f9cd1ccc15211b3468ff52b2052b5f7d6c5d860000000000000000000000000e9cc8982a24472364f74e9290d337d1c62d9e6300000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000ad78ebc5ac6200000000000000000000000000000000000000000000000000006cda991128f860000