|
|
||
|---|---|---|
| .gitea/workflows | ||
| abi | ||
| contracts | ||
| deploy | ||
| docs | ||
| scripts | ||
| test | ||
| .env.example | ||
| .gitignore | ||
| .nvmrc | ||
| hardhat.config.cjs | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
EDUT Contracts
On-chain contracts and deployment artifacts for membership and entitlements.
Scope
- Human membership contract (soulbound governance identity).
- Offer + entitlement settlement contract for fixed-SKU purchases.
- ABI and deployment artifact publication.
Current Contract
contracts/EdutHumanMembership.sol
Features:
- One-time soulbound human token mint.
- Sponsor mint support (
mintMembership(recipient)can be paid by inviter/company wallet). - Owner-configurable flat mint price (
updateMintPrice), launch default is fixed100 USDC(6 decimals). - Membership status lifecycle (
ACTIVE/SUSPENDED/REVOKED) for runtime gates. - Treasury address control for settlement routing.
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).
- 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 update:membership:price:sepolianpm run update:membership:price:mainnetnpm run smoke:funding: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_URLTREASURY_WALLETMINT_CURRENCY_ADDRESS(USDC token contract on target chain)MINT_AMOUNT_ATOMICDEPLOY_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)
update:membership:price:* requires:
MEMBERSHIP_CONTRACT_ADDRESSMINT_CURRENCY_ADDRESSMINT_AMOUNT_ATOMIC
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)
Example (Sepolia):
cd /Users/vsg/Documents/VSG\ Codex/contracts
export $(grep -v '^#' .env | xargs)
npm run deploy:sepolia
Full control-plane smoke (membership + marketplace + governance install/status):
cd /Users/vsg/Documents/VSG\ Codex/contracts
export $(grep -v '^#' .env | xargs)
npm run smoke:e2e:controlplane:sepolia
Offer readback verification against deployed entitlement contract:
cd /Users/vsg/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 /Users/vsg/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.