Skip to content

Commit

Permalink
✨ Feat: Add PREFUNDED_ACCOUNTS to @tevm/utils
Browse files Browse the repository at this point in the history
  • Loading branch information
William Cory authored and William Cory committed Jun 27, 2024
1 parent 9982b6d commit 400bbe7
Show file tree
Hide file tree
Showing 26 changed files with 300 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-ways-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tevm/utils": minor
---

Added PREFUNDED_PRIVATE_KEYS PREFUNDED_ACCOUNTS and PREFUNDED_ADDRESSES to @tevm/utils. These are all an array of 10 objects including hex private keys, hex public keys, and viem accounts respectively. The viem accounts can be used to add an account to `memoryClient` via passing in `account: PREFUNDED_ACCOUNTS[0]` to `createMemoryClient`
4 changes: 4 additions & 0 deletions docs/src/content/docs/reference/@tevm/utils/globals.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/utils/docs/globals.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/utils/docs/variables/PREFUNDED_ACCOUNTS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/utils/docs/variables/PREFUNDED_PRIVATE_KEYS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/utils/docs/variables/PREFUNDED_PUBLIC_KEYS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions packages/utils/docs/variables/PREFUNDED_SEED.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type {
Filter,
ContractConstructorArgs,
} from './abitype.js'
export * from './prefundedAccounts.js'
export {
serializeTransaction,
mnemonicToAccount,
Expand Down
45 changes: 45 additions & 0 deletions packages/utils/src/prefundedAccounts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { privateKeyToAccount } from 'viem/accounts'

export const PREFUNDED_PRIVATE_KEYS = [
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', // 0
'0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', // 1
'0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a', // 2
'0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6', // 3
'0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a', // 4
'0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba', // 5
'0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e', // 6
'0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356', // 7
'0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97', // 8
'0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6', // 9
] as const

export const PREFUNDED_PUBLIC_KEYS = [
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', // 0
'0x70997970C51812dc3A010C7d01b50e0d17dc79C8', // 1
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', // 2
'0x90F79bf6EB2c4f870365E785982E1f101E93b906', // 3
'0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65', // 4
'0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc', // 5
'0x976EA74026E726554dB657fA54763abd0C3a0aa9', // 6
'0x14dC79964da2C08b23698B3D3cc7Ca32193d9955', // 7
'0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f', // 8
'0xa0Ee7A142d267C1f36714E4a8F75612F20a79720', // 9
] as const

export const PREFUNDED_ACCOUNTS = [
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[0]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[1]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[2]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[3]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[4]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[5]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[6]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[7]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[8]),
privateKeyToAccount(PREFUNDED_PRIVATE_KEYS[9]),
] as const

export const PREFUNDED_SEED = Object.freeze({
mnemonic: 'test test test test test test test test test test test junk',
derivationPath: "m/44'/60'/0'/0/",
})
4 changes: 4 additions & 0 deletions tevm/docs/index/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tevm/docs/index/variables/PREFUNDED_ACCOUNTS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tevm/docs/index/variables/PREFUNDED_PRIVATE_KEYS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tevm/docs/index/variables/PREFUNDED_PUBLIC_KEYS.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions tevm/docs/index/variables/PREFUNDED_SEED.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions tevm/docs/utils/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tevm/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ Object.defineProperty(exports, "createContract", {
enumerable: true,
get: function () { return contract.createContract; }
});
Object.defineProperty(exports, "PREFUNDED_ACCOUNTS", {
enumerable: true,
get: function () { return utils.PREFUNDED_ACCOUNTS; }
});
Object.defineProperty(exports, "PREFUNDED_PRIVATE_KEYS", {
enumerable: true,
get: function () { return utils.PREFUNDED_PRIVATE_KEYS; }
});
Object.defineProperty(exports, "PREFUNDED_PUBLIC_KEYS", {
enumerable: true,
get: function () { return utils.PREFUNDED_PUBLIC_KEYS; }
});
Object.defineProperty(exports, "PREFUNDED_SEED", {
enumerable: true,
get: function () { return utils.PREFUNDED_SEED; }
});
Object.defineProperty(exports, "boolToBytes", {
enumerable: true,
get: function () { return utils.boolToBytes; }
Expand Down
Loading

0 comments on commit 400bbe7

Please sign in to comment.