Module: Solace::SquadsSmartAccounts::Permissions
- Defined in:
- lib/solace/squads_smart_accounts/types/permissions.rb
Overview
Bitmask constants for the three signer permission bits on a smart account. Permissions are combined with bitwise OR to grant multiple roles.
Constant Summary collapse
- INITIATE =
Permission to initiate (create) new transactions.
0b001- VOTE =
Permission to vote (approve or reject) on proposals.
0b010- EXECUTE =
Permission to execute approved transactions.
0b100- ALL =
Convenience constant granting all three permissions.
INITIATE | VOTE | EXECUTE
Class Method Summary collapse
-
.mask(*names) ⇒ Integer
Builds a permission bitmask from named permissions.
Class Method Details
.mask(*names) ⇒ Integer
Builds a permission bitmask from named permissions.
34 35 36 37 38 39 40 |
# File 'lib/solace/squads_smart_accounts/types/permissions.rb', line 34 def self.mask(*names) names.reduce(0) do |mask, name| raise ArgumentError, "unknown permission: #{name.inspect}" unless const_defined?(name.to_s.upcase) mask | const_get(name.to_s.upcase) end end |