Skip to main content

contracts/handlers/carrot-vesting-handler

Classes

CarrotVestingHandler

Handler for the CarrotVesting contract exposing methods to interact with the contract.

Constructors

new CarrotVestingHandler()

new CarrotVestingHandler(chain, walletClient, publicClient): CarrotVestingHandler

Create the handler for the CarrotVesting contract exposing methods to interact with the contract.

Parameters
ParameterTypeDescription
chainChainChain to use for the client.
walletClientobjectThe wallet client to use for wallet interactions.
publicClientobjectThe public client to use for public interactions.
Returns

CarrotVestingHandler

Source

lib/contracts/handlers/carrot-vesting-handler.ts:35

Properties

PropertyModifierTypeDescription
chainprivateChainChain to use for the client.
erc20PermitHandlerprivateERC20PermitHandler-
publicClientprivateobjectThe public client to use for public interactions.
viemChainprivateChain-
walletClientprivateobjectThe wallet client to use for wallet interactions.

Methods

calculateClaimableAmount()

calculateClaimableAmount(user): Promise<bigint>

Calculate the claimable amount for a user.

Parameters
ParameterTypeDescription
user`0x${string}`The user address.
Returns

Promise<bigint>

The claimable amount.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:80

claim()

claim(): Promise<`0x${string}`>

Claim vested tokens.

Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:98

duration()

duration(): Promise<number>

Get the duration of the vesting period.

Returns

Promise<number>

The duration of the vesting period.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:243

exchangeRate()

exchangeRate(): Promise<bigint>

Get the exchange rate.

Returns

Promise<bigint>

The exchange rate.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:89

getCarrotAddress()

getCarrotAddress(): Promise<`0x${string}`>

Get the CARROT token address.

Returns

Promise<`0x${string}`>

The CARROT token address.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:110

getContract()

getContract(): object

Get the contract.

Returns

object

The viem contract.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:53

getPufferAddress()

getPufferAddress(): Promise<`0x${string}`>

Get the PUFFER token address.

Returns

Promise<`0x${string}`>

The PUFFER token address.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:119

maxCarrotAmount()

maxCarrotAmount(): Promise<bigint>

Get the maximum carrot amount.

Returns

Promise<bigint>

The maximum carrot amount.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:146

owner()

owner(): Promise<`0x${string}`>

Get the owner of the contract.

Returns

Promise<`0x${string}`>

The owner address.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:70

startTimestamp()

startTimestamp(): Promise<number>

Get the start timestamp.

Returns

Promise<number>

The start timestamp.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:178

startVesting()

startVesting(amount, isPreapproved): Promise<`0x${string}`>

Start vesting.

Parameters
ParameterTypeDescription
amountbigintThe amount to vest.
isPreapprovedbooleanWhether the CARROT token is preapproved or should use permit.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:216

startVestingPreapproved()

startVestingPreapproved(amount): Promise<`0x${string}`>

Start vesting for a user.

Parameters
ParameterTypeDescription
amountbigintThe amount to vest.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:188

startVestingWithPermit()

startVestingWithPermit(permitData): Promise<`0x${string}`>

Start vesting with permit.

Parameters
ParameterTypeDescription
permitDataPermitDataThe permit data including deadline, amount, v, r, and s values.
Returns

Promise<`0x${string}`>

The transaction.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:201

steps()

steps(): Promise<number>

Get the number of vesting steps.

Returns

Promise<number>

The number of vesting steps.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:137

totalDepositedAmount()

totalDepositedAmount(): Promise<bigint>

Get the total deposited amount.

Returns

Promise<bigint>

The total deposited amount.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:234

totalPufferRewards()

totalPufferRewards(): Promise<bigint>

Get the total puffer rewards.

Returns

Promise<bigint>

The total puffer rewards.

Source

lib/contracts/handlers/carrot-vesting-handler.ts:128

vestings()

vestings(user): Promise<object>

Get vesting information for a user.

Parameters
ParameterTypeDescription
user`0x${string}`The user address.
Returns

Promise<object>

The vesting information including deposited amount, claimed amount, last claimed timestamp, and deposited timestamp.

claimedAmount

claimedAmount: bigint

depositedAmount

depositedAmount: bigint

depositedTimestamp

depositedTimestamp: number

lastClaimedTimestamp

lastClaimedTimestamp: number

Source

lib/contracts/handlers/carrot-vesting-handler.ts:157