This package contains the core smart contracts for the SignVault document signing platform.
- DocumentRWA.sol - Main contract for document management and NFT minting
- Organization.sol - Organization management and membership
- UserProfile.sol - User profile management
- Message.sol - Messaging system between users
- NFT.sol - Base NFT contract for document tokens
- Foundry installed
- Node.js and bun/npm/yarn
- Testnet ETH for deployment
- API keys for Alchemy and Etherscan
-
Install dependencies:
forge install
-
Copy environment file:
cp .env.example .env
-
Configure your .env file:
# Add your private key (without 0x prefix) PRIVATE_KEY=your_private_key_here # Add your Alchemy API key ALCHEMY_API_KEY=your_alchemy_api_key_here # Add Etherscan API keys for verification ETHERSCAN_API_KEY=your_etherscan_api_key_here
Run local tests:
forge testRun tests with gas reporting:
forge test --gas-reportDeploy to Sepolia testnet:
./deploy.sh sepoliaDeploy to other networks:
./deploy.sh goerli
./deploy.sh polygon_mumbai
./deploy.sh arbitrum_sepoliaAfter deployment, run on-chain tests:
./test-onchain.sh sepoliaNote: You'll need to update the contract addresses in the test script after deployment.
After deployment, contract addresses will be saved in the broadcast/ directory. Update your frontend configuration with these addresses.
Contracts are automatically verified during deployment if you have the correct API keys configured.
- Create your contract in
src/ - Add tests in
test/ - Update the deployment script in
script/Deploy.s.sol - Update the on-chain test script if needed
Run gas snapshots to track gas usage:
forge snapshotRun static analysis with Slither:
slither .- Ethereum Sepolia (testnet)
- Ethereum Goerli (testnet)
- Polygon Mumbai (testnet)
- Arbitrum Sepolia (testnet)
-
Deployment fails with "insufficient funds"
- Ensure your wallet has enough testnet ETH
- Get testnet ETH from faucets
-
Verification fails
- Check your Etherscan API key
- Ensure the contract was deployed successfully
-
RPC errors
- Check your Alchemy API key
- Try a different RPC endpoint
- Check the Foundry documentation
- Review contract tests for usage examples
- Check deployment logs in the
broadcast/directory