git clone <repository-url>
cd opacity-solidity-sdk
forge install# Copy the example environment file
cp .env.example .env
# Edit .env and add your private key
PRIVATE_KEY=your_private_key_here# Deploy SimpleVerificationConsumer
forge script script/Deploy.s.sol:Deploy --sig "run(address,address)" <BLS_ADDRESS> <REGISTRY_COORDINATOR> --rpc-url holesky --broadcastDeployment:
- Deploys SimpleVerificationConsumer with provided BLS signature checker
- Writes addresses to
deployments/latest.json - Verifies contracts are properly linked
- Outputs deployment summary
After deployment, addresses are saved to deployments/latest.json:
{
"blsSignatureChecker": "0x2a55810daCeF9197d51B94A21c67d88b8d99b379",
"registryCoordinator": "0x3e43AA225b5cB026C5E8a53f62572b10D526a50B",
"simpleVerificationConsumer": "0x1b4468ce3306f886d4a741950acE0238e4204cdb",
"timestamp": 1234567890
}// Create verification parameters
OpacitySDK.VerificationParams memory params = OpacitySDK.VerificationParams({
quorumNumbers: quorumNumbers,
referenceBlockNumber: referenceBlockNumber,
nonSignerStakesAndSignature: nonSignerStakesAndSignature,
userAddress: userAddress,
platform: "twitter",
resource: "followers",
value: "10000",
threshold: 1000,
signature: "signature_data",
operatorCount: 5
});
// Verify the data
bool success = simpleConsumer.verifyUserData(params);// Verify and store the result
(bool success, string memory verifiedValue) = storageQueryConsumer.verifyPrivateData(params);
if (success) {
// Get stored verification details
(bool isValid, string memory value, uint256 timestamp, bytes32 hash) =
storageQueryConsumer.getUserVerification(userAddress);
}forge buildforge test- no tests currently
forge fmtforge snapshot- VerificationParams struct: Wraps all verification parameters
- verify(): Main verification function returning boolean
- Configurable thresholds: Quorum and block staleness settings
- SimpleVerificationConsumer: Demonstrates basic verification with events
- StorageQueryConsumer: Shows advanced usage with storage and retrieval functions
- EigenLayer Middleware: BLS signature checking and registry coordination
- Foundry: Development and testing framework
- OpenZeppelin: Standard library contracts (via EigenLayer)
forge script script/Deploy.s.sol:Deploy --sig "run(address,address)" <BLS_ADDRESS> <REGISTRY_COORDINATOR> --rpc-url holesky --broadcastblsSignatureCheckerAddress: Address of the BLS signature checker contractregistryCoordinator: Address of the registry coordinator contract
For more information about Foundry, visit: https://book.getfoundry.sh/
# Local development node
anvil
# Cast commands for chain interaction
cast <subcommand>
# Help
forge --help
anvil --help
cast --help