Skip to content

Rengo-Labs/CasperLabs-Curve-DAO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CasperLabs-Curve-DAO

Implementation of following contracts for the CasperLabs platform.

  1. Curve Rewards
  2. Minter
  3. Curve Token v3
  4. ERC20 CRV
  5. Fee Distributor
  6. Gauge Controller
  7. Gauge Proxy
  8. Liquidity Gauge Reward
  9. Liquidity Gauge Reward Wrapper
  10. Liquidity Gauge Wrapper
  11. Lp Token Wrapper
  12. Reward Only Gauge
  13. Vesting Escrow
  14. Vesting Escrow Factory
  15. Vesting Escrow Simple
  16. Voting Escrow
  17. Liquidity Gauge V3
  18. Ownable
  19. I Reward Distribution Recipient

Error Code List

https://docs.google.com/spreadsheets/d/1Rzh1LERQyGiGpHB3djlT1Tk0LNQ18q_eLBWFDPm2bNc/edit#gid=4667616

Original Documentation From Reference Implementation (Liquidity Gauge V3)

https://curve.readthedocs.io/dao-gauges.html#liquiditygaugev3

Table of contents

Interacting with the contract

You need to have casper-client and jq installed on your system to run the examples. The instructions have been tested on Ubuntu 20.04.0 LTS.

Install the prerequisites

You can install the required software by issuing the following commands. If you are on an up-to-date Casper node, you probably already have all of the prerequisites installed so you can skip this step.

Note: If any command fails try again by restarting the terminal to reset the enviornment variable.

Update package repositories

sudo apt update

Install the command-line JSON processor

sudo apt install jq -y

Install rust

Choose cutomize intallation to install nightly version Install the nightly version (by default stable toolchain is installed)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install nightly-2022-04-04
rustup install nightly-2022-11-17

Check that nightly toolchain version is installed(this will list stable and nightly versions)

rustup toolchain list

Set rust nightly as default (this is the older one for contracts)

rustup default nightly-2022-04-04-x86_64-unknown-linux-gnu

Install wasm32-unknown-unknown

rustup target add wasm32-unknown-unknown

Rust Version

rustup --version

Install Cmake

sudo apt-get -y install cmake

Note:https://cgold.readthedocs.io/en/latest/first-step/installation.html

Check if cmake is installed properly

cmake --version

Install the Casper Crates

cargo +nightly-2022-11-17-x86_64-unknown-linux-gnu install cargo-casper

Add Casper repository

echo "deb https://repo.casperlabs.io/releases" bionic main | sudo tee -a /etc/apt/sources.list.d/casper.list
curl -O https://repo.casperlabs.io/casper-repo-pubkey.asc
sudo apt-key add casper-repo-pubkey.asc
sudo apt update
sudo apt install libssl-dev
sudo apt install pkg-config

Install the Casper client software

cargo +nightly-2022-11-17-x86_64-unknown-linux-gnu install casper-client

To check Casper Client Version

casper-client --version

Additonal commands for help

casper-client --help
casper-client <command> --help

Generate the keys

casper-client keygen script/keys

Fund the key

The keys can be funded from casper live website testnet faucet. Requires chrome browser and the casper signer extension. You should import the keys that were generated in the previous step

Deployment

A handy script is being created to deploy all required dependencies sequentially for curve DAO contract deployment.

Note:- Following are the prerequisites to be considered before executing the deploy command

  • Make sure 'Node' is installed in your machine (use node version 16.14.0 for avoiding unknown errors)
  • Your deployemnt keys should be in a new folder named 'keys' at 'script/keys'

Deploy stakeable contract

Use the following command to execute the deployments

make deploy

After deployments, hashes can be found in the folder 'script/hashes' and a zip is also created 'hashes.zip'

Install

Make sure wasm32-unknown-unknown is installed.

  make prepare

It's also recommended to have wasm-strip available in your PATH to reduce the size of compiled Wasm.

Build individual Smart Contract

You can run this commands to build individual smart contracts.

make build-contract-curve-token-v3
make build-liquidity-gauge-reward-wrapper-session-code
make build-i-reward-distribution-recipient
make build-liquidity-gauge-wrapper-session-code
make build-contract-erc20-crv
make build-contract-fee-distributor
make build-contract-gauge-controller
make build-contract-gauge-proxy
make build-contract-liquidity-gauge-reward
make build-contract-liquidity-gauge-reward-wrapper
make build-contract-liquidity-gauge-wrapper
make build-contract-minter
make build-contract-reward-only-gauge
make build-contract-vesting-escrow
make build-contract-vesting-escrow-factory
make build-contract-liquidity-gauge-v3
make build-contract-vesting-escrow-simple
make build-contract-voting-escrow
make build-contract-ownable
make build-lp-token-wrapper
make build-curve-rewards

Test individual Smart Contract

You can run this commands to build individual smart contracts.

make test-curve-token-v3
make test-curve-erc20
make test-erc20-crv
make test-fee-distributor
make test-gauge-controller
make test-gauge-proxy
make test-liquidity-gauge-reward
make test-liquidity-gauge-reward-wrapper
make test-liquidity-gauge-wrapper
make test-minter
make test-reward-only-gauge
make test-vesting-escrow
make test-vesting-escrow-factory
make test-voting-escrow
make test-ownable
make test-i-reward-distribution-recipient
make test-lp-token-wrapper
make test-curve-rewards
make test-liquidity-gauge-v3

Note: High processing power and memory is required to run liquidity gauge v3 test cases.

Test Liquidity Gauge V3 Smart Contract

  make test-liquidity-gauge-v3

Run All Smart Contracts

Run this command to build & test all smart contract.

make all

Check Lint in Smart Contracts

Run this command to build & test all smart contract.

make check-lint

Deploying Reward Only Gauge contract manually

If you need to deploy the Reward Only Gauge contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • admin : Admin account hash for curve-dao
    • lp_token : LP Token contract package hash
    • contract_name : Contract name for deployment

Following is the command to deploy the Reward Only Gauge contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 240000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="admin:Key='key'" \
    --session-arg="lp_token:Key='liquidity pool contract address'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the RewardOnlyGauge's entry point methods.

  • decimals

    Returns U256 decimal places.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_contract

    Returns zero address if no reward is active.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • last_claim

    Returns rewards that are claimed at most once per hour in order to reduce gas costs.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • claimed_reward

    Returns U256 Total amount of token already claimed by addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    token Key

    This method returns U256.

  • claimable_reward

    Returns U256 Claimable reward token amount.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    token Key

    This method returns U256.

  • claimable_reward_write

    Returns U256 Claimable reward token amount.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    token Key

    This method returns U256.

  • set_rewards_receiver

    Receiver address for any rewards claimed via claim_rewards.

    Following is the table of parameters.

    Parameter Name Type
    receiver Key

    This method returns nothing.

  • claim_rewards

    Claim available reward tokens for `addr

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>
    receiver Option<Key>

    This method returns nothing.

  • deposit

    Deposit value LP tokens

    Following is the table of parameters.

    Parameter Name Type
    value U256
    addr Option<Key>
    claim_rewards Option<bool>

    This method returns nothing.

  • withdraw

    Withdraw value LP tokens

    Following is the table of parameters.

    Parameter Name Type
    value U256
    claim_rewards Option<bool>

    This method returns nothing.

  • transfer

    Returns Result<(), u32> if amount transfered successfully return ok().

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Returns Result<(), u32> if amount transfered successfully return ok().

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • approve

    Returns Result<(),u32> on success.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.

  • increase_allowance

    Returns Result<(),u32> on success.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • decrease_allowance

    Returns Result<(),u32> on success.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • set_rewards

    Set the active reward contract.

    Following is the table of parameters.

    Parameter Name Type
    reward_contract Key
    claim_sig String
    reward_tokens Vec<String>

    This method returns nothing.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • accept_transfer_ownership

    Accept a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • decimals

    Returns the number of decimals for this token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns u8.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • reward_integral_for

    Returns the U256 for reward_token and cliaming address.

    Following is the table of parameters.

    Parameter Name Type
    reward_token Key
    claiming_address Key

    This method returns U256.

  • reward_integral

    Returns the U256 for reward_token .

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • claim_sig

    Returns the String.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • rewards_receiver

    Returns the address of receiver.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns Key.

  • reward_balances

    Returns the U256(amount) of receiver_balance.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • reward_tokens

    Returns the key of reward_tokens.

    Following is the table of parameters.

    Parameter Name Type
    index U256

    This method returns Key.

  • lp_token

    Returns the key of lp_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • balance_of

    Returns the balance of provided key.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_supply

    Returns the total_supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • allowance

    Returns the allowance of provided key.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

Deploying Gauge Controller contract manually

If you need to deploy the Gauge Controller contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • token : Erc20 Crv token contract package hash
    • voting_escrow : Voting escrow deployed contract package hash
    • contract_name : Contract name for deployment

Following is the command to deploy the Gauge Controller contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 280000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="token:key='Erc20 Crv Contract Address'" \
    --session-arg="voting_escrow:key='voting_escrow Contract Address'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the GaugeController's entry point methods.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • gauge_types

    Get gauge type for address. Returns Gauge Type id.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U128.

  • add_gauge

    Add gauge addr of type gauge_type with weight weight.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    type_id (bool,U128)
    weight Option<U256>

    This method returns nothing.

  • checkpoint

    Checkpoint to fill data common for all gauges

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • checkpoint_gauge

    Checkpoint to fill data for both a specific gauge and common for all gauges.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • gauge_relative_weight

    Returns Gauge relative weight

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    time Option<U256>

    This method returns U256.

  • gauge_relative_weight_write

    Returns gauge weight normalized to 1e9 and also fill all the unfilled values for type and gauge records.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    time Option<U256>

    This method returns U256.

  • add_type

    Add gauge type with name and weight.

    Following is the table of parameters.

    Parameter Name Type
    name String
    weight Option<U256>

    This method returns nothing.

  • change_type_weight

    Change gauge type type_id weight to weight.

    Following is the table of parameters.

    Parameter Name Type
    type_id (bool,U128)
    weight U256

    This method returns nothing.

  • change_gauge_weight

    Change weight of gauge addr to weight.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    weight U256

    This method returns nothing.

  • vote_for_gauge_weights

    Allocate voting power for changing pool weights.

    Following is the table of parameters.

    Parameter Name Type
    gauge_addr Key
    user_weight U256

    This method returns nothing.

  • get_gauge_weight

    Returns current gauge weight.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • get_type_weight

    Returns current type weight.

    Following is the table of parameters.

    Parameter Name Type
    type_id (bool,U128)

    This method returns U256.

  • get_total_weight

    Returns current total (type-weighted) weight.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • get_weights_sum_per_type

    Returns Sum of gauge weights.

    Following is the table of parameters.

    Parameter Name Type
    type_id (bool,U128)

    This method returns U256.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • token

    Returns the key of CRV token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • voting_escrow

    Returns the key of voting_escrow.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • n_gauge_types

    Returns U128.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U128.

  • n_gauges

    Returns U128.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U128.

  • gauge_type_names

    Returns String.

    Following is the table of parameters.

    Parameter Name Type
    owner U128

    This method returns String.

  • gauges

    Returns Key. Needed for enumeration.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns Key.

  • vote_user_slopes

    Returns VotedSlope by providing address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns VotedSlope.

  • vote_user_power

    Returns Total vote power used by user

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • last_user_vote

    Returns Last user vote's timestamp for each gauge address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • points_weight

    Returns Point by providing gauge address and time.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender U256

    This method returns Point.

  • time_weight

    Returns last scheduled time (next week).

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • points_sum

    Returns Point by providing gauge address and time.

    Following is the table of parameters.

    Parameter Name Type
    owner U128
    spender U256

    This method returns Point.

  • time_sum

    Returns last scheduled time (next week).

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • points_total

    Returns total weight.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • time_total

    Returns last scheduled time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • points_type_weight

    Returns type weight by providing type id and time.

    Following is the table of parameters.

    Parameter Name Type
    owner U128
    spender U256

    This method returns U256.

  • time_type_weight

    Returns last scheduled time (next week) by providing type id.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

Deploying Minter contract manually

If you need to deploy the Minter contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • token : Erc20 Crv token contract package hash
    • controller : Gauge controller deployed contract package hash
    • contract_name : Contract name for deployment

Following is the command to deploy the Minter contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 150000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="token:key='Token Address'" \
    --session-arg="controller:key='Controller Contract Address'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the Minter's entry point methods.

  • mint

    Mint everything which belongs to msg.sender and send to them.

    Following is the table of parameters.

    Parameter Name Type
    gauge_addr Key

    This method returns nothing.

  • mint_many

    Mint everything which belongs to msg.sender across multiple gauges.

    Following is the table of parameters.

    Parameter Name Type
    gauge_addr Vec<String>

    This method returns nothing.

  • mint_for

    Mint tokens for for. Only possible when msg.sender has been approved via toggle_approve_mint.

    Following is the table of parameters.

    Parameter Name Type
    gauge_addr Key
    for Key

    This method returns nothing.

  • toggle_approve_mint

    Allow minting_user to mint for msg.sender.

    Following is the table of parameters.

    Parameter Name Type
    minting_user Key

    This method returns nothing.

  • token

    Returns the key of token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • Controller

    Returns the key of Controller.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • allowed_to_mint_for

    Returns bool. This is used to check user is allowed to mint or not.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns bool.

  • minted

    Returns U256 by providing user and gauge keys.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

Deploying Curve Rewards contract manually

If you need to deploy the Curve Rewards contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • token : Erc20 token contract package hash
    • reward : Reward contract deployed contract package hash
    • contract_name : Contract name for deployment

Following is the command to deploy the Curve Rewards contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 290000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="token:key='Token(ERC20) Contract Address'" \
    --session-arg="reward:key='Reward(ERC20) Contract Address'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the CurveRewards's entry point methods.

  • last_time_reward_applicable

    Returns the min value between blocktime and period_finish.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_per_token

    Return the rewards that is earned.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • earned

    Return the earned amount of account that is provided.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

  • stake

    Stake the amount.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • withdraw

    Withdraw the amount.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • exit

    Exit and withdraw all amount.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • get_reward

    Use to get the reward that is earned by providing the reward amount.

    Following is the table of parameters.

    Parameter Name Type
    reward U256

    This method returns nothing.

  • notify_reward_amount

    Use to notify the reward amount.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • total_supply

    Returns the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • balance_of

    Returns the balance of provided address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • stake_lp

    Stake function of lp token wrapper.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • withdraw_lp

    Withdraw function lp token wrapper.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • set_reward_distribution

    Set the reward distribution key.

    Following is the table of parameters.

    Parameter Name Type
    reward_distribution Key

    This method returns nothing.

  • owner

    Returns owner key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • is_owner

    Returns the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • renounce_ownership

    Renouncing ownership will leave the contract without an owner,thereby removing any functionality that is only available to the owner.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • transfer_ownership

    Transfers ownership of the contract to a new account (newOwner).Can only be called by the current owner.

    Following is the table of parameters.

    Parameter Name Type
    new_owner Key

    This method returns nothing.

  • uni

    Return the address of uni(ERC20).

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • snx

    Return the address of snx(ERC20).

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • duration

    Return the duration.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • period_finish

    Return the period_finish value.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_rate

    Return the reward_rate value.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • last_update_time

    Return the last_update_time value.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_per_token_stored

    Return the reward_per_token_stored value.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • user_reward_per_token_paid

    Return the user_reward_per_token_paid value by providing the account.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

  • rewards

    Return the rewards value by providing the account.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

Deploying Lp Token Wrapper contract manually

If you need to deploy the Lp Token Wrapper contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • uni : ERC20 token contract package hash
    • contract_name : Contract name for deployment

Following is the command to deploy the Lp Token Wrapper contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 110000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="uni:Key='Address of ERC20 Contract Package Hash'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the LpTokenWrapper's entry point methods.

  • stake

    Stake the amount.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • withdraw

    Withdraw the amount.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • total_supply

    Returns the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • balance_of

    Returns the balance of provided address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • uni

    Return the address of uni(ERC20).

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

Deploying Ownable contract manually

If you need to deploy the Ownable contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • uni : ERC20 token contract package hash
    • contract_name : Contract name for deployment

Following is the command to deploy the Ownable contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 100000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the Ownable's entry point methods.

  • owner

    Returns owner key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • is_owner

    Returns the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • renounce_ownership

    Renouncing ownership will leave the contract without an owner,thereby removing any functionality that is only available to the owner.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • transfer_ownership

    Transfers ownership of the contract to a new account (newOwner).Can only be called by the current owner.

    Following is the table of parameters.

    Parameter Name Type
    new_owner Key

    This method returns nothing.

Deploying Liquidity Gauge Wrapper contract manually

If you need to deploy the Liquidity Gauge Wrapper contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • name : ERC20 token's name to be set
    • symbol : ERC20 token's symbol to be set
    • gauge : Gauge controller deployed contract package hash
    • admin : Admin who can kill the gauge
    • contract_name : Contract name for deployment

Following is the command to deploy the Liquidity Gauge Wrapper contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 230000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="name:String='Token full name'" \
    --session-arg="symbol:String='Token symbol'" \
    --session-arg="gauge:Key='Liquidity gauge contract address'" \
    --session-arg="admin:Key='Admin who can kill the gauge'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the LiquidityGaugeWrapper's entry point methods.

  • user_checkpoint

    Record a checkpoint for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns bool.

  • claimable_tokens

    Return the number of claimable tokens per user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • claim_tokens

    Claim mintable CR.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>

    This method returns nothing.

  • set_approve_deposit

    Set whether addr can deposit tokens for msg.sender.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    can_deposit bool

    This method returns nothing.

  • deposit

    Deposit value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256
    addr Option<Key>

    This method returns nothing.

  • withdraw

    Withdraw value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256

    This method returns nothing.

  • allowance

    Returns an U256 specifying the amount of tokens still available for the spender..

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • transfer

    Returns Result<(), u32>. Transfer token for a specified address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Returns Result<(), u32>. Transfer tokens from one address to another.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • approve

    Approve the passed address to transfer the specified amount of tokens on behalf of msg.sender.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.

  • increase_allowance

    Increase the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • decrease_allowance

    Decrease the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • kill_me

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • minter

    Return key of minter.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • crv_token

    Return key of crv_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • lp_token

    Return key of lp_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • gauge

    Return key of gauge.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • balance_of

    Return balance of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_supply

    Return the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • claimable_crv

    Returns the claimable_crv.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

  • approved_to_deposit

    Returns bool that the provided address is allowed to deposit.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns bool.

  • is_killed

    Return the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

Deploying Liquidity Gauge Reward Wrapper contract manually

If you need to deploy the Liquidity Gauge Reward Wrapper contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • name : ERC20 token's name to be set
    • symbol : ERC20 token's symbol to be set
    • gauge : Gauge controller deployed contract package hash
    • admin : Admin who can kill the gauge
    • contract_name : Contract name for deployment

Following is the command to deploy the Liquidity Gauge Reward Wrapper contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 250000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="name:String='Token full name'" \
    --session-arg="symbol:String='Token symbol'" \
    --session-arg="gauge:Key='Liquidity gauge contract address'" \
    --session-arg="admin:Key='Admin who can kill the gauge'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the LiquidityGaugeRewardWrapper's entry point methods.

  • user_checkpoint

    Record a checkpoint for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns bool.

  • claimable_tokens

    Return the number of claimable tokens per user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • claimable_reward

    Return the number of claimable reward per user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • claim_tokens

    Claim mintable CRV and reward tokens.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>

    This method returns nothing.

  • set_approve_deposit

    Set whether addr can deposit tokens for msg.sender.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    can_deposit bool

    This method returns nothing.

  • deposit

    Deposit value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256
    addr Option<Key>

    This method returns nothing.

  • withdraw

    Withdraw value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256

    This method returns nothing.

  • allowance

    Returns an U256 specifying the amount of tokens still available for the spender..

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • transfer

    Returns Result<(), u32>. Transfer token for a specified address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Returns Result<(), u32>. Transfer tokens from one address to another.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • approve

    Approve the passed address to transfer the specified amount of tokens on behalf of msg.sender.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.

  • increase_allowance

    Increase the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • decrease_allowance

    Decrease the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • kill_me

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • minter

    Return key of minter.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • crv_token

    Return key of crv_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • lp_token

    Return key of lp_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • rewarded_token

    Return key of rewarded_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • gauge

    Return key of gauge.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • balance_of

    Return balance of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_supply

    Return the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • claimable_crv

    Returns the claimable_crv.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

  • approved_to_deposit

    Returns bool that the provided address is allowed to deposit.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns bool.

  • is_killed

    Return the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • reward_integral_for

    Returns the reward integral for of provided address.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

  • reward_integral

    Returns the reward integral.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • claimable_rewards

    Returns the claimable_rewards.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns U256.

Deploying Liquidity Gauge Reward contract manually

If you need to deploy the Liquidity Gauge Reward contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • lp_addr : Liquidity pool deployed contract package hash
    • minter : Minter deployed contract package hash
    • reward_contract : Synthetix reward deployed contract package hash
    • rewarded_token : Received synthetix token contract package address
    • admin : Admin who can kill the gauge
    • contract_name : Contract name for deployment

Following is the command to deploy the Liquidity Gauge Reward contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 260000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="lp_addr:Key='Liquidity Pool contract address'" \
    --session-arg="minter:Key='Minter contract address'" \
    --session-arg="reward_contract:Key='Synthetix reward contract address'" \
    --session-arg="rewarded_token:Key='Received synthetix token contract address'" \
    --session-arg="admin:Key='Admin who can kill the gauge'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the LiquidityGaugeReward's entry point methods.

  • user_checkpoint

    Record a checkpoint for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns bool.

  • claimable_tokens

    Return the number of claimable tokens per user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • claimable_reward

    Return the number of claimable reward per user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • kick

    Kick addr for abusing their boost. Only if either they had another voting event, or their voting escrow lock expired.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • set_approve_deposit

    Set whether addr can deposit tokens for msg.sender.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    can_deposit bool

    This method returns nothing.

  • deposit

    Deposit value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256
    addr Option<Key>

    This method returns nothing.

  • withdraw

    Withdraw value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256

    This method returns nothing.

  • claim_rewards

    Claim reward tokens.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>

    This method returns nothing.

  • integrate_checkpoint

    Return U256.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • kill_me

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • toggle_external_rewards_claim

    Switch claiming rewards on/off.

    Following is the table of parameters.

    Parameter Name Type
    val bool

    This method returns nothing.

  • minter

    Return key of minter.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • crv_token

    Return key of crv_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • lp_token

    Return key of lp_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • controller

    Return key of controller.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • voting_escrow

    Return key of voting_escrow.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • balance_of

    Return balance of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_supply

    Return the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • future_epoch_time

    Return the future_epoch_time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • approved_to_deposit

    Returns bool that the provided address is allowed to deposit.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns bool.

  • working_balances

    Return working_balances of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • working_supply

    Return the working supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • period

    Return the period.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U128.

  • period_timestamp

    Return the period_timestamp.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • integrate_inv_supply

    Return the integrate_inv_supply.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • integrate_inv_supply_of

    Return the integrate_inv_supply_of.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • integrate_checkpoint_of

    Return the integrate_checkpoint_of.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • integrate_fraction

    Return the integrate_fraction.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • inflation_rate

    Return the inflation_rate.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_contract

    Return key of reward_contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • rewarded_token

    Return key of rewarded_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • reward_integral

    Returns the reward integral.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_integral_for

    Returns the reward integral for of provided address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • rewards_for

    Returns the rewards for of provided address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • claimed_rewards_for

    Returns the claimed_rewards_for of provided address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • is_killed

    Return the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • is_claiming_rewards

    Returns the bool.

    Following is the table of parameters.

    Parameter Name Type
    account Key

    This method returns bool.

Deploying Liquidity Gauge V3 contract manually

If you need to deploy the Liquidity Gauge V3 contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • lp_addr : Liquidity pool deployed contract package hash
    • minter : Minter deployed contract package hash
    • admin : Admin who can kill the gauge
    • contract_name : Contract name for deployment

Following is the command to deploy the Liquidity Gauge V3 contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 320000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="lp_addr:Key='Liquidity Pool contract address'" \
    --session-arg="minter:Key='Minter contract address'" \
    --session-arg="admin:Key='Admin who can kill the gauge'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the LiquidityGaugeV3's entry point methods.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns u8.

  • integrate_checkpoint

    Return the U256.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • user_checkpoint

    Record a checkpoint for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns bool.

  • claimable_tokens

    Return the number of claimable tokens per user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • reward_contract

    Returns ZERO_ADDRESS if there is no reward contract active. Address of the reward contract providing non-CRV incentives for this gauge.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • last_claim

    Rewards are claimed at most once per hour in order to reduce gas costs.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • claimed_reward

    Get the number of already-claimed reward tokens for a user. Returns total amount of token already claimed by addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    token Key

    This method returns U256.

  • claimable_reward

    Get the number of claimable reward tokens for a user. This call does not consider pending claimable amount in reward_contract.Off-chain callers should instead use claimable_rewards_write as a view method. Returns U256 Claimable reward token amount.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    token Key

    This method returns U256.

  • claimable_reward_write

    Get the number of claimable reward tokens for a user. Returns U256 Claimable reward token amount.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    token Key

    This method returns U256.

  • set_rewards_receiver

    Set the default reward receiver for the caller.

    Following is the table of parameters.

    Parameter Name Type
    receiver Key

    This method returns nothing.

  • claim_rewards

    Claim available reward tokens for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>
    receiver Option<Key>

    This method returns nothing.

  • kick

    Kick addr for abusing their boost. Only if either they had another voting event, or their voting escrow lock expired.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • deposit

    Deposit value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256
    addr Option<Key>
    claim_rewards Option<bool>

    This method returns nothing.

  • withdraw

    Withdraw value LP tokens.

    Following is the table of parameters.

    Parameter Name Type
    value U256
    claim_rewards Option<bool>

    This method returns nothing.

  • transfer

    Returns Result<(), u32>. Transfer token for a specified address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Returns Result<(), u32>. Transfer tokens from one address to another.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • approve

    Approve the passed address to transfer the specified amount of tokens on behalf of msg.sender

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.

  • increase_allowance

    Increase the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • decrease_allowance

    Decrease the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • set_rewards

    Set the active reward contract. A reward contract cannot be set while this contract has no deposits.

    Following is the table of parameters.

    Parameter Name Type
    reward_contract Key
    claim_sig String
    reward_tokens Vec<String>

    This method returns nothing.

  • set_killed

    Set the killed status for this contract.

    Following is the table of parameters.

    Parameter Name Type
    is_killed bool

    This method returns nothing.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • accept_transfer_ownership

    Accept a pending ownership transfer.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • minter

    Return key of minter.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • crv_token

    Return key of crv_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • lp_token

    Return key of lp_token.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • controller

    Return key of controller.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • voting_escrow

    Return key of voting_escrow.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_epoch_time

    Return the future_epoch_time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • balance_of

    Return balance of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_supply

    Return the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • allowance

    Returns the allowance of provided key.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • working_balances

    Return working_balances of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • working_supply

    Return the working supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • period

    Return the period.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U128.

  • period_timestamp

    Return the period_timestamp.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • integrate_inv_supply

    Return the integrate_inv_supply.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns U256.

  • integrate_inv_supply_of

    Return the integrate_inv_supply_of.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • integrate_checkpoint_of

    Return the integrate_checkpoint_of.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • integrate_fraction

    Return the integrate_fraction.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • inflation_rate

    Return the inflation_rate.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • reward_tokens

    Return key of reward_tokens.

    Following is the table of parameters.

    Parameter Name Type
    owner U256

    This method returns Key.

  • rewards_receiver

    Returns the reward receiver.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns Key.

  • reward_integral

    Returns the reward integral.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • reward_integral_for

    Returns the reward integral for of provided address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • is_killed

    Return the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

Deploying Curve Token V3 contract manually

If you need to deploy the Curve Token V3 contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • name : Token name to be setup
    • symbol : Token Symbol to be setup
    • contract_name : Contract name for deployment

Following is the command to deploy the Curve Token V3 contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 160000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="name:String='name of contract'" \
    --session-arg="symbol:String='symbol of contract'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the CurveTokenV3's entry point methods.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • transfer

    Returns Result<(), u32>. Transfer token for a specified address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Returns Result<(), u32>. Transfer tokens from one address to another.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • approve

    Approve the passed address to transfer the specified amount of tokens on behalf of msg.sender

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.

  • increase_allowance

    Increase the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • decrease_allowance

    Decrease the allowance granted to spender by the caller.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(),u32>.

  • mint

    Mint an amount of the token and assigns it to an account. This encapsulates the modification of balances such that the proper events are emitted.

    Following is the table of parameters.

    Parameter Name Type
    to Key
    amount U256

    This method returns bool.

  • burn_from

    Burn an amount of the token from a given account.

    Following is the table of parameters.

    Parameter Name Type
    from Key
    amount U256

    This method returns bool.

  • set_minter

    Set the minter.

    Following is the table of parameters.

    Parameter Name Type
    minter Key

    This method returns nothing.

  • set_name

    Set the name of contract.

    Following is the table of parameters.

    Parameter Name Type
    name String
    symbol String

    This method returns nothing.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • total_supply

    Return the total supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • minter

    Return the key of minter.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • balance_of

    Return balance of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • allowance

    Returns the allowance of provided key.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

Deploying ERC20 CRV contract manually

If you need to deploy the ERC20 CRV contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • name : Token name to be setup
    • symbol : Token Symbol to be setup
    • contract_name : Contract name for deployment

Following is the command to deploy the ERC20 CRV contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 200000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="name:String='name of contract'" \
    --session-arg="symbol:String='symbol of contract'" \
    --session-arg="decimals:u8='Number of decimals for token'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the ERC20CRV's entry point methods.

  • update_mining_parameters

    Update mining rate and supply at the start of the epoch.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • start_epoch_time_write

    Get timestamp of the current mining epoch start while simultaneously updating mining parameters. Returns Timestamp of the epoch.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • future_epoch_time_write

    Get timestamp of the next mining epoch start while simultaneously updating mining parameters. Returns Timestamp of the next epoch.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • available_supply

    Current number of tokens in existence (claimed or unclaimed).

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • mintable_in_timeframe

    How much supply is mintable from start timestamp till end timestamp. Returns Tokens mintable from start till end.

    Following is the table of parameters.

    Parameter Name Type
    start U256
    end U256

    This method returns U256.

  • set_minter

    Set the minter.

    Following is the table of parameters.

    Parameter Name Type
    minter Key

    This method returns nothing.

  • set_admin

    Set the new admin.

    Following is the table of parameters.

    Parameter Name Type
    admin Key

    This method returns nothing.

  • total_supply

    Total number of tokens in existence.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • allowance

    Check the amount of tokens that an owner allowed to a spender.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • transfer

    Returns Result<(), u32>. Transfer token for a specified address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Returns Result<(), u32>. Transfer tokens from one address to another.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • approve

    Approve the passed address to transfer the specified amount of tokens on behalf of msg.sender

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.

  • mint

    Mint value tokens and assign them to to

    Following is the table of parameters.

    Parameter Name Type
    to Key
    value U256

    This method returns bool.

  • burn

    Burn an amount of the token from a given account.

    Following is the table of parameters.

    Parameter Name Type
    value U256

    This method returns nothing.

  • set_name

    Change the token name and symbol to name and symbol.

    Following is the table of parameters.

    Parameter Name Type
    name String
    symbol String

    This method returns nothing.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • balance_of

    Return balance of given address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • minter

    Return the key of minter.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin

    Return the key of admin.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • mining_epoch

    Return the mining epoch.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U128.

  • start_epoch_time

    Return the start_epoch_time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • rate

    Return the rate.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • increase_allowance

    Increase the amount of tokens that an owner allowed to a spender.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(), u32>.

  • decrease_allowance

    Decrease the amount of tokens that an owner allowed to a spender..

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(), u32>.

Deploying ERC20 contract manually

If you need to deploy the ERC20 contract manually you need to pass the following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • name : Token name to be setup
    • symbol : Token Symbol to be setup
    • decimals : Decimals unit value for the token
    • initial_supply : Starting supply for the token
    • contract_name : Contract name for deployment

Following is the command to deploy the ERC20 contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 160000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="name:string='token-name'" \
    --session-arg="symbol:string='token-symbol'" \
    --session-arg="decimals:u8='unsigned integer value'" \
    --session-arg="initial_supply:U256='unsigned integer value'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the ERC20's entry point methods.

  • transfer

    Lets self.get_caller() send pool tokens to a recipient hash.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key
    amount U256

    This method returns Result<(), u32>.

  • transfer_from

    Sends pool tokens from one hash to another.
    User needs to call approve method before calling the tranfer_from.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    recipient Key
    amount U256

    This method returns Result<(), u32>.


    Recommendation: The exploit is mitigated through use of functions that increase/decrease the allowance relative to its current value, such as increaseAllowance() and decreaseAllowance(), Pending community agreement on an ERC standard that would protect against this exploit, we recommend that developers of applications dependent on approve() / transferFrom() should keep in mind that they have to set allowance to 0 first and verify if it was used before setting the new value.
    Note: Teams who decide to wait for such a standard should make these recommendations to app developers who work with their token contract.

  • approve

    Lets self.get_caller() set their allowance for a spender.
    user needs to call this approve method before calling the transfer_from method.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns nothing.


    Recommendation: The exploit is mitigated through use of functions that increase/decrease the allowance relative to its current value, such as increaseAllowance() and decreaseAllowance(), Pending community agreement on an ERC standard that would protect against this exploit, we recommend that developers of applications dependent on approve() / transferFrom() should keep in mind that they have to set allowance to 0 first and verify if it was used before setting the new value.
    Note: Teams who decide to wait for such a standard should make these recommendations to app developers who work with their token contract.

  • balance_of

    This method will return the balance of owner in ERC20 Contract.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • nonce

    Returns the current nonce for an address.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • allowance

    Returns the amount of liquidity tokens owned by an hash that a spender is allowed to transfer via transfer_from.

    Following is the table of parameters.

    Parameter Name Type
    owner Key
    spender Key

    This method returns U256.

  • total_supply

    Returns the total amount of pool tokens for a pair.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • mint

    This method mints the number of tokens provided by user against the hash provided by user.

    Following is the table of parameters.

    Parameter Name Type
    to Key
    amount U256

    This method returns nothing.

  • burn

    This method burns the number of tokens provided by user against the hash provided by user.

    Following is the table of parameters.

    Parameter Name Type
    from Key
    amount U256

    This method returns nothing.


    Note: To burn the tokens against the hash provided by user, User needs to mint tokens first in ERC20.

  • name

    Returns the name of tokens for a pair.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol of tokens for a pair.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns u8.

  • increase_allowance

    Increase the amount of tokens that an owner allowed to a spender.

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(), u32>.

  • decrease_allowance

    Decrease the amount of tokens that an owner allowed to a spender..

    Following is the table of parameters.

    Parameter Name Type
    spender Key
    amount U256

    This method returns Result<(), u32>.

  • package_hash

    Return the package hash of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns ContractPackageHash.

Deploying Fee Distributor contract manually

If you need to deploy the Fee Distributor contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • voting_escrow : Voting escrow deployed contract package hash
    • start_time : Epoch time for fee distribution to start
    • token : Fee token deployed contract package hash (3CRV)
    • admin : Admin account hash
    • emergency_return : Specify address to transfer _token balance to if this contract if killed
    • contract_name : Contract name for deployment

Following is the command to deploy the Fee Distributor contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 220000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="voting_escrow:Key='VotingEscrow contract address'" \
    --session-arg="start_time:U256='Epoch time for fee distribution to start'" \
    --session-arg="token:Key='Fee token address (3CRV)'" \
    --session-arg="admin:Key='Admin address'" \
    --session-arg="emergency_return:Key='Address to transfer `_token` balance to if this contract is killed'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the FeeDistributor's entry point methods.

  • checkpoint_token

    Update the token checkpoint. Calculates the total number of tokens to be distributed in a given week. During setup for the initial distribution this function is only callable by the contract owner. Beyond initial distro, it can be enabled for anyone to call.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • ve_for_at

    Get the veCRV balance for user at timestamp. Return veCRV balance.

    Following is the table of parameters.

    Parameter Name Type
    user U256
    timestamp U256

    This method returns U256.

  • checkpoint_total_supply

    Update the veCRV total supply checkpoint. The checkpoint is also updated by the first claimant each new epoch week. This function may be called independently of a claim, to reduce claiming gas costs.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • claim

    Claim fees for addr. Each call to claim look at a maximum of 50 user veCRV points. For accounts with many veCRV related actions, this function may need to be called more than once to claim all available fees. In the Claimed event that fires, if claim_epoch is less than max_epoch, the account may claim again.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • claim_many

    Make multiple fee claims in a single call. Used to claim for many accounts at once, or to make multiple claims for the same address when that address has significant veCRV history.

    Following is the table of parameters.

    Parameter Name Type
    receivers Vec<Key>

    This method returns bool.

  • burn

    Receive CRV into the contract and trigger a token checkpoint.

    Following is the table of parameters.

    Parameter Name Type
    coin Key

    This method returns bool.

  • commit_admin

    Commit transfer of ownership.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_admin

    Apply transfer of ownership.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • toggle_allow_checkpoint_token

    Toggle permission for checkpointing by any account.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • kill_me

    Kill the contract. Killing transfers the entire 3CRV balance to the emergency return address and blocks the ability to claim or burn. The contract cannot be unkilled.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • recover_balance

    Recover ERC20 tokens from this contract. Tokens are sent to the emergency return address. Return bool success.

    Following is the table of parameters.

    Parameter Name Type
    coin Key

    This method returns bool.

  • start_time

    Return Start time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • time_cursor

    Return time cursor.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • time_cursor_of

    Return time cursor of.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • user_epoch_of

    Return user_epoch_of.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • last_token_time

    Return last_token_time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • tokens_per_week

    Return tokens_per_week.

    Following is the table of parameters.

    Parameter Name Type
    week U256

    This method returns U256.

  • voting_escrow

    Return voting_escrow key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • token

    Return token key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • total_received

    Return total_received.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • token_last_balance

    Return token_last_balance.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • ve_supply

    Return ve_supply.

    Following is the table of parameters.

    Parameter Name Type
    week U256

    This method returns U256.

  • admin

    Return admin key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_admin

    Return future_admin key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • can_checkpoint_token

    Return can_checkpoint_token bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • emergency_return

    Return emergency_return key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • is_killed

    Return is_killed bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

Deploying Gauge Proxy contract manually

If you need to deploy the Gauge Proxy contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • ownership_admin : Address specified for the contract ownership admin
    • emergency_admin : Address of emergency admin in case of any issue with the ownership admin
    • contract_name : Contract name for deployment

Following is the command to deploy the Gauge Proxy contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 130000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="ownership_admin:Key='ownership_admin address'" \
    --session-arg="emergency_admin:Key='emergency_admin address'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the GaugeProxy's entry point methods.

  • commit_set_admins

    Set ownership admin to o_admin and emergency admin to e_admin.

    Following is the table of parameters.

    Parameter Name Type
    o_admin Key
    e_admin Key

    This method returns nothing.

  • accept_set_admins

    Apply the effects of commit_set_admins. Only callable by the new owner admin.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • commit_transfer_ownership

    Transfer ownership for liquidity gauge gauge to new_owner.

    Following is the table of parameters.

    Parameter Name Type
    gauge Key
    new_owner Key

    This method returns nothing.

  • accept_transfer_ownership

    Apply transferring ownership of gauge.

Following is the table of parameters.

Parameter Name Type
gauge Key

This method returns nothing.

  • set_killed

    Set the killed status for gauge. When killed, the gauge always yields a rate of 0 and so cannot mint CRV.

    Following is the table of parameters.

    Parameter Name Type
    gauge Key
    is_killed bool

    This method returns nothing.

  • set_rewards

    Set the active reward contract for _gauge.

    Following is the table of parameters.

    Parameter Name Type
    gauge Key
    reward_contract Key
    sigs String
    reward_tokens Vec<Key>

    This method returns nothing.

  • ownership_admin

    Return ownership_admin.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • emergency_admin

    Return emergency_admin.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_ownership_admin

    Return future_ownership_admin.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_emergency_admin

    Return future_emergency_admin.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

Deploying I Reward Distribution Recipient contract manually

If you need to deploy the I Reward Distribution Recipient contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • contract_name : Contract name for deployment

Following is the command to deploy the I Reward Distribution Recipient contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 110000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the IRewardDistributionRecipient's entry point methods.

  • set_reward_distribution

    Set reward Distribution.

    Following is the table of parameters.

    Parameter Name Type
    reward_distribution Key

    This method returns nothing.

  • owner

    Returns owner key.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • is_owner

    Returns the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • renounce_ownership

    Renouncing ownership will leave the contract without an owner,thereby removing any functionality that is only available to the owner.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • transfer_ownership

    Transfers ownership of the contract to a new account (newOwner).Can only be called by the current owner.

    Following is the table of parameters.

    Parameter Name Type
    new_owner Key

    This method returns nothing.

Deploying Vesting Escrow contract manually

If you need to deploy the Vesting Escrow contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • token : Contract package hash of the ERC20 token being distributed
    • start_time : Timestamp at which the distribution of token starts
    • end_time : Timestamp until tokens should be vested
    • can_disable : Option for admin to disable accounts in this deployment
    • fund_admins : Temporary admin accounts used only for funding
    • contract_name : Contract name for deployment

Following is the command to deploy the Vesting Escrow contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 380000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="token:Key='Address of the ERC20 token being distributed'" \
    --session-arg="start_time:U256='Timestamp at which the distribution starts'" \
    --session-arg="end_time:U256='Time until everything should be vested'" \
    --session-arg="can_disable:bool='Whether admin can disable accounts in this deployment'" \
    --session-arg="fund_admins:Vec<String>='Temporary admin accounts used only for funding'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the VestingEscrow's entry point methods.

  • add_tokens

    Transfer vestable tokens into the contract. Handled separate from fund to reduce transaction count when using funding admins.

    Following is the table of parameters.

    Parameter Name Type
    amount U256

    This method returns nothing.

  • fund

    Vest tokens for multiple recipients.

    Following is the table of parameters.

    Parameter Name Type
    recipients Vec<String>
    amounts Vec<U256>

    This method returns nothing.

  • toggle_disable

    Disable or re-enable a vested address's ability to claim tokens. When disabled, the address is only unable to claim tokens which are still locked at the time of this call. It is not possible to block the claim of tokens which have already vested.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns nothing.

  • disable_can_disable

    Disable the ability to call toggle_disable.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • disable_fund_admins

    Disable the funding admin accounts.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • vested_supply

    Get the total number of tokens which have vested, that are held by this contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • lock_supply

    Get the total number of tokens which are still locked (have not yet vested).

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • vested_of

    Get the number of tokens which have vested for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • balance_of

    Get the number of unclaimed, vested tokens for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • locked_of

    Get the number of locked tokens for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • claim

    Claim tokens which have vested.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>

    This method returns U256.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • token

    Return the token address.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • start_time

    Return the start time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • end_time

    Return the end time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • initial_locked

    Return the initial locked.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_claimed

    Return the total claimed.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • initial_locked_supply

    Return the initial_locked_supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • unallocated_supply

    Return the unallocated_supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • can_disable

    Return the can_disable.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • disabled_at

    Return the disabled_at.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • fund_admins_enabled

    Returns the bool.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • fund_admins

    Returns the bool.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns bool.

Deploying Vesting Escrow Simple contract manually

If you need to deploy the Vesting Escrow Simple contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • contract_name : Contract name for deployment

Following is the command to deploy the Vesting Escrow Simple contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 160000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the VestingEscrowSimple's entry point methods.

  • initialize

    Initialize the contract. This function is seperate from __init__ because of the factory pattern used in VestingEscrowFactory.deploy_vesting_contract. It may be called once per deployment.

    Following is the table of parameters.

    Parameter Name Type
    admin Key
    token Key
    recipient Key
    amount U256
    start_time U256
    end_time U256
    can_disable bool

    This method returns bool.

  • toggle_disable

    Disable or re-enable a vested address's ability to claim tokens. When disabled, the address is only unable to claim tokens which are still locked at the time of this call. It is not possible to block the claim of tokens which have already vested.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns nothing.

  • disable_can_disable

    Disable the ability to call toggle_disable.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • vested_supply

    Get the total number of tokens which have vested, that are held by this contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • lock_supply

    Get the total number of tokens which are still locked (have not yet vested).

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • vested_of

    Get the number of tokens which have vested for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • balance_of

    Get the number of locked tokens for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • locked_of

    Get the number of locked tokens for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • claim

    Claim tokens which have vested.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>

    This method returns U256.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • token

    Return the token address.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • start_time

    Return the start time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • end_time

    Return the end time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • initial_locked

    Return the initial locked.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_claimed

    Return the total claimed.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • initial_locked_supply

    Return the initial_locked_supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • can_disable

    Return the can_disable.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • disabled_at

    Return the disabled_at.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

Deploying Vesting Escrow Factory contract manually

If you need to deploy the Vesting Escrow Factory contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • target : Vesting escrow simple deployed contract package hash
    • admin : Admin account hash for vesting escrow factory
    • contract_name : Contract name for deployment

Following is the command to deploy the Vesting Escrow Factory contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 230000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="target:Key='`VestingEscrowSimple` contract address'" \
    --session-arg="admin:Key='admin address'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the VestingEscrowFactory's entry point methods.

  • deploy_vesting_contract

    Deploy a new vesting contract. Each contract holds tokens which vest for a single account. Tokens must be sent to this contract via the regular ERC20.transfer method prior to calling this method.

    Following is the table of parameters.

    Parameter Name Type
    token Key
    recipient Key
    amount U256
    can_disable bool
    vesting_duration U256
    vesting_start Option<U256>

    This method returns Key.

  • commit_transfer_ownership_vef

    Transfer ownership of GaugeController to addr

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership_vef

    Apply a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • future_admin_vef

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin_vef

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • target

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • initialize

    Initialize the contract. This function is seperate from __init__ because of the factory pattern used in VestingEscrowFactory.deploy_vesting_contract. It may be called once per deployment.

    Following is the table of parameters.

    Parameter Name Type
    admin Key
    token Key
    recipient Key
    amount U256
    start_time U256
    end_time U256
    can_disable bool

    This method returns bool.

  • toggle_disable

    Disable or re-enable a vested address's ability to claim tokens. When disabled, the address is only unable to claim tokens which are still locked at the time of this call. It is not possible to block the claim of tokens which have already vested.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns nothing.

  • disable_can_disable

    Disable the ability to call toggle_disable.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • vested_supply

    Get the total number of tokens which have vested, that are held by this contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • lock_supply

    Get the total number of tokens which are still locked (have not yet vested).

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • vested_of

    Get the number of tokens which have vested for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • balance_of

    Get the number of locked tokens for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • locked_of

    Get the number of locked tokens for a given address.

    Following is the table of parameters.

    Parameter Name Type
    recipient Key

    This method returns U256.

  • claim

    Claim tokens which have vested.

    Following is the table of parameters.

    Parameter Name Type
    addr Option<Key>

    This method returns U256.

  • commit_transfer_ownership

    Transfer ownership of GaugeController to addr

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • token

    Return the token address.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • start_time

    Return the start time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • end_time

    Return the end time.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • initial_locked

    Return the initial locked.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • total_claimed

    Return the total claimed.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • initial_locked_supply

    Return the initial_locked_supply.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • can_disable

    Return the can_disable.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • disabled_at

    Return the disabled_at.

    Following is the table of parameters.

    Parameter Name Type
    owner Key

    This method returns U256.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

Deploying Voting Escrow contract manually

If you need to deploy the Voting Escrow contract manually you need to pass following parameters

  • chain-name : Name of casper chain to perform deployment on
  • node-address : Address of chain node to perform transactions
  • secret-key : Path to the account's secret key file (.pem)
  • session-path : Path to Curve-Dao wasm file (.wasm)
  • payment-amount : Gas amount in motes (unit) to perform wasm deployment
  • session-arg : Parameters for the contract initializer
    • public_key : Deployer account's public key in hex
    • token : Contract package hash of the ERC20 token being distributed
    • name : Token name of contract to deploy
    • symbol : Token symbol of contract to deploy
    • version : Version handling of the contract
    • contract_name : Contract name for deployment

Following is the command to deploy the Voting Escrow contract.

sudo casper-client put-deploy \
    --chain-name chain_name \
    --node-address http://$NODE_ADDRESS:7777/ \
    --secret-key path_to_secret_key.pem \
    --session-path path_to_wasm_file \
    --payment-amount 250000000000 \
    --session-arg="public_key:public_key='Public Key In Hex'" \
    --session-arg="token_addr:Key='ERC20CRV token address'" \
    --session-arg="name:String='Token name'" \
    --session-arg="symbol:String='Token symbol'" \
    --session-arg="version:String='Contract version'" \
    --session-arg="contract_name:string='contract_name'"

Entry Point methods

Following are the VotingEscrow's entry point methods.

  • commit_transfer_ownership

    Transfer ownership of VotingEscrow contract to addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns nothing.

  • apply_transfer_ownership

    Apply a pending ownership transfer

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • get_last_user_slope

    Get the most recently recorded rate of voting power decrease for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns Tuple i128.

  • user_point_history_ts

    Get the timestamp for checkpoint idx for addr.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    idx U256

    This method returns U256.

  • locked_end

    Get timestamp when addr's lock finishes. Return Epoch time of the lock end.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns U256.

  • checkpoint

    Record global data to checkpoint.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • deposit_for

    Deposit value tokens for addr and add to the lock. Anyone (even a smart contract) can deposit for someone else, but cannot extend their locktime and deposit for a brand new user.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    value U256

    This method returns nothing.

  • create_lock

    Deposit value tokens for msg.sender and lock until unlock_time.

    Following is the table of parameters.

    Parameter Name Type
    value U256
    unlock_time U256

    This method returns nothing.

  • increase_amount

    Deposit value additional tokens for msg.sender without modifying the unlock time.

    Following is the table of parameters.

    Parameter Name Type
    value U256

    This method returns nothing.

  • increase_unlock_time

    Extend the unlock time for msg.sender to unlock_time.

    Following is the table of parameters.

    Parameter Name Type
    unlock_time U256

    This method returns nothing.

  • withdraw

    Withdraw all tokens for msg.sender.

    Following is the table of parameters.

    Parameter Name Type

    This method returns nothing.

  • balance_of

    Get the current voting power for msg.sender. Adheres to the ERC20 balanceOf interface for Aragon compatibility.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    t Option<U256>

    This method returns U256.

  • balance_of_at

    Measure voting power of addr at block height block.

    Following is the table of parameters.

    Parameter Name Type
    addr Key
    time U256

    This method returns U256.

  • total_supply

    Calculate total voting power. Adheres to the ERC20 totalSupply interface for Aragon compatibility.

    Following is the table of parameters.

    Parameter Name Type
    t Option<U256>

    This method returns U256.

  • total_supply_at

    Calculate total voting power at some point in the past. Returns Total voting power at block.

    Following is the table of parameters.

    Parameter Name Type
    block U256

    This method returns U256.

  • change_controller

    Change the controller. Dummy method required for Aragon compatibility.

    Following is the table of parameters.

    Parameter Name Type
    new_controller Key

    This method returns nothing.

  • future_admin

    Returns the future admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • admin

    Returns the admin of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • token

    Returns the token of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • supply

    Returns the supply of contract.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • locked

    Returns the locked balance of contract.

    Following is the table of parameters.

    Parameter Name Type
    addr Key

    This method returns LockedBalance.

  • epoch

    Returns the epoch.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

  • point_history

    Returns the point history.

    Following is the table of parameters.

    Parameter Name Type
    epoch U256

    This method returns Point.

  • user_point_history

    Returns the user_point_history.

    Following is the table of parameters.

    Parameter Name Type
    user Key
    user_epoch U256

    This method returns Point.

  • user_point_epoch

    Returns the user_point_epoch.

    Following is the table of parameters.

    Parameter Name Type
    user Key

    This method returns U256.

  • slope_changes

    Returns the slope_changes.

    Following is the table of parameters.

    Parameter Name Type
    time U256

    This method returns Tuple(bool,U128).

  • controller

    Returns the address of controller.

    Following is the table of parameters.

    Parameter Name Type

    This method returns Key.

  • transfers_enabled

    Returns the transfers_enabled.

    Following is the table of parameters.

    Parameter Name Type

    This method returns bool.

  • name

    Returns the name.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • symbol

    Returns the symbol.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • version

    Returns the version.

    Following is the table of parameters.

    Parameter Name Type

    This method returns String.

  • decimals

    Returns the decimals.

    Following is the table of parameters.

    Parameter Name Type

    This method returns U256.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published