CreateLock

Curve Action Plugin - CreateLock

Description

Deposit CRV into the contract and create a new lock.

Prior to calling this function, the contract must be approved to transfer at least value CRV. A new lock cannot be created when an existing lock already exists.

Method

create_lock(uint256, uint256)

Input Parameters

No required input parameters

Method Parameters

NameTypeDescription

value

FctValue

The amount of CRV to deposit.

unlock_time

FctValue

Epoch time when tokens unlock. This value is rounded down to the nearest whole week. The maximum duration for a lock is four years.

Returned Values

No returned values

Example

Example with initParams

const createLock = new Curve.actions.CreateLock({
   chainId: 1,
   initParams: {
     methodParams: {
       value: "...",
       unlock_time: "..."
     }
   }
})

Example without initParams

const createLock = new Curve.actions.CreateLock({ chainId: 1 })

createLock.input.set({
    methodParams: {
       value: "...",
       unlock_time: "..."
    }
})

Learn more

Learn more about Curve create lock function here

Last updated