-
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.
Merge pull request #23 from orochi-network/feature/sei_testnet
Feature/sei testnet
- Loading branch information
Showing
8 changed files
with
105 additions
and
26 deletions.
There are no files selected for viewing
File renamed without changes.
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,20 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
import '@nomicfoundation/hardhat-ethers'; | ||
import { task } from 'hardhat/config'; | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { HDNodeWallet, Wallet } from 'ethers'; | ||
import { env } from '../env'; | ||
|
||
task('wipe', 'Wipe token').setAction(async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { | ||
let wallet = Wallet.fromPhrase(env.OROCHI_MNEMONIC).connect(hre.ethers.provider); | ||
// m/44'/60'/0'/0/0/0 0xA0AA39fAAaCcB5927A4Ffed9fff2B8f0f73CE561 | ||
console.log(wallet.address); | ||
let wallet2 = HDNodeWallet.fromPhrase(env.OROCHI_MNEMONIC, undefined, `m/44'/60'/0'/0`) | ||
.deriveChild(0) | ||
.connect(hre.ethers.provider); | ||
console.log((await wallet.deriveChild(0)).address); | ||
console.log('Wa', wallet2.address); | ||
// await wallet.sendTransaction({ to: '0xA2096671D4A0939D4D50bd7AAB612883e98B4D47', value: parseEther('4.9959') }); | ||
}); | ||
|
||
export default {}; |
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,35 @@ | ||
import fs from 'fs'; | ||
import { ethers } from 'ethers'; | ||
|
||
(async () => { | ||
const wallet = ethers.Wallet.createRandom(); | ||
const dataTable = []; | ||
|
||
for (let i = 0; i < 5; i += 1) { | ||
const newWallet = wallet.deriveChild(i); | ||
dataTable.push({ | ||
path: newWallet.path, | ||
address: await newWallet.getAddress(), | ||
}); | ||
} | ||
for (let i = 100; i < 105; i += 1) { | ||
const newWallet = wallet.deriveChild(i); | ||
dataTable.push({ | ||
path: newWallet.path, | ||
address: await newWallet.getAddress(), | ||
}); | ||
} | ||
const walletList = dataTable.map(({ path, address }) => { | ||
return `# ${path}\t${address}`; | ||
}); | ||
const fileContent = fs.existsSync('.env') ? fs.readFileSync('.env', 'utf-8') : ''; | ||
if (fileContent.indexOf('OROCHI_MNEMONIC') === -1) { | ||
fs.writeFileSync( | ||
'.env', | ||
`${fileContent}\n${walletList.join('\n')}\nOROCHI_MNEMONIC="${wallet.mnemonic?.phrase.trim()}"`, | ||
); | ||
console.table(dataTable); | ||
} else { | ||
console.log('Wallets existed'); | ||
} | ||
})(); |
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 was deleted.
Oops, something went wrong.