Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for deploying ERC20 rollups #43

Merged
merged 9 commits into from
Aug 7, 2023
5 changes: 4 additions & 1 deletion .env.sample.goerli
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
ROLLUP_CREATOR_ADDRESS=""
ARBISCAN_API_KEY=""
## deployer key
DEVNET_PRIVKEY=""
DEVNET_PRIVKEY=""

## optional - address of already deployed ERC20 token which shall be used as rollup's fee token
FEE_TOKEN_ADDRESS=""
9 changes: 8 additions & 1 deletion scripts/createERC20Rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ async function deployERC20Token(deployer: Signer): Promise<string> {

async function main() {
const [deployer] = await ethers.getSigners()
const customFeeTokenAddress = await deployERC20Token(deployer)

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)
}
Comment on lines +22 to +28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to check if the supplied value is an valid address in else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


console.log('Creating new rollup with', customFeeTokenAddress, 'as fee token')
await createRollup(customFeeTokenAddress)
Expand Down