Apply multicall for multiple contract calls

- lint cli.js
- fixed test networks with getGasPrice
- replace mainnet proxy to new one that supports relayer registry, fixes #39
- fixed rounding error with bignumber.js
This commit is contained in:
Ayanami 2022-02-27 07:32:30 +09:00
parent d55ca374e4
commit 894d4d3a96
No known key found for this signature in database
GPG Key ID: 0CABDF03077D92E4
4 changed files with 580 additions and 525 deletions

@ -1,4 +1,4 @@
# Tornado cli
# Tornado-CLI
Command line tool to interact with [Tornado Cash](https://tornadocash.eth.link).

@ -0,0 +1 @@
[{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Multicall.Call[]","name":"calls","type":"tuple[]"}],"name":"aggregate","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes[]","name":"returnData","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getBlockHash","outputs":[{"internalType":"bytes32","name":"blockHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockCoinbase","outputs":[{"internalType":"address","name":"coinbase","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockDifficulty","outputs":[{"internalType":"uint256","name":"difficulty","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockGasLimit","outputs":[{"internalType":"uint256","name":"gaslimit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentBlockTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getEthBalance","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLastBlockHash","outputs":[{"internalType":"bytes32","name":"blockHash","type":"bytes32"}],"stateMutability":"view","type":"function"}]

968
cli.js Executable file → Normal file

File diff suppressed because it is too large Load Diff

@ -115,7 +115,8 @@ module.exports = {
'decimals': 8,
'gasLimit': '85000'
},
proxy: '0x722122dF12D4e14e13Ac3b6895a86e84145b6967',
proxy: '0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b',
multicall: '0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441',
},
netId5: {
'eth': {
@ -231,6 +232,7 @@ module.exports = {
'gasLimit': '85000'
},
proxy: '0x454d870a72e29d5e5697f635128d18077bd04c60',
multicall: '0x77dCa2C955b15e9dE4dbBCf1246B4B85b651e50e',
},
netId56: {
'bnb': {
@ -251,6 +253,7 @@ module.exports = {
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
multicall: '0x41263cBA59EB80dC200F3E2544eda4ed6A90E76C',
},
netId100: {
'xdai': {
@ -271,6 +274,7 @@ module.exports = {
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
multicall: '0xb5b692a88BDFc81ca69dcB1d924f59f0413A602a',
},
netId137: {
'matic': {
@ -291,6 +295,7 @@ module.exports = {
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
multicall: '0x11ce4B23bD875D7F5C6a31084f55fDe1e9A87507',
},
netId42161: {
'eth': {
@ -311,6 +316,7 @@ module.exports = {
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
multicall: '0xB064Fe785d8131653eE12f3581F9A55F6D6E1ca3',
},
netId43114: {
'avax': {
@ -329,6 +335,7 @@ module.exports = {
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
multicall: '0x98e2060F672FD1656a07bc12D7253b5e41bF3876',
},
netId10: {
'eth': {
@ -349,6 +356,7 @@ module.exports = {
'decimals': 18
},
proxy: '0x0D5550d52428E7e3175bfc9550207e4ad3859b17',
multicall: '0x142E2FEaC30d7fc3b61f9EE85FCCad8e560154cc',
},
}
}