diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7063e35 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,42 @@ +# Code of Conduct + +## My Pledge + +In the interest of fostering an open and welcoming environment, I pledge to make participation in my project and community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## My Standards + +Examples of behavior that contribute to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## My Responsibilities + +As the project maintainer, I am responsible for clarifying the standards of acceptable behavior and am expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting me at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. I am obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [http://contributor-covenant.org/version/2/1][version]. + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/2/1/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..599336a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,82 @@ +# Contributing to MultiSigEnterpriseVault + +Thank you for considering contributing to MultiSigEnterpriseVault! I welcome contributions from the community and am excited to work with you. + +## How to Contribute + +### Reporting Bugs + +- Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/emmanuelJet/MultiSigEnterpriseVault/issues). +- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. +- When opening a new issue, select the appropriate template that best matches your report (e.g., [Bug Report](.github/ISSUE_TEMPLATE/bug-report.md)). + +### Suggesting Enhancements + +- Search the existing [Issues](https://github.com/emmanuelJet/MultiSigEnterpriseVault/issues) for enhancement suggestions to avoid duplicates. +- If you find a related issue, feel free to add your thoughts and suggestions. +- If you don't find an existing issue, open a new one and describe the enhancement in detail. +- Use the provided template for [feature requests](.github/ISSUE_TEMPLATE/feature-implementation.md) to ensure all necessary information is included. + +### Submitting Pull Requests + +- Fork the repository and create your branch from `main`. +- If you've added code that should be tested, add tests. +- Ensure the test suite passes. +- Make sure your code lints. +- Use the [pull request template](.github/PULL_REQUEST_TEMPLATE.md) to ensure all necessary information is included. +- Follow the checklist in the template to verify that your pull request meets the project requirements. +- Issue that pull request! + +## Code Style + +- Follow the existing code style and use `forge fmt` to format your code. +- Document all functions using [NatSpec comments](https://docs.soliditylang.org/en/v0.8.20/natspec-format.html). +- Write clear, concise commit messages. + +## Branch Naming Guidelines + +To keep a clean and understandable Git history, always base new branches off the `main` branch and follow these branch naming conventions: + +- Feature Branches: For new features use: `feat/` + - Example: feat/owner-role +- Enhancement Branches: For existing feature enhancements or improvements use: `perf/` + - Example: perf/owner-access +- Bug Fixes: For bug fixes, use: `fix/` + - Example: fix/gas-estimation +- Chores or Refactoring: For maintenance or refactoring tasks, use: `chore/` + - Example: chore/update-dependencies + +## Commit Message Guidelines + +To maintain a clean and readable commit history, follow these guidelines: + +- Use Conventional Commits: Format your commit messages as follows: + + ```txt + : + ``` + + Examples: + - feat: signer role functionality + - fix: gas estimation bug +- Types of Commits: + - feat: A new feature + - fix: A bug fix + - perf: A feature enhancement + - docs: Documentation-only changes + - test: Adding or updating tests + - chore: Routine tasks like refactoring or updating dependencies + +## Community + +- Follow best practices for collaboration, and ensure tests are written for all new code. +- Be respectful and considerate in your communication. +- Follow the [Code of Conduct](CODE_OF_CONDUCT.md). + +## Getting Help + +If you have any questions, feel free to reach out by opening an issue, join the community chat, or send an email to . + +I appreciate your contributions and thank you for your support! + +Emmanuel Joseph (JET) diff --git a/README.md b/README.md index 7b65537..e4666ae 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Solidity](https://img.shields.io/badge/Solidity-363636.svg?logo=solidity&logoColor=white)](https://soliditylang.org) [![Foundry Framework](https://custom-icon-badges.demolab.com/badge/Foundry-E8E8E8.svg?logo=foundry)](https://getfoundry.sh) +[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) ![Build Status](https://github.com/emmanuelJet/MultiSigEnterpriseVault/actions/workflows/ci.yml/badge.svg?branch=main) An open-source, enterprise-grade Multi-Signature Vault smart contract developed using Solidity and Foundry. It provides advanced security, customizable timelocks, and role-based access control for managing digital assets. @@ -11,8 +12,8 @@ An open-source, enterprise-grade Multi-Signature Vault smart contract developed - Multi-Signature Vault functionality to manage **ETH** and **ERC20** tokens. - Separate timelocks for transactions and owner overrides with delays. - Role-based access control (Owner, Executor, Signers). -- Secure self-destruct mechanism with safety checks. - Flexible and administrative threshold settings. +- Designed to be secure and gas-efficient. ## Use Cases @@ -68,7 +69,7 @@ This command outputs a single Solidity file containing all dependencies. ## Deployment Guide -This section explains how to deploy the MultiSigEnterpriseVault contract to PulseChain Testnet v4. +This section explains how to deploy the MultiSigEnterpriseVault contract to PulseChain Testnet v4 using GitHub Actions. ### Prerequisites @@ -91,9 +92,37 @@ Set the following environment variables: After a successful deployment, artifacts will be stored in the `dist/` directory: -- `deployment_output.json`: Contains the contract ABI and details. +- `deployment_abi.json`: Contains the contract ABI. - `deployment_result.txt`: Contains the contract address and deployment transaction details. +## Local Deployment + +- Create the `.env` file from the `.env.example` file and fill in the environment variables; + +```bash +cp .env.example .env +``` + +- Load the variables in the `.env` file; + +```bash +source .env +``` + +- Deploy `MultiSigEnterpriseVault` contract using `forge script` + +```bash +forge script script/MultiSigEnterpriseVaultScript.s.sol:MultiSigEnterpriseVaultScript --chain pulsechain-testnet --private-key $PRIVATE_KEY --rpc-url $PULSECHAIN_TESTNET_RPC_URL --broadcast --verify --verifier blockscout --verifier-url https://api.scan.v4.testnet.pulsechain.com/api/ | tee .private/deployment_result.txt +``` + +## Contribution + +I welcome contributions to this project. If you’re interested in contributing, please check the [Contribution Guidelines](CONTRIBUTING.md) for detailed instructions. + +## Code of Conduct + +Please read the [Code of Conduct](CODE_OF_CONDUCT.md) to understand the rules and expectations for participation in the project. + ## License ```md @@ -109,3 +138,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ``` + +## Disclaimer + +**This project has not been audited and is not recommended for production use.** Use this code at your own risk. The project maintainer takes no responsibility for any losses or issues that arise from using the code in a live environment. diff --git a/foundry.toml b/foundry.toml index 98d77bc..0432a35 100644 --- a/foundry.toml +++ b/foundry.toml @@ -11,6 +11,8 @@ multiline_func_header = "params_first" single_line_statement_blocks = "preserve" [rpc_endpoints] +sepolia = "${SEPOLIA_RPC_URL}" +mainnet = "${ETH_MAINNET_RPC_URL}" pulsechain = "${PULSECHAIN_RPC_URL}" pulsechain-testnet = "${PULSECHAIN_TESTNET_RPC_URL}" diff --git a/src/interfaces/IMultiSigTimelock.sol b/src/interfaces/IMultiSigTimelock.sol index e7dbb17..b104b71 100644 --- a/src/interfaces/IMultiSigTimelock.sol +++ b/src/interfaces/IMultiSigTimelock.sol @@ -5,6 +5,7 @@ import {ActionType} from '../utilities/VaultEnums.sol'; /** * @title IMultiSigTimelock Interface + * @author Emmanuel Joseph (JET) * @dev Interface defining errors and events for timelock management. */ interface IMultiSigTimelock { diff --git a/src/interfaces/IMultiSigTransaction.sol b/src/interfaces/IMultiSigTransaction.sol index a352bd0..1f19149 100644 --- a/src/interfaces/IMultiSigTransaction.sol +++ b/src/interfaces/IMultiSigTransaction.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.20; /** * @title IMultiSigTransaction Interface + * @author Emmanuel Joseph (JET) * @dev Interface defining custom errors, events, and external functions for transaction management. */ interface IMultiSigTransaction { diff --git a/src/interfaces/user/roles/IExecutorRole.sol b/src/interfaces/user/roles/IExecutorRole.sol index 162f251..17dd155 100644 --- a/src/interfaces/user/roles/IExecutorRole.sol +++ b/src/interfaces/user/roles/IExecutorRole.sol @@ -41,6 +41,8 @@ interface IExecutorRole { /** * @dev Error thrown when trying to approve an owner override before the timelock has passed. + * @param currentTime The current time when the error is thrown. + * @param requiredTime The required time that must elapse before the owner override can be executed. */ error OwnerOverrideTimelockNotElapsed(uint256 currentTime, uint256 requiredTime); diff --git a/src/libraries/AddressUtils.sol b/src/libraries/AddressUtils.sol index 9cd10c7..eaf516a 100644 --- a/src/libraries/AddressUtils.sol +++ b/src/libraries/AddressUtils.sol @@ -5,6 +5,7 @@ import '@openzeppelin/contracts/utils/Address.sol'; /** * @title AddressUtils Library + * @author Emmanuel Joseph (JET) * @dev Extends OpenZeppelin's Address library to add custom utility functions. */ library AddressUtils {