forked from 0xPolygonHermez/zkevm-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7cbfed
commit 97e0c1a
Showing
12 changed files
with
81 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ coverage | |
artifacts/ | ||
docs/interfaces | ||
docs/mocks | ||
.vscode/launch.json | ||
.vscode/launch.json | ||
deploy_output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.formatOnSave": false, | ||
"solidity.linter": "solhint", | ||
"solidity.compileUsingRemoteVersion": "v0.8.9" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Docker deployment | ||
|
||
By default the following mnemonic will be used to deploy the smart contracts `MNEMONIC="test test test test test test test test test test test junk"`. | ||
Also the first 20 accounts of this mnemonic will be funded with ether. | ||
The first account of the mnemonic will be the deployer of the smart contracts and therefore the holder of all the MATIC test tokens, which are necessary to pay the `sendBatch` transactions. | ||
You can change the deployment `mnemonic` creating a `.env` file in the project root with the following variable: | ||
`MNEMONIC=<YOUR_MENMONIC>` | ||
|
||
## Requirements | ||
|
||
- node version: 14.x | ||
- npm version: 7.x | ||
- docker | ||
- docker-compose | ||
|
||
## Build dockers | ||
|
||
In project root execute: | ||
|
||
``` | ||
npm i | ||
npm run dockerContracts | ||
``` | ||
|
||
A new docker `hermez-geth1.3:latest` will be created | ||
This docker will contain a geth node with the deployed contracts | ||
The deployment output can be found in: `docker/deploymentOutput/deploy_output.json` | ||
To run the docker you can use: `docker run -p 8545:8545 hermez-geth1.3:latest` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
|
||
const ethers = require('ethers'); | ||
require('dotenv').config(); | ||
|
||
const DEFAULT_MNEMONIC = 'test test test test test test test test test test test junk'; | ||
const DEFAULT_NUM_ACCOUNTS = 20; | ||
|
||
async function main() { | ||
const MNEMONIC = process.env.MNEMONIC || DEFAULT_MNEMONIC; | ||
const currentProvider = new ethers.providers.JsonRpcProvider('http://localhost:8545'); | ||
const signerNode = await currentProvider.getSigner(); | ||
const numAccountsToFund = process.env.NUM_ACCOUNTS || DEFAULT_NUM_ACCOUNTS; | ||
|
||
for (let i = 0; i < numAccountsToFund; i++) { | ||
const pathWallet = `m/44'/60'/0'/0/${i}`; | ||
const accountWallet = ethers.Wallet.fromMnemonic(MNEMONIC, pathWallet); | ||
const params = [{ | ||
from: await signerNode.getAddress(), | ||
to: accountWallet.address, | ||
value: '0x3635C9ADC5DEA00000', | ||
}]; | ||
const tx = await currentProvider.send('eth_sendTransaction', params); | ||
if (i === numAccountsToFund - 1) { | ||
await currentProvider.waitForTransaction(tx); | ||
} | ||
} | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters