-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from OffchainLabs/develop
release: 1.1.0
- Loading branch information
Showing
93 changed files
with
8,190 additions
and
1,290 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
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,3 +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
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,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,33 @@ | ||
import { ethers } from 'ethers' | ||
|
||
// 90% of Geth's 128KB tx size limit, leaving ~13KB for proving | ||
// This need to be adjusted for Orbit chains | ||
export const maxDataSize = 117964 | ||
|
||
export const config = { | ||
rollupConfig: { | ||
confirmPeriodBlocks: ethers.BigNumber.from('45818'), | ||
extraChallengeTimeBlocks: ethers.BigNumber.from('200'), | ||
stakeToken: ethers.constants.AddressZero, | ||
baseStake: ethers.utils.parseEther('1'), | ||
wasmModuleRoot: | ||
'0xda4e3ad5e7feacb817c21c8d0220da7650fe9051ece68a3f0b1c5d38bbb27b21', | ||
owner: '0x1234123412341234123412341234123412341234', | ||
loserStakeEscrow: ethers.constants.AddressZero, | ||
chainId: ethers.BigNumber.from('13331370'), | ||
chainConfig: | ||
'{"chainId":13331370,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0x1234123412341234123412341234123412341234","GenesisBlockNum":0}}', | ||
genesisBlockNum: ethers.BigNumber.from('0'), | ||
sequencerInboxMaxTimeVariation: { | ||
delayBlocks: ethers.BigNumber.from('5760'), | ||
futureBlocks: ethers.BigNumber.from('12'), | ||
delaySeconds: ethers.BigNumber.from('86400'), | ||
futureSeconds: ethers.BigNumber.from('3600'), | ||
}, | ||
}, | ||
validators: [ | ||
'0x1234123412341234123412341234123412341234', | ||
'0x1234512345123451234512345123451234512345', | ||
], | ||
batchPoster: '0x1234123412341234123412341234123412341234', | ||
} |
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.