@orbitmem/contracts
v0.1.0
Published
Solidity smart contracts for OrbitMem — on-chain data discovery and reputation (ERC-8004)
Maintainers
Readme
@orbitmem/contracts
Solidity smart contracts for OrbitMem — on-chain data discovery and reputation (ERC-8004).
Install
npm install @orbitmem/contractsUsage
import {
DataRegistryAbi,
FeedbackRegistryAbi,
DataRegistryBytecode,
FeedbackRegistryBytecode,
} from "@orbitmem/contracts";
import { getContract } from "viem";
const dataRegistry = getContract({
address: "0x9eE44938ED77227470CaA2DbCC0459F49d249B7A",
abi: DataRegistryAbi,
client: walletClient,
});
const feedbackRegistry = getContract({
address: "0x1Bce77f90C33A5f8faCa54782Ce3a17d1AD7109a",
abi: FeedbackRegistryAbi,
client: walletClient,
});Deployed Addresses
| Contract | Base | Base Sepolia |
| ---------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- |
| DataRegistry | TBD | 0x9eE44938ED77227470CaA2DbCC0459F49d249B7A |
| FeedbackRegistry | TBD | 0x1Bce77f90C33A5f8faCa54782Ce3a17d1AD7109a |
Contracts
DataRegistry
ERC-721 registry where each token represents a registered data entry.
register(dataURI)— Mint a new data entry NFT, returnstokenIdsetDataURI(tokenId, dataURI)— Update metadata URI (owner only)setActive(tokenId, active)— Toggle active/inactive status (owner only)isActive(tokenId)— Check if entry is active
FeedbackRegistry
Registry-agnostic reputation system. Works with any ERC-721 registry, not just DataRegistry.
giveFeedback(registry, entityId, value, valueDecimals, tag1, tag2, feedbackURI, feedbackHash)— Submit scored feedback with dual-tag categorizationrevokeFeedback(registry, entityId, index)— Revoke a feedback entrygetScore(registry, entityId)— Get aggregated score (totalValue, count)getTagScore(registry, entityId, tag)— Get score for a specific taggetFeedback(registry, entityId, client, index)— Get individual feedback entry
// Register data
uint256 dataId = dataRegistry.register("ipfs://my-data-metadata");
// Submit feedback
feedbackRegistry.giveFeedback(
address(dataRegistry), dataId,
90, 0, // value: 90, decimals: 0
"accurate", "", // tags
"", bytes32(0) // optional URI and hash
);
// Query score
(int256 total, uint256 count) = feedbackRegistry.getScore(address(dataRegistry), dataId);Development
Requires Foundry.
forge build # Compile
forge test -vvv # Run tests
forge test --gas-report # Gas reporting
forge fmt # FormatDeploy
OWNER=<SAFE_ADDRESS> forge script script/Deploy.s.sol \
--broadcast --rpc-url <RPC_URL> --private-key <KEY>License
MIT
