-
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
Showing
43 changed files
with
1,051 additions
and
450 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
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 @@ | ||
export {}; |
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,54 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const arbitrum_orbit_toolkit_1 = require("arbitrum-orbit-toolkit"); | ||
const viem_1 = require("viem"); | ||
const accounts_1 = require("viem/accounts"); | ||
function validateParams(params) { | ||
if (!params || typeof params !== "object") { | ||
throw new Error("Invalid params: must be an object"); | ||
} | ||
const requiredFields = [ | ||
"parentChainRpc", | ||
"orbitChainRpc", | ||
"chainId", | ||
"chainName", | ||
"chainNetworkName", | ||
"nativeCurrency", | ||
"ownerPrivateKey", | ||
"rollupAddress", | ||
"upgradeExecutor", | ||
"newExecutors", | ||
]; | ||
for (const field of requiredFields) { | ||
if (!(field in params)) { | ||
throw new Error(`Missing required field: ${field}`); | ||
} | ||
} | ||
} | ||
async function main() { | ||
const params = JSON.parse(process.argv[2]); | ||
validateParams(params); | ||
const parentChainClient = (0, viem_1.createPublicClient)({ | ||
transport: (0, viem_1.http)(params.parentChainRpc), | ||
}); | ||
const orbitChainClient = (0, arbitrum_orbit_toolkit_1.createOrbitChainClient)(params.chainId, params.chainName, params.chainNetworkName, { | ||
name: params.currencyName, | ||
symbol: params.currencySymbol, | ||
decimals: params.currencyDecimals, | ||
}, params.orbitChainRpc, params.rollupAddress); | ||
let account = (0, accounts_1.privateKeyToAccount)(params.ownerPrivateKey); | ||
try { | ||
const result = await (0, arbitrum_orbit_toolkit_1.addPrivilegedExecutors)({ | ||
rollupAddress: params.rollupAddress, | ||
newExecutors: params.newExecutors, | ||
upgradeExecutor: params.upgradeExecutor, | ||
owner: account, | ||
}, parentChainClient, orbitChainClient); | ||
console.log(JSON.stringify({ transactionHash: result })); | ||
} | ||
catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
} | ||
main().catch(console.error); |
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 @@ | ||
export {}; |
47 changes: 47 additions & 0 deletions
47
blueprints/arbitrum-orbit/dist/configure-fast-withdrawals.js
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,47 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const arbitrum_orbit_toolkit_1 = require("arbitrum-orbit-toolkit"); | ||
const viem_1 = require("viem"); | ||
const accounts_1 = require("viem/accounts"); | ||
function validateParams(params) { | ||
if (!params || typeof params !== "object") { | ||
throw new Error("Invalid params: must be an object"); | ||
} | ||
const requiredFields = [ | ||
"parentChainRpc", | ||
"ownerPrivateKey", | ||
"ownerAddress", | ||
"rollupAddress", | ||
"upgradeExecutor", | ||
"minimumAssertionPeriod", | ||
"fastConfirmer", | ||
]; | ||
for (const field of requiredFields) { | ||
if (!(field in params)) { | ||
throw new Error(`Missing required field: ${field}`); | ||
} | ||
} | ||
} | ||
async function main() { | ||
const params = JSON.parse(process.argv[2]); | ||
validateParams(params); | ||
const parentChainClient = (0, viem_1.createPublicClient)({ | ||
transport: (0, viem_1.http)(params.parentChainRpc), | ||
}); | ||
const account = (0, accounts_1.privateKeyToAccount)(params.ownerPrivateKey); | ||
try { | ||
const result = await (0, arbitrum_orbit_toolkit_1.setupFastWithdrawal)({ | ||
rollupAddress: params.rollupAddress, | ||
owner: account, | ||
upgradeExecutor: params.upgradeExecutor, | ||
minimumAssertionPeriod: params.minimumAssertionPeriod, | ||
fastConfirmer: params.fastConfirmer, | ||
}, parentChainClient); | ||
console.log(JSON.stringify(result)); | ||
} | ||
catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
} | ||
main().catch(console.error); |
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 @@ | ||
export {}; |
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 @@ | ||
export {}; |
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,53 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const arbitrum_orbit_toolkit_1 = require("arbitrum-orbit-toolkit"); | ||
const viem_1 = require("viem"); | ||
const accounts_1 = require("viem/accounts"); | ||
function validateParams(params) { | ||
if (!params || typeof params !== "object") { | ||
throw new Error("Invalid params: must be an object"); | ||
} | ||
const requiredFields = [ | ||
"parentChainRpc", | ||
"orbitChainRpc", | ||
"chainName", | ||
"chainNetworkName", | ||
"currencyName", | ||
"currencySymbol", | ||
"currencyDecimals", | ||
"ownerPrivateKey", | ||
"rollupAddress", | ||
"nativeToken", | ||
]; | ||
for (const field of requiredFields) { | ||
if (!(field in params)) { | ||
throw new Error(`Missing required field: ${field}`); | ||
} | ||
} | ||
} | ||
async function main() { | ||
const params = JSON.parse(process.argv[2]); | ||
validateParams(params); | ||
const parentChainClient = (0, viem_1.createPublicClient)({ | ||
transport: (0, viem_1.http)(params.parentChainRpc), | ||
}); | ||
const orbitChainClient = (0, arbitrum_orbit_toolkit_1.createOrbitChainClient)(params.orbitChainId, params.chainName, params.chainNetworkName, { | ||
name: params.currencyName, | ||
symbol: params.currencySymbol, | ||
decimals: params.currencyDecimals, | ||
}, params.orbitChainRpc, params.rollupAddress); | ||
const account = (0, accounts_1.privateKeyToAccount)(params.ownerPrivateKey); | ||
try { | ||
const result = await (0, arbitrum_orbit_toolkit_1.createTokenBridge)({ | ||
rollupAddress: params.rollupAddress, | ||
nativeToken: params.nativeToken, | ||
owner: account, | ||
}, parentChainClient, orbitChainClient); | ||
console.log(JSON.stringify(result)); | ||
} | ||
catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
} | ||
main().catch(console.error); |
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 @@ | ||
export {}; |
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,55 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const arbitrum_orbit_toolkit_1 = require("arbitrum-orbit-toolkit"); | ||
const viem_1 = require("viem"); | ||
const accounts_1 = require("viem/accounts"); | ||
function validateParams(params) { | ||
if (!params || typeof params !== "object") { | ||
throw new Error("Invalid params: must be an object"); | ||
} | ||
const requiredFields = [ | ||
"ownerPrivateKey", | ||
"chainId", | ||
"validators", | ||
"batchPosters", | ||
"nativeToken", | ||
"dataAvailabilityCommittee", | ||
]; | ||
for (const field of requiredFields) { | ||
if (!(field in params)) { | ||
throw new Error(`Missing required field: ${field}`); | ||
} | ||
} | ||
} | ||
async function main() { | ||
const params = JSON.parse(process.argv[2]); | ||
validateParams(params); | ||
const parentChainClient = (0, viem_1.createPublicClient)({ | ||
transport: (0, viem_1.http)(process.env.PARENT_CHAIN_RPC), | ||
}); | ||
const account = (0, accounts_1.privateKeyToAccount)(params.ownerPrivateKey); | ||
// Prepare complete rollup parameters | ||
const rollupParams = { | ||
chainId: params.chainId, | ||
owner: account, | ||
validators: params.validators, | ||
batchPosters: params.batchPosters, | ||
nativeToken: params.nativeToken, | ||
dataAvailabilityCommittee: params.dataAvailabilityCommittee, | ||
}; | ||
try { | ||
const result = await (0, arbitrum_orbit_toolkit_1.createRollup)(rollupParams, parentChainClient); | ||
console.log(JSON.stringify({ | ||
rollupAddress: result.rollupAddress, | ||
inboxAddress: result.inboxAddress, | ||
adminAddress: result.adminAddress, | ||
sequencerInboxAddress: result.sequencerInboxAddress, | ||
transactionHash: result.transactionHash, | ||
})); | ||
} | ||
catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
} | ||
main().catch(console.error); |
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 @@ | ||
export {}; |
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 @@ | ||
export {}; |
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,46 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const arbitrum_orbit_toolkit_1 = require("arbitrum-orbit-toolkit"); | ||
const viem_1 = require("viem"); | ||
const accounts_1 = require("viem/accounts"); | ||
function validateParams(params) { | ||
if (!params || typeof params !== "object") { | ||
throw new Error("Invalid params: must be an object"); | ||
} | ||
const requiredFields = [ | ||
"parentChainRpc", | ||
"ownerPrivateKey", | ||
"upgradeExecutor", | ||
"rollupAddress", | ||
"validators", | ||
"isActive", | ||
]; | ||
for (const field of requiredFields) { | ||
if (!(field in params)) { | ||
throw new Error(`Missing required field: ${field}`); | ||
} | ||
} | ||
} | ||
async function main() { | ||
const params = JSON.parse(process.argv[2]); | ||
validateParams(params); | ||
const parentChainClient = (0, viem_1.createPublicClient)({ | ||
transport: (0, viem_1.http)(params.parentChainRpc), | ||
}); | ||
const account = (0, accounts_1.privateKeyToAccount)(params.ownerPrivateKey); | ||
try { | ||
const result = await (0, arbitrum_orbit_toolkit_1.setValidators)({ | ||
rollupAddress: params.rollupAddress, | ||
validators: params.validators, | ||
isActive: params.isActive, | ||
upgradeExecutor: process.env.UPGRADE_EXECUTOR_ADDRESS, | ||
owner: account, | ||
}, parentChainClient); | ||
console.log(JSON.stringify({ transactionHash: result })); | ||
} | ||
catch (error) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
} | ||
main().catch(console.error); |
Oops, something went wrong.