unlock.gno
1.48 Kb · 38 lines
1package params
2
3import "gno.land/r/gov/dao"
4
5const (
6 bankModulePrefix = "bank"
7 restrictedDenomsKey = "restricted_denoms"
8 unlockTransferTitle = "Proposal to unlock the transfer of ugnot."
9 lockTransferTitle = "Proposal to lock the transfer of ugnot."
10 authModulePrefix = "auth"
11 unrestrictedAddrsKey = "unrestricted_addrs"
12)
13
14func ProposeUnlockTransferRequest(cur realm) dao.ProposalRequest {
15 return NewSysParamStringsPropRequestWithTitle(cur, bankModulePrefix, "p", restrictedDenomsKey, unlockTransferTitle, []string{})
16}
17
18func ProposeLockTransferRequest(cur realm) dao.ProposalRequest {
19 return NewSysParamStringsPropRequestWithTitle(cur, bankModulePrefix, "p", restrictedDenomsKey, lockTransferTitle, []string{"ugnot"})
20}
21
22func ProposeAddUnrestrictedAcctsRequest(cur realm, addrs ...address) dao.ProposalRequest {
23 addrStrings := make([]string, 0, len(addrs))
24 for _, addr := range addrs {
25 s := addr.String()
26 addrStrings = append(addrStrings, s)
27 }
28 return NewSysParamStringsPropRequestAddWithTitle(cur, authModulePrefix, "p", unrestrictedAddrsKey, "Add unrestricted transfer accounts", addrStrings)
29}
30
31func ProposeRemoveUnrestrictedAcctsRequest(cur realm, addrs ...address) dao.ProposalRequest {
32 addrStrings := make([]string, 0, len(addrs))
33 for _, addr := range addrs {
34 s := addr.String()
35 addrStrings = append(addrStrings, s)
36 }
37 return NewSysParamStringsPropRequestRemoveWithTitle(cur, authModulePrefix, "p", unrestrictedAddrsKey, "Add unrestricted transfer accounts", addrStrings)
38}