-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
53 lines (48 loc) · 1.57 KB
/
Copy pathindex.ts
File metadata and controls
53 lines (48 loc) · 1.57 KB
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
import type { Action } from '@wharfkit/antelope'
import { logProposalLink } from '$lib/utils'
import { makeSession, systemContract } from '$lib/wharf'
import { NETWORK_AUTHORITY, SYSTEM_ACCOUNT } from '../../lib/constants'
const DEV_ACCOUNT = 'dev.vaulta'
const DIST_ACCOUNT = 'dist.vaulta'
const FUND_ACCOUNT = 'fund.vaulta'
const actions: Action[] = [
// 1. Create the new distribution contract
systemContract.action('newaccount', {
active: NETWORK_AUTHORITY,
creator: SYSTEM_ACCOUNT,
name: DIST_ACCOUNT,
owner: NETWORK_AUTHORITY,
}),
systemContract.action('buyrambytes', {
bytes: 8192,
payer: SYSTEM_ACCOUNT,
receiver: DIST_ACCOUNT,
}),
// 2. Create the development team account
systemContract.action('newaccount', {
active: NETWORK_AUTHORITY,
creator: SYSTEM_ACCOUNT,
name: DEV_ACCOUNT,
owner: NETWORK_AUTHORITY,
}),
systemContract.action('buyrambytes', {
bytes: 8192,
payer: SYSTEM_ACCOUNT,
receiver: DEV_ACCOUNT,
}),
// 3. Create the unallocated funds account
systemContract.action('newaccount', {
active: NETWORK_AUTHORITY,
creator: SYSTEM_ACCOUNT,
name: FUND_ACCOUNT,
owner: NETWORK_AUTHORITY,
}),
systemContract.action('buyrambytes', {
bytes: 8192,
payer: SYSTEM_ACCOUNT,
receiver: FUND_ACCOUNT,
}),
]
const session = makeSession('eosio@active', 'stage1msig1')
const result = await session.transact({ actions }, { broadcast: true })
logProposalLink(result, session)