3.2 KiB
3.2 KiB
EDUT Membership Platform Interfaces (v1)
This document freezes interface targets for membership-gated commerce.
Solidity Interfaces
interface IEdutMembership {
event MembershipMinted(address indexed wallet, uint256 indexed tokenId, uint256 amountPaid, address currency);
event MintPriceUpdated(address indexed currency, uint256 amountAtomic);
event MembershipStatusUpdated(address indexed wallet, uint8 status);
function mintMembership(address recipient) external payable returns (uint256 tokenId);
function hasMembership(address wallet) external view returns (bool);
function membershipStatus(address wallet) external view returns (uint8 status);
function currentMintPrice() external view returns (address currency, uint256 amountAtomic);
}
interface IEdutOfferRegistry {
event OfferUpserted(bytes32 indexed offerKey, bytes32 policyHash, address indexed issuer);
event OfferStatusChanged(bytes32 indexed offerKey, uint8 status);
function upsertOffer(bytes32 offerKey, bytes32 policyHash, bytes calldata encodedOffer) external;
function setOfferStatus(bytes32 offerKey, uint8 status) external;
function getOffer(bytes32 offerKey) external view returns (bytes memory encodedOffer);
}
interface IEdutEntitlement {
event EntitlementMinted(bytes32 indexed entitlementId, bytes32 indexed offerKey, address indexed wallet);
event EntitlementStateChanged(bytes32 indexed entitlementId, uint8 state);
function mintEntitlement(bytes32 offerKey, address wallet, bytes32 policyHash) external returns (bytes32 entitlementId);
function entitlementState(bytes32 entitlementId) external view returns (uint8 state);
}
Status Enums
MembershipStatus:
0 = NONE
1 = ACTIVE
2 = SUSPENDED
3 = REVOKED
OfferStatus:
0 = DRAFT
1 = ACTIVE
2 = PAUSED
3 = RETIRED
EntitlementState:
0 = ACTIVE
1 = SUSPENDED
2 = REVOKED
3 = EXPIRED
API Surface (Backend)
Wallet + Membership
POST /secret/wallet/intentPOST /secret/wallet/verifyPOST /secret/membership/quotePOST /secret/membership/confirmGET /secret/membership/status?designation_code=...
Marketplace
GET /marketplace/offersGET /marketplace/offers/{offer_id}POST /marketplace/checkout/quotePOST /marketplace/checkout/confirmGET /marketplace/entitlements
Issuer APIs
POST /issuer/offers/upsertPOST /issuer/offers/{offer_id}/statusPOST /issuer/manifests/upsert
Deterministic Gate Requirements
- Every checkout quote must include:
quote_idwalletoffer_idcurrencyamount_atomicpolicy_hashexpires_at
- Checkout confirm must fail closed if:
- membership is not active,
- quote expired,
- tx amount/currency mismatch,
- policy hash mismatch.
- Entitlement activation must fail closed when state is not
ACTIVE.
Evidence Requirements
Each successful purchase must emit/record:
- wallet
- membership status snapshot
- offer_id and policy_hash
- quote_id
- tx_hash and chain_id
- entitlement_id
- receipt timestamp
Compatibility Rule
Interfaces can only evolve through additive changes in v1. Breaking changes require v2 namespace and migration plan.