-
Notifications
You must be signed in to change notification settings - Fork 109
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
Showing
82 changed files
with
7,565 additions
and
1,170 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ROLLUP_CREATOR_ADDRESS="" | ||
ARBISCAN_API_KEY="" | ||
## deployer key | ||
DEVNET_PRIVKEY="" | ||
|
||
## optional - address of already deployed ERC20 token which shall be used as rollup's fee token | ||
FEE_TOKEN_ADDRESS="" |
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 |
---|---|---|
|
@@ -6,3 +6,6 @@ deployments/ | |
/test/prover/spec-proofs/*.json | ||
/test/storage/*-old.dot | ||
scripts/config.ts | ||
forge-cache/ | ||
out/ | ||
.env |
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,3 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ coverage/** | |
deployments/** | ||
src/lib/abi/** | ||
.nyc_output | ||
out/** | ||
lib/** |
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,14 @@ | ||
[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
libs = ['node_modules', 'lib'] | ||
test = 'test/foundry' | ||
cache_path = 'forge-cache' | ||
optimizer = true | ||
optimizer_runs = 20000 | ||
via_ir = false | ||
|
||
[fmt] | ||
number_underscore = 'thousands' | ||
line_length = 100 | ||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
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,5 @@ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
forge-std/=lib/forge-std/src/ | ||
|
||
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ | ||
@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/ |
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,41 @@ | ||
import { ethers } from 'hardhat' | ||
import '@nomiclabs/hardhat-ethers' | ||
import { Signer } from 'ethers' | ||
import { createRollup } from './rollupCreation' | ||
import { TestToken__factory } from '../build/types' | ||
|
||
async function deployERC20Token(deployer: Signer): Promise<string> { | ||
const factory = await new TestToken__factory(deployer).deploy( | ||
ethers.utils.parseEther('1000000000') | ||
) | ||
const feeToken = await factory.deployed() | ||
|
||
return feeToken.address | ||
} | ||
|
||
async function main() { | ||
const [deployer] = await ethers.getSigners() | ||
|
||
let customFeeTokenAddress = process.env.FEE_TOKEN_ADDRESS | ||
if (!customFeeTokenAddress) { | ||
console.log( | ||
'FEE_TOKEN_ADDRESS env var not provided, deploying new ERC20 token' | ||
) | ||
customFeeTokenAddress = await deployERC20Token(deployer) | ||
} | ||
if (!ethers.utils.isAddress(customFeeTokenAddress)) { | ||
throw new Error( | ||
'Fee token address ' + customFeeTokenAddress + ' is not a valid address!' | ||
) | ||
} | ||
|
||
console.log('Creating new rollup with', customFeeTokenAddress, 'as fee token') | ||
await createRollup(customFeeTokenAddress) | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error: Error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) |
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,13 @@ | ||
import '@nomiclabs/hardhat-ethers' | ||
import { createRollup } from './rollupCreation' | ||
|
||
async function main() { | ||
await createRollup() | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error: Error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) |
Oops, something went wrong.