Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocates an initial balance to the attestation bot #2019

Merged
merged 7 commits into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/celotool/src/lib/generate_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export enum AccountType {
FAUCET = 4,
ATTESTATION = 5,
PRICE_ORACLE = 6,
ATTESTATION_BOT = 7,
}

export enum ConsensusType {
Expand All @@ -53,6 +54,7 @@ export const MNEMONIC_ACCOUNT_TYPE_CHOICES = [
'faucet',
'attestation',
'price_oracle',
'attestation_bot',
]

export const add0x = (str: string) => {
Expand Down
11 changes: 9 additions & 2 deletions packages/celotool/src/lib/migration-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,21 @@ function getAttestationKeys() {

export function migrationOverrides() {
const mnemonic = fetchEnv(envVar.MNEMONIC)
const faucetAccounts = getAddressesFor(AccountType.FAUCET, mnemonic, 2)
const attestationBotAccount = getAddressesFor(AccountType.ATTESTATION_BOT, mnemonic, 1)
return {
validators: {
validatorKeys: validatorKeys(),
attestationKeys: getAttestationKeys(),
},
stableToken: {
initialAccounts: getAddressesFor(AccountType.FAUCET, mnemonic, 2),
values: getAddressesFor(AccountType.FAUCET, mnemonic, 2).map(() => '60000000000000000000000'), // 60k Celo Dollars
initialBalances: {
addresses: [...faucetAccounts, ...attestationBotAccount],
values: [
...faucetAccounts.map(() => '60000000000000000000000' /* 60k Celo Dollars */),
...attestationBotAccount.map(() => '10000000000000000000000' /* 10k Celo Dollars */),
],
},
oracles: getAddressesFor(AccountType.PRICE_ORACLE, mnemonic, 1),
},
}
Expand Down