You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/talent_plus/README.md
+69-29Lines changed: 69 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This directory contains the core smart contracts for the TalentPlus subscription
4
4
5
5
## Overview
6
6
7
-
The TalentPlus system enables anyone to purchase subscriptions for users using ETH payments, with flexible subscription models, TALENT token-based discounts (including vault staking), and administrative capabilities for custom subscription management. Users can purchase subscriptions for any wallet address, enabling gift subscriptions and corporate subscription management.
7
+
The TalentPlus system enables anyone to purchase subscriptions for users using USDC (ERC20) payments, with flexible subscription models, TALENT token-based discounts (including vault staking), and administrative capabilities for custom subscription management. Users can purchase subscriptions for any wallet address, enabling gift subscriptions and corporate subscription management.
8
8
9
9
## Contracts
10
10
@@ -25,12 +25,12 @@ The core subscription management contract that handles subscription models and u
-`addUserSubscription(address wallet, string subscriptionSlug, address payer, uint256 pricePaid)` - Standard subscription with model-based duration. `payer` is who paid, `pricePaid` is the ETH amount paid.
33
+
-`addUserSubscription(address wallet, string subscriptionSlug, address payer, uint256 pricePaid)` - Standard subscription with model-based duration. `payer` is who paid, `pricePaid` is the USDC amount paid.
34
34
-`addUserSubscriptionWithExpiration(address wallet, uint256 expirationTime)` - Custom expiration time (sets slug as "custom"). For these admin-set subscriptions, `payer` is `msg.sender` and `pricePaid` is `0` in the emitted events.
35
35
36
36
**Query Functions:**
@@ -53,7 +53,9 @@ The core subscription management contract that handles subscription models and u
The payment and subscription creation contract that handles ETH payments and integrates with TalentPlusSubscription. Anyone can call the subscription functions.
71
+
The payment and subscription creation contract that handles USDC (ERC20) payments and integrates with TalentPlusSubscription. Anyone can call the subscription functions.
70
72
71
73
#### Key Features
72
74
73
-
-**ETH Payment Integration**: Handles native ETH payments for subscriptions
75
+
-**USDC Payment Integration**: Handles ERC20 USDC payments for subscriptions
74
76
-**TALENT-Based Discounts**: Automatically applies discounts based on TALENT token holdings and vault staking
75
77
-**Direct Access**: Anyone can create subscriptions by calling the subscribe function
76
78
-**Dynamic Pricing**: Fetches subscription costs and applies discounts from TalentPlusSubscription contract
77
79
-**Gift Subscriptions**: Anyone can purchase subscriptions for any wallet address
-**Integration**: Seamless integration with TalentPlusSubscription
82
+
-**SafeERC20**: Uses OpenZeppelin's SafeERC20 for secure token transfers
80
83
81
84
#### Main Functions
82
85
83
86
**Core Subscription:**
84
-
-`subscribe(address wallet, string subscriptionSlug)` - Main subscription function (anyone can purchase for any wallet, requires ETH payment)
87
+
-`subscribe(address wallet, string subscriptionSlug, uint256 tokenAmount)` - Main subscription function (anyone can purchase for any wallet, requires USDC payment). User must approve the contract to spend USDC first.
0 commit comments