mirror of
https://github.com/tornadocash/tornado-deploy.git
synced 2025-01-15 23:47:56 +01:00
polygon
This commit is contained in:
parent
111d200753
commit
82cf36bcd7
@ -6,6 +6,6 @@ SALT=0x1234000000000000000000000000000000000000000000000000000047941987
|
|||||||
|
|
||||||
|
|
||||||
PRIVATE_KEY=0x
|
PRIVATE_KEY=0x
|
||||||
RPC_URL=https://bsc-dataseed.binance.org/
|
RPC_URL=
|
||||||
NET_ID=56
|
NET_ID=137
|
||||||
GAS_PRICE_IN_WEI=5000000000
|
GAS_PRICE_IN_WEI=5000000000
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone --recursive https://github.com/tornadocash/tornado-deploy -b bsc
|
git clone --recursive https://github.com/tornadocash/tornado-deploy -b polygon
|
||||||
cd tornado-deploy
|
cd tornado-deploy
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
yarn
|
yarn
|
||||||
|
46
instances.js
46
instances.js
@ -1,30 +1,30 @@
|
|||||||
module.exports = [
|
module.exports = [
|
||||||
{
|
|
||||||
isETH: true,
|
|
||||||
denomination: '100000000000000000',
|
|
||||||
domain: 'bnb-01.tornadocash.eth',
|
|
||||||
symbol: 'BNB',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
isETH: true,
|
|
||||||
denomination: '1000000000000000000',
|
|
||||||
domain: 'bnb-1.tornadocash.eth',
|
|
||||||
symbol: 'BNB',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
isETH: true,
|
|
||||||
denomination: '10000000000000000000',
|
|
||||||
domain: 'bnb-10.tornadocash.eth',
|
|
||||||
symbol: 'BNB',
|
|
||||||
decimals: 18,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
isETH: true,
|
isETH: true,
|
||||||
denomination: '100000000000000000000',
|
denomination: '100000000000000000000',
|
||||||
domain: 'bnb-100.tornadocash.eth',
|
domain: 'matic-100.tornadocash.eth',
|
||||||
symbol: 'BNB',
|
symbol: 'MATIC',
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
isETH: true,
|
||||||
|
denomination: '1000000000000000000000',
|
||||||
|
domain: 'matic-1000.tornadocash.eth',
|
||||||
|
symbol: 'MATIC',
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
isETH: true,
|
||||||
|
denomination: '10000000000000000000000',
|
||||||
|
domain: 'matic-10000.tornadocash.eth',
|
||||||
|
symbol: 'MATIC',
|
||||||
|
decimals: 18,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
isETH: true,
|
||||||
|
denomination: '100000000000000000000000',
|
||||||
|
domain: 'matic-100000.tornadocash.eth',
|
||||||
|
symbol: 'MATIC',
|
||||||
decimals: 18,
|
decimals: 18,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -4,12 +4,14 @@ const actions = require('../actions.json')
|
|||||||
const abi = require('../abi/deployer.abi.json')
|
const abi = require('../abi/deployer.abi.json')
|
||||||
|
|
||||||
const prefix = {
|
const prefix = {
|
||||||
1: '',
|
1: 'etherscan.io',
|
||||||
42: 'kovan.',
|
42: 'kovan.etherscan.io',
|
||||||
5: 'goerli.',
|
5: 'goerli.etherscan.io',
|
||||||
|
56: 'bscscan.com',
|
||||||
|
137: 'polygonscan.com',
|
||||||
}
|
}
|
||||||
|
|
||||||
const explorer = `https://${prefix[process.env.NET_ID]}etherscan.io`
|
const explorer = `https://${prefix[process.env.NET_ID]}`
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const privateKey = process.env.PRIVATE_KEY
|
const privateKey = process.env.PRIVATE_KEY
|
||||||
@ -27,8 +29,8 @@ async function main() {
|
|||||||
const tx = await wallet.sendTransaction({
|
const tx = await wallet.sendTransaction({
|
||||||
to: actions.eipDeployer.from,
|
to: actions.eipDeployer.from,
|
||||||
value: ethers.utils.parseEther('0.0247').sub(balance).toHexString(),
|
value: ethers.utils.parseEther('0.0247').sub(balance).toHexString(),
|
||||||
gasLimit: ethers.BigNumber.from(800000).toHexString(), // 800k because of arbitrum
|
gasLimit: ethers.BigNumber.from(250000).toHexString(),
|
||||||
gasPrice: 1e6,
|
gasPrice: 100e9,
|
||||||
})
|
})
|
||||||
console.log('Tx hash:', tx.hash)
|
console.log('Tx hash:', tx.hash)
|
||||||
}
|
}
|
||||||
@ -47,7 +49,7 @@ async function main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
console.log(`Deploying ${action.contract} to ${action.domain} (${action.expectedAddress})`)
|
console.log(`Deploying ${action.contract} to ${action.domain} (${action.expectedAddress})`)
|
||||||
const tx = await deployer.deploy(action.bytecode, actions.salt, { gasLimit: 70e6, gasPrice: 1e9 })
|
const tx = await deployer.deploy(action.bytecode, actions.salt, { gasLimit: 3e6, gasPrice: 5e9 })
|
||||||
console.log(`TX hash ${explorer}/tx/${tx.hash}`)
|
console.log(`TX hash ${explorer}/tx/${tx.hash}`)
|
||||||
try {
|
try {
|
||||||
await tx.wait()
|
await tx.wait()
|
||||||
@ -59,7 +61,7 @@ async function main() {
|
|||||||
console.error(`Failed to deploy ${action.contract}, sending debug tx`)
|
console.error(`Failed to deploy ${action.contract}, sending debug tx`)
|
||||||
// const trace = await provider.send('debug_traceTransaction', [ tx.hash ])
|
// const trace = await provider.send('debug_traceTransaction', [ tx.hash ])
|
||||||
// console.log(trace)
|
// console.log(trace)
|
||||||
const tx2 = await wallet.sendTransaction({ gasLimit: 70e6, gasPrice: 1e9, data: action.bytecode })
|
const tx2 = await wallet.sendTransaction({ gasLimit: 3e6, gasPrice: 5e9, data: action.bytecode })
|
||||||
console.log(`TX hash ${explorer}/tx/${tx2.hash}`)
|
console.log(`TX hash ${explorer}/tx/${tx2.hash}`)
|
||||||
await tx2.wait()
|
await tx2.wait()
|
||||||
console.log('Mined, check revert reason on etherscan')
|
console.log('Mined, check revert reason on etherscan')
|
||||||
|
Loading…
Reference in New Issue
Block a user