()
| 22 | import { MnemonicAccountCreator } from '../../scripts/genesis/AccountCreator' |
| 23 | |
| 24 | const build = async () => { |
| 25 | const ctx = await createBuilderContext({ network: 'devnet', chainId: 5042001 }) |
| 26 | const configPath = path.join(ctx.projectRoot, `assets/${ctx.network}/config.json`) |
| 27 | const walletSecretsPath = path.join(ctx.projectRoot, `assets/${ctx.network}/wallet-secrets.json`) |
| 28 | |
| 29 | // Load existing config file for CI |
| 30 | if (fs.existsSync(configPath)) { |
| 31 | const config = schemaGenesisConfig.parse(JSON.parse(fs.readFileSync(configPath, 'utf8'))) |
| 32 | return await buildGenesis(ctx, config) |
| 33 | } |
| 34 | |
| 35 | if (!process.env.ARC_DEVNET_ADMIN_MNEMONIC) { |
| 36 | throw new Error('ARC_DEVNET_ADMIN_MNEMONIC is not set') |
| 37 | } |
| 38 | if (!process.env.ARC_DEVNET_VALIDATOR_MNEMONIC) { |
| 39 | throw new Error('ARC_DEVNET_VALIDATOR_MNEMONIC is not set') |
| 40 | } |
| 41 | const creator = new MnemonicAccountCreator({ |
| 42 | adminMnemonic: process.env.ARC_DEVNET_ADMIN_MNEMONIC, |
| 43 | validatorMnemonic: process.env.ARC_DEVNET_VALIDATOR_MNEMONIC, |
| 44 | }) |
| 45 | const adminPrefund = parseEther('1000') |
| 46 | |
| 47 | const config: GenesisConfig = { |
| 48 | timestamp: currentTimestamp(), |
| 49 | coinbase: '0x65E0a200006D4FF91bD59F9694220dafc49dbBC1', |
| 50 | |
| 51 | NativeFiatToken: { |
| 52 | proxy: { admin: creator.nextAccount('NativeFiatToken.proxyAdmin', adminPrefund) }, |
| 53 | owner: creator.nextAccount('NativeFiatToken.owner', adminPrefund), |
| 54 | pauser: creator.nextAccount('NativeFiatToken.pauser', adminPrefund), |
| 55 | masterMinter: creator.nextAccount('NativeFiatToken.masterMinter', adminPrefund), |
| 56 | rescuer: creator.nextAccount('NativeFiatToken.rescuer', adminPrefund), |
| 57 | blacklister: creator.nextAccount('NativeFiatToken.blacklister', adminPrefund), |
| 58 | minters: [ |
| 59 | { |
| 60 | address: creator.nextAccount('NativeFiatToken.minter', adminPrefund), |
| 61 | allowance: parseEther('1000000'), |
| 62 | }, |
| 63 | ], |
| 64 | }, |
| 65 | |
| 66 | ProtocolConfig: { |
| 67 | proxy: { admin: creator.nextAccount('ProtocolConfig.proxyAdmin', adminPrefund) }, |
| 68 | owner: creator.nextAccount('ProtocolConfig.owner', adminPrefund), |
| 69 | controller: creator.nextAccount('ProtocolConfig.controller', adminPrefund), |
| 70 | pauser: creator.nextAccount('ProtocolConfig.pauser', adminPrefund), |
| 71 | feeParams: { |
| 72 | alpha: 20n, |
| 73 | kRate: 25n, |
| 74 | inverseElasticityMultiplier: 5000n, |
| 75 | minBaseFee: 1n, |
| 76 | maxBaseFee: 1000n, |
| 77 | blockGasLimit: 30_000_000n, |
| 78 | }, |
| 79 | consensusParams: { |
| 80 | timeoutProposeMs: 3000n, |
| 81 | timeoutProposeDeltaMs: 500n, |
nothing calls this directly
no test coverage detected