Skip to content

Example of a Gnosis Safe module for company/DAO payouts written in Solidity

Notifications You must be signed in to change notification settings

czar0/safe-payouts-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Safe - Payouts module 💸

A simple implementation of a Gnosis Safe module for company/DAO payouts written in Solidity.

🚨 Beware this is a demo-purpose-only contract and it is not recommended to deploy it (as is) to production networks. Modules can be a security risk since they can execute arbitrary transactions bypassing the signature quorum. Only add trusted and audited modules to a Safe. A malicious module can take over a Safe.

Requirements

Note: this step is only required if you want to build, test, and run this project locally. Otherwise, you can directly jump to the Deploy section.

  • solc - solidity compiler
  • solc-select - manages the installation and the setting of different solc compiler versions (recommended)
  • foundry - a blazing fast, portable and modular toolkit for Ethereum application development written in Rust

Make sure your solidity compiler matches with the minimum specific version or version range defined in the contracts.

Build

To build the contracts simply run:

forge build

Test

To test the contracts run:

forge test

This will compile and run all files within the test folder. To test a specific contract use the flag --match-path as follows:

forge test --match-path test/<CONTRACT>

You can set different levels of verbosity simply by adding one or more v as trailing parameters, like that:

forge test -vvvv

Deploy

via UI

You can deploy this contract and interact with it directly on your browser via Remix. Click on the link below.

SafePayoutsModule.sol > Remix

Work with a module

Enable the module

To add a module to your Safe account follow this comprehensive guide: Safe - Add a module.

To find out the version of your Safe account mastercopy contract, navigate to Settings > Setup on your Safe wallet UI. Then, find the corresponding version of the deployed address (for your selected chain) in this repository: safe-deployment.

Remove the module

You can perform this action directly from the Safe wallet UI, navigating to Settings > Modules, identifying the module based on its address and then clicking on the delete icon.

Execute transactions

Once the module is enabled in your Safe account, you can jump on Remix and start performing some actions, such as:

  • addPayout(address beneficiary, uint256 amount) - which will add new payout information (beneficiary and amount)
  • removePayout(address beneficiary) - that will remove the payout information associated with the passed beneficiary
  • executePayouts(address safeAccount) - which will perform all the payouts in the list using funds from your Safe account (taking in input the account address)

Resources

About

Example of a Gnosis Safe module for company/DAO payouts written in Solidity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published