-
Notifications
You must be signed in to change notification settings - Fork 15
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
4 changed files
with
98 additions
and
5 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,89 @@ | ||
import { MnemonicKey, MsgSend, Wallet } from "@initia/initia.js"; | ||
import { getConfig } from "config"; | ||
import { sendTx } from "lib/tx"; | ||
|
||
const config = getConfig(); | ||
const L1_FUNDER = new Wallet( | ||
config.l1lcd, | ||
new MnemonicKey({ | ||
mnemonic: '' | ||
}) | ||
) | ||
const L2_FUNDER = new Wallet( | ||
config.l2lcd, | ||
new MnemonicKey({ | ||
mnemonic: '' | ||
}) | ||
) | ||
|
||
async function fundL1(){ | ||
const executor = new Wallet(config.l1lcd, new MnemonicKey({mnemonic: config.EXECUTOR_MNEMONIC})) | ||
const output = new Wallet(config.l1lcd, new MnemonicKey({mnemonic: config.OUTPUT_SUBMITTER_MNEMONIC})) | ||
const batch = new Wallet(config.l1lcd, new MnemonicKey({mnemonic: config.BATCH_SUBMITTER_MNEMONIC})) | ||
const challenger = new Wallet(config.l1lcd, new MnemonicKey({mnemonic: config.CHALLENGER_MNEMONIC})) | ||
|
||
const sendMsg = [ | ||
new MsgSend( | ||
L1_FUNDER.key.accAddress, | ||
executor.key.accAddress, | ||
"50000000000uinit" | ||
), | ||
new MsgSend( | ||
L1_FUNDER.key.accAddress, | ||
output.key.accAddress, | ||
"50000000000uinit" | ||
), | ||
new MsgSend( | ||
L1_FUNDER.key.accAddress, | ||
batch.key.accAddress, | ||
"50000000000uinit" | ||
), | ||
new MsgSend( | ||
L1_FUNDER.key.accAddress, | ||
challenger.key.accAddress, | ||
"50000000000uinit" | ||
) | ||
] | ||
await sendTx(L1_FUNDER, sendMsg); | ||
} | ||
|
||
async function fundL2(){ | ||
const executor = new Wallet(config.l2lcd, new MnemonicKey({mnemonic: config.EXECUTOR_MNEMONIC})) | ||
const output = new Wallet(config.l2lcd, new MnemonicKey({mnemonic: config.OUTPUT_SUBMITTER_MNEMONIC})) | ||
const batch = new Wallet(config.l2lcd, new MnemonicKey({mnemonic: config.BATCH_SUBMITTER_MNEMONIC})) | ||
const challenger = new Wallet(config.l2lcd, new MnemonicKey({mnemonic: config.CHALLENGER_MNEMONIC})) | ||
|
||
const sendMsg = [ | ||
new MsgSend( | ||
L2_FUNDER.key.accAddress, | ||
executor.key.accAddress, | ||
"1umin" | ||
), | ||
new MsgSend( | ||
L2_FUNDER.key.accAddress, | ||
output.key.accAddress, | ||
"1umin" | ||
), | ||
new MsgSend( | ||
L2_FUNDER.key.accAddress, | ||
batch.key.accAddress, | ||
"1umin" | ||
), | ||
new MsgSend( | ||
L2_FUNDER.key.accAddress, | ||
challenger.key.accAddress, | ||
"1umin" | ||
) | ||
] | ||
await sendTx(L2_FUNDER, sendMsg); | ||
} | ||
|
||
async function main(){ | ||
// await fundL1(); | ||
// await fundL2(); | ||
console.log('Funded accounts'); | ||
} | ||
|
||
if (require.main === module) { | ||
main(); | ||
} |
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