5.1 KiB
EDUT Contracts
On-chain contracts and deployment artifacts for EDUT ID and entitlements.
Scope
- EDUT ID contract (soulbound governance identity).
- Offer + entitlement settlement contract for fixed-SKU purchases.
- ABI and deployment artifact publication.
- Last Light continuity-release controller (guardian threshold + EIP-712 signatures).
Current Contract
contracts/EdutHumanMembership.sol
Features:
- One-time soulbound human token mint (
EDUT ID, symbolEID). - Gas-only mint path (no platform fee, no treasury transfer).
- Sponsor mint support (
mintMembership(recipient)) where sponsor only pays gas. - Membership status lifecycle (
ACTIVE/SUSPENDED/REVOKED) for runtime gates.
contracts/EdutOfferEntitlement.sol
Features:
- Membership-gated entitlement purchases.
- Owner-configurable offer registry (
upsertOffer). - Fixed USDC settlement support (ETH optional if payment token is zero address).
contracts/LastLightController.sol
- Guardian-threshold (
M-of-N) continuity release controller. - Two-phase trigger (
armthenexecute) with timelock. - EIP-712 typed-signature quorum for arm/cancel/execute.
- On-chain execution event for publicly verifiable continuity trigger.
- Deterministic entitlement id sequence with state lifecycle (
ACTIVE/SUSPENDED/REVOKED). - Emits offer + entitlement events for backend reconciliation.
Local Commands
Use a Hardhat-supported Node runtime (20.x recommended).
npm installnpm run buildnpm run testnpm run check:addressesnpm run deploy:sepolianpm run deploy:mainnetnpm run deploy:entitlement:sepolianpm run deploy:entitlement:mainnetnpm run deploy:lastlight:sepolianpm run deploy:lastlight:mainnetnpm run smoke:funding:sepolianpm run lastlight:eip712:sepolia
make check wraps build + tests.
Deployment Environment
Copy .env.example values into your shell/session before deploy:
DEPLOYER_PRIVATE_KEYBASE_SEPOLIA_RPC_URL/BASE_MAINNET_RPC_URLMINT_CURRENCY_ADDRESS(use zero address for gas-only EDUT ID mint)MINT_AMOUNT_ATOMIC(set to0for gas-only EDUT ID mint)DEPLOY_OUTPUT_PATH(optional)ENTITLEMENT_TREASURY_WALLETMEMBERSHIP_CONTRACT_ADDRESSPAYMENT_TOKEN_ADDRESSOFFER_PRICE_ATOMICENTITLEMENT_DEPLOY_OUTPUT_PATH(optional)OFFERS_JSON(optional path to per-offer seed config JSON)OFFERS_INLINE_JSON(optional inline JSON array alternative toOFFERS_JSON)SEED_RETRIES(optional, default2)SEED_RETRY_DELAY_MS(optional, default1200)SEED_ONLY(optional,trueattaches to an existing entitlement contract and only seeds offers)ENTITLEMENT_CONTRACT_ADDRESS(required whenSEED_ONLY=true)LASTLIGHT_GUARDIANS(required for Last Light deployment, comma-separated guardian addresses)LASTLIGHT_THRESHOLD(optional, default3, must be <= guardian count)LASTLIGHT_DEPLOY_OUTPUT_PATH(optional deployment output JSON path)
If no offer override JSON is provided, deploy script seeds default offers at OFFER_PRICE_ATOMIC.
Use deploy/offers.template.json to define per-offer prices and policy flags.
Smoke flow optional vars:
E2E_IDENTITY_ASSURANCE_LEVELE2E_IDENTITY_ATTESTED_BYE2E_IDENTITY_ATTESTATION_IDE2E_OFFER_IDE2E_ORG_ROOT_IDE2E_PRINCIPAL_IDE2E_PRINCIPAL_ROLEE2E_WORKSPACE_IDE2E_DEVICE_IDE2E_PLATFORME2E_LAUNCHER_VERSIONE2E_GAS_LIMIT(optional fixed gas limit, default300000)E2E_GAS_PRICE_WEI(optional fixed gas price)SMOKE_MIN_GAS_PRICE_WEI(optional threshold floor for funding estimator, default1000000000)
Last Light EIP-712 flow vars:
LASTLIGHT_ACTION(arm,cancel, orexecute)LASTLIGHT_CONTRACT_ADDRESSLASTLIGHT_RELEASE_ID(bytes32or plain string to hash)LASTLIGHT_GUARDIAN_PRIVATE_KEYS(comma-separated private keys for signing)LASTLIGHT_DEADLINE_SECONDS(optional, default3600)LASTLIGHT_REASON_HASH(arm/cancel, optionalbytes32or plain string)LASTLIGHT_DECRYPTION_KEY(execute, required)LASTLIGHT_MANIFEST_REF_HASH(execute, optionalbytes32or plain string)
Example (Sepolia):
cd <home>/Documents/VSG\ Codex/contracts
export $(grep -v '^#' .env | xargs)
npm run deploy:sepolia
Full control-plane smoke (EDUT ID + marketplace + governance install/status):
cd <home>/Documents/VSG\ Codex/contracts
export $(grep -v '^#' .env | xargs)
npm run smoke:e2e:controlplane:sepolia
Offer readback verification against deployed entitlement contract:
cd <home>/Documents/VSG\ Codex/contracts
export BASE_SEPOLIA_RPC_URL="https://base-sepolia.g.alchemy.com/v2/<key>"
export ENTITLEMENT_CONTRACT_ADDRESS="0x..."
npm run verify:offers:sepolia
Sepolia smoke funding threshold from live fee data:
cd <home>/Documents/VSG\ Codex/contracts
export BASE_SEPOLIA_RPC_URL="https://base-sepolia.g.alchemy.com/v2/<key>"
npm run smoke:funding:sepolia
Boundary
Contracts are settlement primitives. Runtime execution remains off-chain and fail-closed by entitlement state.