Complete guide for testing the conditional auto-elevation feature connecting TheSeeds (Base) to AbrahamCovenant (Sepolia).
- AbrahamCovenant:
0x5bd79b4bb138e39a42168e9d60e308c86f9dcf15 - AbrahamAuction:
0xb0eb83b00f0f9673ebdfb0933d37646b3315b179 - Deployed: 2025-12-06T22:51:26.928Z
- Network: Ethereum Sepolia
Ensure your .env.local contains:
# Abraham Contracts (Sepolia)
ABRAHAM_COVENANT_ADDRESS=0x5bd79b4bb138e39a42168e9d60e308c86f9dcf15
ABRAHAM_AUCTION_ADDRESS=0xb0eb83b00f0f9673ebdfb0933d37646b3315b179
# Sepolia RPC (use Alchemy/Infura for better performance)
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
# Admin authentication
ADMIN_KEY=your_secret_admin_key_here
# Private key for Abraham operations
PRIVATE_KEY=0x...The new conditional auto-elevation feature allows you to:
- Manual Flow: Select winner, review, then manually elevate
- Automated Flow: Select winner and auto-elevate in one call
Step 1: Select Winner
curl -X POST "http://localhost:3000/api/admin/select-winner" \
-H "X-Admin-Key: your_admin_key_here"Response:
{
"success": true,
"data": {
"winningSeedId": 0,
"round": 1,
"seed": {
"id": 0,
"creator": "0x...",
"ipfsHash": "Qm...",
"blessings": 42,
"isWinner": true,
"winnerInRound": 1
},
"message": "Winner selected successfully. New blessing period started.",
"nextStep": "To elevate to Abraham creation, call: POST /admin/elevate-seed?seedId=0"
}
}Step 2: Review & Elevate
curl -X POST "http://localhost:3000/api/admin/elevate-seed?seedId=0" \
-H "X-Admin-Key: your_admin_key_here"Response:
{
"success": true,
"data": {
"seedId": 0,
"seed": {...},
"abraham": {
"tokenId": 0,
"auctionId": 13,
"mintTxHash": "0x...",
"auctionTxHash": "0x...",
"mintExplorer": "https://sepolia.etherscan.io/tx/0x...",
"auctionExplorer": "https://sepolia.etherscan.io/tx/0x..."
},
"message": "Seed elevated to Abraham creation successfully. Daily auction started."
}
}Single Call - Winner Selection + Elevation
curl -X POST "http://localhost:3000/api/admin/select-winner?autoElevate=true" \
-H "X-Admin-Key: your_admin_key_here"Response:
{
"success": true,
"data": {
"winningSeedId": 0,
"round": 1,
"seed": {
"id": 0,
"creator": "0x...",
"ipfsHash": "Qm...",
"blessings": 42,
"isWinner": true,
"winnerInRound": 1
},
"abraham": {
"tokenId": 0,
"auctionId": 13,
"mintTxHash": "0x...",
"auctionTxHash": "0x...",
"mintExplorer": "https://sepolia.etherscan.io/tx/0x...",
"auctionExplorer": "https://sepolia.etherscan.io/tx/0x..."
},
"message": "Winner selected and auto-elevated to Abraham creation. Daily auction started."
}
}Update your vercel.json to enable auto-elevation:
{
"crons": [
{
"path": "/api/admin/update-snapshot",
"schedule": "0 0 * * *"
},
{
"path": "/api/admin/select-winner?autoElevate=true",
"schedule": "0 0 * * *"
}
]
}Key Points:
- Adding
?autoElevate=trueenables full automation - Without the parameter, manual elevation is required
- Cron job authenticates via
CRON_SECRET(set in Vercel environment)
# Test auto-elevation manually
curl -X POST "http://localhost:3000/api/admin/select-winner?autoElevate=true" \
-H "X-Admin-Key: your_admin_key_here"- Seeds Created: Have at least one seed submitted on TheSeeds (Base)
- Blessings: Users have blessed seeds
- Time Elapsed: At least 24 hours since blessing period started
- Sepolia ETH: Abraham account has Sepolia ETH for gas
1. Check Current Round
curl "http://localhost:3000/api/seeds/current-round"2. View Seeds
curl "http://localhost:3000/api/seeds/seed/0"3. Select Winner (Manual)
curl -X POST "http://localhost:3000/api/admin/select-winner" \
-H "X-Admin-Key: your_admin_key_here"4. Elevate Winner
curl -X POST "http://localhost:3000/api/admin/elevate-seed?seedId=0" \
-H "X-Admin-Key: your_admin_key_here"OR
3. Select Winner + Auto-Elevate (Automated)
curl -X POST "http://localhost:3000/api/admin/select-winner?autoElevate=true" \
-H "X-Admin-Key: your_admin_key_here"5. Verify on Etherscan
- Visit the
mintExplorerURL to see the NFT mint transaction - Visit the
auctionExplorerURL to see the auction creation - Check covenant contract: 0x5bd79b4bb138e39a42168e9d60e308c86f9dcf15
- Check auction contract: 0xb0eb83b00f0f9673ebdfb0933d37646b3315b179
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ABRAHAM ECOSYSTEM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β BASE MAINNET (L2) ETHEREUM SEPOLIA (L1) β
β βββββββββββββββββββ ββββββββββββββββββββββ β
β β TheSeeds β β AbrahamCovenant β β
β β Contract β β 0x5bd79b4b... β β
β ββββββββββ¬βββββββββ βββββββββββ¬βββββββββββ β
β β β β
β β 1. Seeds submitted β 3. Winner minted β
β β 2. Users bless seeds β as NFT (daily) β
β β 3. Winner selected (24h) β β
β β β β
β β βββββββββββββΌβββββββββββ β
β β β AbrahamAuction β β
β β β 0xb0eb83b0... β β
β β ββββββββββββββββββββββββ β
β β β β
β β β 4. Daily auction β
β β β (24 hours) β
β β β β
βββββββββββββΌβββββββββββββββββββββββββββββββΌββββββββββββββββββββββββ
β β
β β
ββββββΌβββββββββββββββββββββββββββββββΌβββββ
β Backend API (abraham-api) β
β β
β Endpoints: β
β β’ POST /admin/select-winner β
β - Default: manual elevation β
β - ?autoElevate=true: automated β
β β
β β’ POST /admin/elevate-seed β
β - Manual elevation only β
βββββββββββββββββββββββββββββββββββββββββββ
Problem: API returns warning about Abraham service.
Check:
.env.localhasABRAHAM_COVENANT_ADDRESSandABRAHAM_AUCTION_ADDRESS.env.localhasPRIVATE_KEYwith Sepolia ETH- ABIs exist in
lib/abi/abrahamCovenant.tsandlib/abi/abrahamAuction.ts - Restart server:
npm run dev
Problem: Can't mint multiple creations in same day.
Solution: Abraham can only commit daily work once per day. Wait until next day (UTC).
Problem: Auto-elevation failed after winner selection.
Solution:
- Winner is still recorded on Base
- Use manual elevation endpoint:
POST /admin/elevate-seed?seedId=X - Check error message for specific issue (gas, approval, etc.)
Problem: Trying to select winner before 24 hours.
Solution: Wait for blessing period to end (24 hours from last winner selection).
- Seeds submitted throughout the day
- Users blessing seeds
- 24 hours elapsed since last winner
- Cron job runs (or manual trigger)
- Winner selected on Base
- Abraham creation minted on Sepolia (if auto-elevate enabled)
- Daily auction started (24 hours, 0.01 ETH min bid)
- Verify transactions on Etherscan
- Monitor auction bids (optional)
- Auction settles after 24 hours (automatic)
- Review before minting: Check winner validity
- Gas control: Mint only when needed
- Error recovery: Retry elevation separately if it fails
- Full automation: No manual intervention needed
- Daily consistency: Guaranteed daily creation if winner exists
- Cron-friendly: Single endpoint for complete flow
- Graceful degradation: If elevation fails, winner is still recorded
- Sepolia Etherscan: https://sepolia.etherscan.io/
- Base Sepolia Explorer: https://sepolia.basescan.org/
- Covenant Contract: https://sepolia.etherscan.io/address/0x5bd79b4bb138e39a42168e9d60e308c86f9dcf15
- Auction Contract: https://sepolia.etherscan.io/address/0xb0eb83b00f0f9673ebdfb0933d37646b3315b179
- DEPLOYMENT.md: Full deployment guide
- Sepolia Faucet: https://sepoliafaucet.com/
Last Updated: 2025-12-07