This is the code for the legacy V1 contracts, current version at: gnosis/zodiac-modifier-roles
The Roles Modifier belongs to the Zodiac collection of tools, which can be accessed through the Zodiac App available on Gnosis Safe, as well as in this repository.
If you have any questions about Zodiac, join the Gnosis Guild Discord. Follow @GnosisGuild on Twitter for updates.
This modifier allows avatars to enforce granular, role-based, permissions for attached modules.
Modules that have been granted a role are able to unilaterally make calls to any approved addresses, approved functions, and approved variables the role has access to.
The interface mirrors the relevant parts of the Gnosis Safe's interface, so this contract can be placed between Gnosis Safe modules and a Gnosis Safe to enforce role-based permissions.
- Create multiple roles
- Assign roles to addresses
- Allow roles access to call, delegate call, and/or send to address
- Scope which functions a role can call on given address
- Scope which paramters are allowed on a given function
- Define a role by setting targets, functions, and parameters that it can call
- Assign the role to an address with
assignRoles()
- Address can now trigger the safe to call those targets, functions, and parameters via
executeTransactionFromModule()
- For each package were a
.env.sample
file is present, copy the content of the file into a.env
file at the same location and populate it with your keys, etc. - From the repo root run
yarn
- From the repo root run
yarn build
After that, you can start working on the different packages.
The contracts have been developed with Solidity 0.8.6. This version of Solidity made all arithmetic checked by default, therefore eliminating the need for explicit overflow or underflow (or other arithmetic) checks. This version of solidity was chosen as it allows to easily cast bytes to bytes4 and bytes32.
An audit has been performed by the G0 group.
All identified issues have been resolved as of commit 454be9d3c26f90221ca717518df002d1eca1845f
The audit results are available as a pdf in this repo.
All contracts are WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Created under the LGPL-3.0+ license.