Subscriptions, settled by the chain itself.
Customer signs once. The chain fires every recurring charge, every period, on schedule. No off-chain keeper to maintain, no failed-charge retry queue, no payment-provider lock-in. This is what ARC-21 cron + ARC-20 transfers unlock.
54 lines of production JavaScript.
// AsentumPremium — recurring subscription contract.
// Customer deposits ASE → chain debits the merchant every period.
contract AsentumPremium {
init({ merchant }) {
storage.set('merchant', merchant);
cron.schedule(this.address, 'chargeAll', '+1d');
}
subscribe(tier) {
const cfg = tier === 'w'
? { amount: 3, period: 604800 } // 3 ASE / week
: { amount: 10, period: 2592000 }; // 10 ASE / month
storage.set('sub:' + msg.sender, {
tier,
amount: cfg.amount * 1e18,
period: cfg.period,
balance: msg.value,
nextCharge: chain.timestamp + cfg.period,
});
}
// Called by cron every day. The chain itself walks due jobs.
chargeAll() {
const merchant = storage.get('merchant');
for (const [addr, s] of storage.entries('sub:')) {
if (chain.timestamp >= s.nextCharge && s.balance >= s.amount) {
s.balance -= s.amount;
s.nextCharge += s.period;
transfer(merchant, s.amount);
}
}
cron.schedule(this.address, 'chargeAll', '+1d');
}
}This is the actual contract powering Premium on social.asentum.com. subscribe() takes the deposit; chargeAll() is fired daily by the chain's cron registry. No keeper, no Gelato, no Chainlink Automation.
Merchant deploys the contract.
A subscription contract goes on-chain once. It defines tiers, amounts, periods, and the cron schedule for due-checks. Less than 60 lines of JavaScript.
Customer subscribes in one signed tx.
A single transaction deposits ASE into the contract. That deposit funds the next N charges. No card-on-file, no payment-provider account, no recurring auth.
Chain fires every recurring charge.
Every day, the chain walks every active subscriber. Due ones get charged. Period advances. The merchant's balance increases. No keeper service, no failure queue.
No keeper bot. No retry queue. The chain just fires.
On other chains, recurring contracts need an off-chain keeper (Gelato, Chainlink Automation) to fire the tx. Extra cost, extra dependency, extra failure mode.
The customer's deposit funds N future charges. No saved payment method, no auth flow, no PCI surface, no chargeback risk.
Stripe goes down, the chain doesn't. Your subscription business survives without a payment provider in the loop at all.
Charges complete in one block. Merchants see balance updates instantly, customers see deductions instantly. No T+2.
Stop / restart any time by calling the contract. No support ticket, no email loop, no "you cancelled but were still charged".
Every charge is on-chain, signed, timestamped, and verifiable. No SaaS dashboard between you and your revenue history.
What the contract actually uses.
Six VM globals do all the work. Every other “subscription smart contract” in crypto is built on top of an external keeper. This one is built on top of the chain itself.
cron.scheduleSchedule a future call to the contract. The chain itself fires it.
storagePersistent key-value store of every subscription record by address.
storage.entriesPrefix-scan all subscribers in one pass — what powers chargeAll().
transferSend ASE from the contract balance to the merchant on every fire.
msg.senderIdentifies the subscriber. Used as the storage key.
msg.valueThe deposit. Funds the customer's next N recurring charges.
chain.timestampCompared against nextCharge to decide if a sub is due.
this.addressThe contract's own address — passed back into cron.schedule.
Read the contract on GitHub.
The actual premium.js powering social.asentum.com — fork it, tweak tiers, redeploy.
Inspect the live deployment.
Browse every signed subscribe + cron-fired chargeAll tx as they happen on testnet.
ARC-21 cron specification.
The standard that lets contracts schedule themselves — what makes this dapp possible at all.
Five more dapps showing what JS-native + cron unlocks.
Each one is a working demo with the contract source linked. Pick the one that matches what you're building.
Agents that schedule themselves on-chain.
Open showcase →Royalty splitsRevenue splits that auto-distribute.
Open showcase →PayrollMonthly payday, fired by the protocol.
Open showcase →Creator economyBorderless tipping + memberships.
Open showcase →TreasuryDCA, rebalance, sweep on autopilot.
Open showcase →SocialOn-chain profiles, posts, comments.
Open showcase →