-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathrocketh.ts
54 lines (52 loc) · 2.25 KB
/
rocketh.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// ------------------------------------------------------------------------------------------------
// Typed Config
// ------------------------------------------------------------------------------------------------
import {UserConfig} from 'rocketh';
export const config = {
networks: {
hardhat: {
tags: ['local', 'memory', 'testnet'],
},
localhost: {
tags: ['local', 'testnet'],
},
sepolia: {
tags: ['live', 'testner'],
},
default: {
tags: ['live'],
},
},
accounts: {
deployer: {
default: 0,
},
admin: {
default: 1,
},
},
data: {},
} as const satisfies UserConfig;
// ------------------------------------------------------------------------------------------------
// Imports and Re-exports
// ------------------------------------------------------------------------------------------------
// We regroup all what is needed for the deploy scripts
// so that they just need to import this file
// We also added an alias (@rocketh) in tsconfig.json
// so they just need to do `import {execute, artifacts} from '@rocketh';`
// and this work anywhere in the file hierarchy
// ------------------------------------------------------------------------------------------------
// we add here the module we need, so that they are available in the deploy scripts
import '@rocketh/deploy'; // this one provide a deploy function
import '@rocketh/read-execute'; // this one provide read,execute functions
import '@rocketh/proxy'; // this one provide a deployViaProxy function that let you declaratively deploy proxy based contracts
// ------------------------------------------------------------------------------------------------
// we re-export the artifacts, so they are easily available from the alias
import artifacts from './generated/artifacts.js';
export {artifacts};
// ------------------------------------------------------------------------------------------------
// while not necessary, we also converted the execution function type to know about the named accounts
// this way you get type safe accounts
import {execute as _execute, loadAndExecuteDeployments, type NamedAccountExecuteFunction} from 'rocketh';
const execute = _execute as NamedAccountExecuteFunction<typeof config.accounts, typeof config.data>;
export {execute, loadAndExecuteDeployments};