MultiGuard is a decentralized multisig governance protocol that enables secure and decentralized control of digital assets through smart contracts on the Ethereum blockchain. The protocol implements a robust governance framework where multiple authorized signers must approve transactions and administrative actions. MultiGuard is fully compatible with all EVM-compatible chains, allowing for seamless deployment across multiple networks from the web interface.
- Decentralized governance through multisig controls
- Create and manage shared ownership groups
- Secure digital asset management
- Multi-signature transaction approval
- Real-time notifications
- Mobile-responsive design
- Support for multiple networks (Ethereum, Arbitrum, Polygon, BSC, Avalanche)
- Node.js (v14 or higher)
- npm or yarn
- MetaMask or another Web3 wallet
- Git
Create a .env
file in the root directory by copying .env.example
:
cp .env.example .env
Required environment variables:
ARBISCAN_API_KEY
: Required for deploying and verifying contracts on Arbitrum OnePRIVATE_KEY
: Your wallet's private key for contract deploymentREACT_APP_DEFAULT_NETWORK
: Default network ID (1 for Ethereum mainnet)REACT_APP_INFURA_ID
: Infura project ID for frontend
- Clone the repository:
git clone https://github.com/yourusername/multiguard-dapp.git
cd multiguard-dapp
- Install dependencies:
npm install
# or
yarn install
- Start the development server:
npm start
# or
yarn start
- Open http://localhost:3000 to view it in your browser.
To deploy the dapp to GitHub Pages, simply run:
npm run deploy
This will:
- Build the production version of your dapp
- Deploy it to the
gh-pages
branch - Make it available at
https://jio-gl.github.io/multiguard
npm start
- Runs the app in development modenpm test
- Launches the test runnernpm run build
- Builds the app for productionnpm run eject
- Ejects from Create React Appnpm run compile
- Compiles the smart contracts and updates the bytecode artifactnpm run node
- Starts a local Hardhat nodenpm run deploy:local
- Deploys example token to local networknpm run deploy:arbitrum
- Deploys the MultiGuard contract to Arbitrum Onenpm run deploy
- Deploys the dapp to GitHub Pagesnpm run update-artifact
- Updates the contract artifact in the frontendnpm run flatten
- Generates a flattened version of the MultiGuard contractnpm run verify
- Verifies a deployed contract on Arbitrum Onenpm run deploy:verify:arbitrum
- Compiles, deploys and verifies the contract on Arbitrum One
To deploy the MultiGuard contract to Arbitrum One:
-
Make sure you have an Arbiscan API key in your
.env
file:ARBISCAN_API_KEY=your_arbiscan_api_key_here
-
Make sure you have a private key with funds in your
.env
file:PRIVATE_KEY=your_wallet_private_key_here
-
Run the deployment script:
npm run deploy:arbitrum
This will:
- Deploy the MultiGuard contract to Arbitrum One
- Wait for the deployment to be mined
- Verify the contract on Arbiscan
To verify a deployed contract on Arbitrum One:
-
Make sure you have an Arbiscan API key in your
.env
file:ARBISCAN_API_KEY=your_arbiscan_api_key_here
-
Run the verify command with the contract name, address, and constructor arguments file:
npm run verify --contract=MultiGuard --address=0x1234567890123456789012345678901234567890 --args=scripts/arguments.js
For example, to verify the MultiGuard contract:
npm run verify --contract=MultiGuard --address=0x1234567890123456789012345678901234567890 --args=scripts/arguments.js
-
Alternatively, you can use the standard Hardhat verify command:
npx hardhat verify --network arbitrumOne 0x1234567890123456789012345678901234567890 --constructor-args scripts/arguments.js
-
For complex constructor arguments, you can use a JSON file as shown in the example
scripts/arguments.js
.
multiguard-dapp/
├── contracts/ # Smart contract source files
├── public/ # Static files
├── src/ # Frontend source files
│ ├── components/ # React components
│ ├── config/ # Configuration files
│ ├── contracts/ # Contract ABIs and addresses
│ ├── styles/ # CSS and style files
│ ├── utils/ # Utility functions
│ ├── App.jsx # Main App component
│ ├── index.js # Application entry point
│ └── index.css # Global styles
├── scripts/ # Deployment and verification scripts
├── test/ # Contract and frontend tests
├── docs/ # Documentation files
├── flattened/ # Flattened contract files for verification
├── hardhat.config.js # Hardhat configuration
├── postcss.config.js # PostCSS configuration
├── tailwind.config.js # Tailwind CSS configuration
├── package.json # Dependencies and scripts
└── README.md # Project documentation
The project uses Hardhat as the main development framework. Smart contracts are located in the contracts/
directory and can be:
- Compiled:
npx hardhat compile
- Tested:
npx hardhat test
- Deployed to local network:
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
Run the test suite:
# Smart contract tests
npm run test:contracts
# Frontend tests
npm run test:react
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Project Link: https://github.com/jio-gl/multiguard