-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acacad0
commit b43b7da
Showing
16 changed files
with
257 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!--- | ||
Please read this! | ||
Before opening a new pull request (PR), make sure you are merging to the main branch, have your GitHub Issue ID (GID), and understand the popular Git Category Flags (GCF). This will guide the creation of a perfect PR. | ||
Here are examples of a GID and GCF. | ||
- GID: #<ID>, where ID represents a GitHub Issue ID; e.g., #1 | ||
- GCF: breaking, build, ci, chore, docs, feat, fix, other, perf, refactor, revert, style, test, dependency. | ||
The following section guide MUST be adhered to when creating an PR: | ||
1. Title: This must include your primary GCF followed by a colon and a general summary of your changes in lowercase. E.g., "feat: owner role functionalities" | ||
2. Labels: This must include a label similar to your primary GCF. | ||
3. Body: You must follow the PR template without removing any section, even if it is empty. | ||
4. Reviewer: You must assign '@emmanuelJet' to the PR for code review. | ||
5. Assignee: You must include yourself as the PR assignee. | ||
6. Project: You should select a related repo project when available for your PR. | ||
If you have any questions or need further assistance, feel free to reach out in the comments or contact '@emmanuelJet'. | ||
--> | ||
|
||
## Overview | ||
<!-- | ||
Describe the purpose of the PR so that if you looked at it in 6 months, it would be clear from the overview why this was created. E.g.: | ||
```md | ||
This PR entails the implementation of #2. It introduces the owner role functionality and the following actions were implemented: | ||
- **[feat]** `OwnerContract` with owner functionalities | ||
- **[perf]** Optimized `foundry.toml` file | ||
- **[fix]** Deployment script | ||
- **[refactor]** `MultiSigEnterpriseVaultContract` modifier functions | ||
- **[dependency]** New Dependencies: | ||
- "OpenZeppelin" | ||
``` | ||
--> | ||
|
||
Please replace this line with your PR overview description to include a summary of the changes made and the related GID. Also, include relevant GCF and the context of each GCF as suggested above. List any dependencies that are added, updated, and/or removed for this change. | ||
|
||
## Other information | ||
<!-- Any other important information to this PR, such as screenshots of how the contract behaves before and after the change. --> | ||
|
||
<details> | ||
<summary>Automation</summary> | ||
|
||
### Relevant Issues | ||
<!-- Link relevant GID(s) for which their acceptance criteria are covered by this PR, either as blockers or parent. --> | ||
- | ||
|
||
### Before Merging | ||
<!-- | ||
Include any tasks needed before merging this PR using the Closes keyword. This keyword should be used alongside your GID. E.g.: Closes #<ID> | ||
Note that '<ID>' in the example above must be replaced with the exact GitHub Issue ID number relating to your PR. | ||
--> | ||
|
||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Show Forge version | ||
run: | | ||
forge --version | ||
- name: Run Forge fmt | ||
run: | | ||
forge fmt --check | ||
id: fmt | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env | ||
|
||
# Miscellaneous | ||
.gas-snapshot | ||
.DS_Store | ||
.private/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least | |
the "copyright" line and a pointer to where the full notice is found. | ||
|
||
<one line to give the program's name and a brief idea of what it does.> | ||
Copyright (C) <year> <name of author> | ||
Copyright (C) 2024 Emmanuel Joseph <[email protected]> (https://emmanueljet.com) | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,59 @@ | ||
# MultiSigEnterpriseVault | ||
An open-source, enterprise-grade Multi-Signature Vault smart contract developed using Solidity and Foundry. Features advanced access control mechanisms, separate timelocks, and robust security measures for managing digital assets. | ||
|
||
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. | ||
|
||
## Features | ||
|
||
- Multi-signature functionality with flexible threshold settings. | ||
- Separate timelocks for transactions and owner overrides. | ||
- Role-based access control (Owner, Executor, Signers). | ||
- Secure self-destruct mechanism with safety checks. | ||
|
||
## Getting Started | ||
|
||
- Clone the repository: | ||
|
||
```bash | ||
git clone https://github.com/emmanuelJet/MultiSigEnterpriseVault.git | ||
cd MultiSigEnterpriseVault | ||
``` | ||
|
||
- Install dependencies: | ||
|
||
```bash | ||
forge install | ||
``` | ||
|
||
- Run the compiler command: | ||
|
||
```bash | ||
forge build | ||
``` | ||
|
||
- Run the test command: | ||
|
||
```bash | ||
forge test | ||
``` | ||
|
||
- Run the gas-snapshot command: | ||
|
||
```bash | ||
forge snapshot | ||
``` | ||
|
||
## License | ||
|
||
```md | ||
Copyright (C) 2024 Emmanuel Joseph <[email protected]> (https://emmanueljet.com) | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
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. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[profile.default] | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
solc = "0.8.27" | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options |
Submodule openzeppelin-contracts
added at
dbb610
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/ | ||
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ | ||
forge-std/=lib/forge-std/src/ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.27; | ||
|
||
import {Script, console} from "forge-std/Script.sol"; | ||
import {Counter} from "../src/Counter.sol"; | ||
|
||
contract CounterScript is Script { | ||
Counter public counter; | ||
|
||
function setUp() public {} | ||
|
||
function run() public { | ||
vm.startBroadcast(); | ||
|
||
counter = new Counter(); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.27; | ||
|
||
contract Counter { | ||
uint256 public number; | ||
|
||
function setNumber(uint256 newNumber) public { | ||
number = newNumber; | ||
} | ||
|
||
function increment() public { | ||
number++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.27; | ||
|
||
import {Test, console} from "forge-std/Test.sol"; | ||
import {Counter} from "../src/Counter.sol"; | ||
|
||
contract CounterTest is Test { | ||
Counter public counter; | ||
|
||
function setUp() public { | ||
counter = new Counter(); | ||
counter.setNumber(0); | ||
} | ||
|
||
function test_Increment() public { | ||
counter.increment(); | ||
assertEq(counter.number(), 1); | ||
} | ||
|
||
function testFuzz_SetNumber(uint256 x) public { | ||
counter.setNumber(x); | ||
assertEq(counter.number(), x); | ||
} | ||
} |