Search Apps Documentation Source Content File Folder Download Copy Actions Download

unlock.gno

1.42 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() dao.ProposalRequest {
15	return NewSysParamStringsPropRequestWithTitle(bankModulePrefix, "p", restrictedDenomsKey, unlockTransferTitle, []string{})
16}
17
18func ProposeLockTransferRequest() dao.ProposalRequest {
19	return NewSysParamStringsPropRequestWithTitle(bankModulePrefix, "p", restrictedDenomsKey, lockTransferTitle, []string{"ugnot"})
20}
21
22func ProposeAddUnrestrictedAcctsRequest(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(authModulePrefix, "p", unrestrictedAddrsKey, "Add unrestricted transfer accounts", addrStrings)
29}
30
31func ProposeRemoveUnrestrictedAcctsRequest(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(authModulePrefix, "p", unrestrictedAddrsKey, "Add unrestricted transfer accounts", addrStrings)
38}