unlock.gno

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