-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdao_proposals_mainnet.sh
executable file
·186 lines (160 loc) · 7.14 KB
/
dao_proposals_mainnet.sh
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
set -e
MASTER_ACC=you.near
DAO_ROOT_ACC=sputnik-dao.near
DAO_NAME=subdao
DAO_ACCOUNT=$DAO_NAME.$DAO_ROOT_ACC
CROSS_DAO_ACCOUNT=multidao.$DAO_ROOT_ACC
BOND_AMOUNT=1
export NEAR_ENV=testnet
# near view $DAO_ACCOUNT get_policy
## --------------------------------
## CORE PROPOSALS
## Create proposals from your sub-DAO on the MultiDAO
## --------------------------------
# ## Payout Proposal
# ## --------------------------------
# RECEIVER=croncat.near
# TRANSFER_AMOUNT=1000000000000000000000000
# # NOTE: Only specify if you are transfer token NOT near
# TOKEN_ID=
# SUB_ADD_PROPOSAL=`echo "{\"proposal\": { \"description\": \"\", \"kind\": { \"Transfer\": { \"token_id\": \"$TOKEN_ID\", \"receiver_id\": \"$RECEIVER\", \"amount\": \"$TRANSFER_AMOUNT\" } } } }" | base64`
# FIXED_SUB_ARGS=`echo $SUB_ADD_PROPOSAL | tr -d '\r' | tr -d ' '`
# ## Create proposal on MultiDAO
# near call $DAO_ACCOUNT add_proposal '{
# "proposal": {
# "description": "MultiDAO Payment Proposal",
# "kind": {
# "FunctionCall": {
# "receiver_id": "'$CROSS_DAO_ACCOUNT'",
# "actions": [
# {
# "method_name": "add_proposal",
# "args": "'$FIXED_SUB_ARGS'",
# "deposit": "1000000000000000000000000",
# "gas": "30000000000000"
# }
# ]
# }
# }
# }
# }' --accountId $MASTER_ACC --amount $BOND_AMOUNT
# ## Membership Proposals (Add/Remove)
# ## --------------------------------
# ROLE=council
# NEW_MEMBER=new_member.near
# ## Uncomment the line you want. First is add member, second is remove member
# SUB_ADD_PROPOSAL=`echo "{\"proposal\": { \"description\": \"Welcome '$NEW_MEMBER' to the '$ROLE' team\", \"kind\": { \"AddMemberToRole\": { \"member_id\": \"'$NEW_MEMBER'\", \"role\": \"'$ROLE'\" } } } }" | base64`
# # SUB_ADD_PROPOSAL=`echo "{\"proposal\": { \"description\": \"Remove '$NEW_MEMBER' from '$ROLE' team\", \"kind\": { \"RemoveMemberFromRole\": { \"member_id\": \"'$NEW_MEMBER'\", \"role\": \"'$ROLE'\" } } } }" | base64`
# FIXED_SUB_ARGS=`echo $SUB_ADD_PROPOSAL | tr -d '\r' | tr -d ' '`
# ## Create proposal on MultiDAO
# near call $DAO_ACCOUNT add_proposal '{
# "proposal": {
# "description": "MultiDAO Membership Proposal",
# "kind": {
# "FunctionCall": {
# "receiver_id": "'$CROSS_DAO_ACCOUNT'",
# "actions": [
# {
# "method_name": "add_proposal",
# "args": "'$FIXED_SUB_ARGS'",
# "deposit": "1000000000000000000000000",
# "gas": "30000000000000"
# }
# ]
# }
# }
# }
# }' --accountId $MASTER_ACC --amount $BOND_AMOUNT
# ## Act on Proposals (Approve/Reject/Remove)
# ## --------------------------------
# ## NOTE: You need to specify the proposal ID for this work!
# PROPOSAL_ID=0
# ## Uncomment the line you want. First is approve proposal, second is reject proposal, third is remove proposal
# SUB_ACT_PROPOSAL=`echo "{\"id\": $PROPOSAL_ID, \"action\" :\"VoteApprove\"}" | base64`
# # SUB_ACT_PROPOSAL=`echo "{\"id\": $PROPOSAL_ID, \"action\" :\"VoteReject\"}" | base64`
# # SUB_ACT_PROPOSAL=`echo "{\"id\": $PROPOSAL_ID, \"action\" :\"VoteRemove\"}" | base64`
# FIXED_SUB_ARGS=`echo $SUB_ACT_PROPOSAL | tr -d '\r' | tr -d ' '`
# ## Dao can create a payout proposal on another DAO
# near call $CROSS_DAO_ACCOUNT add_proposal '{
# "proposal": {
# "description": "MultiDAO Proposal Vote",
# "kind": {
# "FunctionCall": {
# "receiver_id": "'$DAO_ACCOUNT'",
# "actions": [
# {
# "method_name": "act_proposal",
# "args": "'$FIXED_SUB_ARGS'",
# "deposit": "0",
# "gas": "30000000000000"
# }
# ]
# }
# }
# }
# }' --accountId $MASTER_ACC --amount $BOND_AMOUNT
# ## --------------------------------
# ## Cron.cat
# ## Create proposals that create automation for the MultiDAO
# ## --------------------------------
# CRONCAT=manager_v1.cron.near
# TASK_ACCOUNT=counter.cron.near
# CRONCAT_ARGS=`echo "{\"contract_id\": \"$TASK_ACCOUNT\",\"function_id\": \"increment\",\"cadence\": \"0 0 * * * *\",\"recurring\": true,\"deposit\": \"0\",\"gas\": 9000000000000}" | base64`
# FIXED_CRONCAT_ARGS=`echo $ARGS | tr -d '\r' | tr -d ' '`
# SUB_ADD_PROPOSAL=`echo "{\"proposal\": { \"description\": \"Create cron.cat task\", \"kind\": { \"FunctionCall\": { \"receiver_id\": \"'$CRONCAT'\", \"actions\": [ { \"method_name\": \"create_task\", \"args\": \"'$FIXED_CRONCAT_ARGS'\", \"deposit\": \"0\", \"gas\": \"30000000000000\" } ] } } } } }" | base64`
# FIXED_SUB_ARGS=`echo $SUB_ADD_PROPOSAL | tr -d '\r' | tr -d ' '`
# ## Dao can create a payout proposal on another DAO
# near call $CROSS_DAO_ACCOUNT add_proposal '{
# "proposal": {
# "description": "MultiDAO Proposal Vote",
# "kind": {
# "FunctionCall": {
# "receiver_id": "'$DAO_ACCOUNT'",
# "actions": [
# {
# "method_name": "add_proposal",
# "args": "'$FIXED_SUB_ARGS'",
# "deposit": "0",
# "gas": "30000000000000"
# }
# ]
# }
# }
# }
# }' --accountId $MASTER_ACC --amount $BOND
# ## --------------------------------
# ## METAPOOL STAKING
# ## --------------------------------
# METAPOOL_ACCT=meta-pool.near
# ## Step 1. Stake Some NEAR
# Example: 10 NEAR
# STAKE_AMOUNT_NEAR=10000000000000000000000000
# SUB_ADD_PROPOSAL=`echo "{\"proposal\": {\"description\": \"Stake DAO funds to metapool\", \"kind\": {\"FunctionCall\": {\"receiver_id\": \"'$METAPOOL_ACCT'\", \"actions\": [{\"method_name\": \"deposit_and_stake\", \"args\": \"e30=\", \"deposit\": \"'$STAKE_AMOUNT_NEAR'\", \"gas\": \"20000000000000\"}]}}}}" | base64`
# # Step 2. Unstake some amount of NEAR
# UNSTAKE_AMOUNT=10000000000000000000000000
# SUB_POOL_ARGS=`echo "{ \"amount\": \"$UNSTAKE_AMOUNT\" }" | base64`
# FIXED_POOL_ARGS=`echo $SUB_POOL_ARGS | tr -d '\r' | tr -d ' '`
# SUB_ADD_PROPOSAL=`echo "{\"proposal\": {\"description\": \"Unstake all funds from metapool to DAO\", \"kind\": {\"FunctionCall\": {\"receiver_id\": \"'$METAPOOL_ACCT'\", \"actions\": [{\"method_name\": \"unstake\", \"args\": \"'$FIXED_POOL_ARGS'\", \"deposit\": \"0\", \"gas\": \"20000000000000\"}]}}}}" | base64`
# # Step 3. Withdraw balance back to DAO
# SUB_ADD_PROPOSAL=`echo "{\"proposal\": {\"description\": \"Withdraw unstaked funds from metapool to DAO\", \"kind\": {\"FunctionCall\": {\"receiver_id\": \"'$METAPOOL_ACCT'\", \"actions\": [{\"method_name\": \"withdraw_unstaked\", \"args\": \"e30=\", \"deposit\": \"0\", \"gas\": \"20000000000000"\}]}}}}" | base64`
# # Leave this line uncommented
# FIXED_SUB_ARGS=`echo $SUB_ADD_PROPOSAL | tr -d '\r' | tr -d ' '`
# ## Dao can create a payout proposal on another DAO
# near call $CROSS_DAO_ACCOUNT add_proposal '{
# "proposal": {
# "description": "MultiDAO Proposal for MetaPool Staking",
# "kind": {
# "FunctionCall": {
# "receiver_id": "'$DAO_ACCOUNT'",
# "actions": [
# {
# "method_name": "add_proposal",
# "args": "'$FIXED_SUB_ARGS'",
# "deposit": "0",
# "gas": "30000000000000"
# }
# ]
# }
# }
# }
# }' --accountId $MASTER_ACC --amount $BOND_AMOUNT