generated from Borodutch/smart-contract-starter
-
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
1 parent
d3cf151
commit e9fa0f3
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
Submodule merkleTrees
updated
from 8cac86 to 87bac1
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,25 @@ | ||
import { randomBytes } from 'crypto' | ||
import prompt from 'prompt' | ||
|
||
function getRandomNumber() { | ||
const value = randomBytes(32) // 32 bytes = 256 bits | ||
const bigInt = BigInt(`0x${value.toString('hex')}`) | ||
return `${bigInt}` | ||
} | ||
|
||
void (async function main() { | ||
const { count } = await prompt.get({ | ||
properties: { | ||
count: { | ||
required: true, | ||
type: 'number', | ||
description: 'How many tokens do you want to generate?', | ||
}, | ||
}, | ||
}) | ||
console.log(`Generating ${count} tokens...`) | ||
for (let i = 0; i < count; i++) { | ||
console.log(`token:${getRandomNumber()}`) | ||
} | ||
console.log('Done!') | ||
})() |