ReviveSafe is a full-stack multisignature wallet solution designed for the Polkadot ecosystem. It leverages Polkadot’s new EVM‐compatible environment (PolkaVM) and the custom pallet‐revive runtime module to run Solidity contracts natively on RISC-V. On the frontend, a React dashboard (written in TypeScript and styled with Tailwind and shadcn/ui) provides a seamless user experience: connect a PolkaVM-compatible wallet, create or register multisig wallets, view and manage owned wallets, and submit or confirm transactions—all with sub-second finality and low fees.
MultiSigWallet.sol
Implements a standard multisig pattern: an array of owners, a required threshold, and a dynamic list of transaction proposals.
Owners can call submitTransaction(destination, value, data) to propose a transfer. Each proposal is assigned a numeric ID.
Other owners call confirmTransaction(txId) to register their approval. Once confirmations ≥ threshold, executeTransaction(txId) automatically sends funds via a low-level call{value:…}.
Owners can revoke prior confirmations (via revokeConfirmation(txId)) before execution.
Read-only methods include getOwners(), required(), getTransactionCount(), getTransactionIds(), and getConfirmations().
MultiSigFactory.sol
Anyone can call createMultiSig(address[] owners, uint256 required) to deploy a new MultiSigWallet instance on-chain; the factory stores its address in an on-chain array allMultiSigs[].
registerExistingMultisig(address multisig) allows registering any pre-deployed multisig by verifying it supports isOwner(this).
getAllMultiSigs() returns every multisig ever created or registered, while getMyMultiSigs(address owner) filters that list to only those wallets where owner is among the wallet’s owners.
All contracts compile through the Revive toolchain: solc → YUL → resolc (Revive) → RISC-V. At runtime, PolkaVM’s RISC-V interpreter (pallet-revive) executes the bytecode under Polkadot’s weight/gas model, benefitting from sub-second finality and Polkadot’s shared security.
Structure
The React frontend (in frontend/) is organized into:
Constants & ABIs (src/constants/)
factoryAddress.ts contains the deployed MultiSigFactory address on PolkaVM.
MultiSigFactory.json and MultiSigWallet.json store ABIs for the factory and wallet contracts, respectively.
Hooks (src/hooks/)
useWalletAddress.ts detects and listens for the user’s connected PolkaVM wallet (e.g., MetaMask configured for a PolkaVM parachain).
useFactory.ts returns a signer-connected ethers.Contract instance pointing at MultiSigFactory.
Components (src/components/)
Pages (src/pages/)
PolkaVM & pallet-revive
ReviveSafe’s smooth user experience relies on PolkaVM and the pallet-revive module:
pallet-revive
By compiling the multisig contracts through solc → resolc → pallet-revive, ReviveSafe achieves full Solidity compatibility with minimal code changes. Ethers.js calls (e.g., factory.createMultiSig(...), msContract.confirmTransaction(...)) are seamlessly translated into Substrate extrinsics and executed in PolkaVM