Active Tiers
| Tier ID | Description | Payment Token | Min Days | Price/day |
|---|---|---|---|---|
| 1 | Farcaster Pro | USDC | 30 | 328767 wei USDC |
Read
price
Get the total price in payment token (uint256) to purchase a tier subscription for a given number of days.
| Param Name | type | Description |
|---|---|---|
| tier | uint256 | The tier ID to calculate price for |
| forDays | uint256 | The number of days to calculate price for |
tierInfo
Get information about a specific tier. Returns aTierInfo struct.
| Param Name | type | Description |
|---|---|---|
| tier | uint256 | The tier ID |
TierInfo struct parameters:
| Param Name | type | Description |
|---|---|---|
| minDays | uint256 | Minimum number of days required to purchase |
| maxDays | uint256 | Maximum number of days per purchase |
| vault | address | Payment destination address |
| paymentToken | IERC20 | ERC20 payment token |
| tokenPricePerDay | uint256 | Price per day in fundamental units of paymentToken |
| isActive | bool | Whether tier is currently active |
Write
purchaseTier
Purchase a subscription tier for a given fid. If the account already has an active subscription, purchasing will extend their total subscription time.| Param Name | type | Description |
|---|---|---|
| fid | uint256 | The fid to credit the subscription to |
| tier | uint256 | The tier ID to calculate price for |
| forDays | uint256 | The number of days to calculate price for |
batchPurchaseTier
Purchase a subscription tier for multiple fids in a single transaction. If an account already has an active subscription, purchasing will extend their total subscription time.| Param Name | type | Description |
|---|---|---|
| tier | uint256 | The tier ID to calculate price for |
| fids | uint256[] | Array of fids |
| forDays | uint256[] | Array of days, corresponding to each fid in the fids array |
Events
PurchasedTier
Emitted when a tier is purchased for a Farcaster account.| Param Name | type | Description |
|---|---|---|
| fid | uint256 indexed | Farcaster ID the tier was purchased for |
| tier | uint256 indexed | Tier ID that was purchased |
| forDays | uint256 | Number of days of subscription purchased |
| payer | address indexed | Caller address that paid |
Errors
| Error | Selector | Description |
|---|---|---|
| InvalidDuration | 76166401 | The caller attempted to purchase an invalid number of days. |
| InvalidTier | e1423617 | The caller attempted to purchase an invalid or inactive tier. |
| InvalidBatchInput | 0a514b99 | The caller provided mismatched arrays of fids and forDays. |
Source
TierRegistry.sol
