Implementation of following contracts for the CasperLabs platform.
Curve Rewards
Minter
Curve Token v3
ERC20 CRV
Fee Distributor
Gauge Controller
Gauge Proxy
Liquidity Gauge Reward
Liquidity Gauge Reward Wrapper
Liquidity Gauge Wrapper
Lp Token Wrapper
Reward Only Gauge
Vesting Escrow
Vesting Escrow Factory
Vesting Escrow Simple
Voting Escrow
Liquidity Gauge V3
Ownable
I Reward Distribution Recipient
https://docs.google.com/spreadsheets/d/1Rzh1LERQyGiGpHB3djlT1Tk0LNQ18q_eLBWFDPm2bNc/edit#gid=4667616
https://curve.readthedocs.io/dao-gauges.html#liquiditygaugev3
- Interacting with the contract
- Install the prerequisites
- Creating Keys
- Usage
- Known contract hashes
- Deploying Reward Only Gauge contract manually
- Entry Point methods
- decimals
- reward_contract
- last_claim
- claimable_reward
- claimable_reward_write
- set_rewards_receiver
- claim_rewards
- deposit
- withdraw
- transfer
- transfer_from
- approve
- increase_allowance
- decrease_allowance
- set_rewards
- commit_transfer_ownership
- accept_transfer_ownership
- decimals
- future_admin
- admin
- reward_integral_for
- reward_integral
- claim_sig
- rewards_receiver
- reward_balances
- reward_tokens
- lp_token
- balance_of
- total_supply
- allowance
- name
- symbol
- Entry Point methods
- Deploying Gauge Controller contract manually
- Entry Point methods
- commit_transfer_ownership
- apply_transfer_ownership
- gauge_types
- add_gauge
- checkpoint
- checkpoint_gauge
- gauge_relative_weight
- gauge_relative_weight_write
- add_type
- change_type_weight
- change_gauge_weight
- vote_for_gauge_weights
- get_gauge_weight
- get_type_weight
- get_total_weight
- get_weights_sum_per_type
- future_admin
- admin
- token
- voting_escrow
- n_gauge_types
- n_gauges
- gauge_type_names
- gauges
- vote_user_slopes
- vote_user_power
- last_user_vote
- points_weight
- time-weight
- points_sum
- time_sum
- points_total
- time_total
- points_type_weight
- time_type_weight
- Entry Point methods
- Deploying Minter contract manually
- Deploying Curve Rewards contract manually
- Entry Point methods
- last_time_reward_applicable
- reward_per_token
- earned
- stake
- withdraw
- exit
- get_reward
- notify_reward_amount
- total_supply
- balance_of
- stake_lp
- withdraw_lp
- set_reward_distribution
- owner
- is_owner
- renounce_ownership
- transfer_ownership
- uni
- snx
- duration
- period_finish
- reward_rate
- last_update_time
- reward_per_token_stored
- user_reward_per_token_paid
- rewards
- Entry Point methods
- Deploying Lp Token Wrapper contract manually
- Deploying Ownable contract manually
- Deploying Liquidity Gauge Wrapper contract manually
- Entry Point methods
- user_checkpoint
- claimable_tokens
- claim_tokens
- set_approve_deposit
- deposit
- withdraw
- allowance
- transfer
- transfer_from
- approve
- increase_allowance
- decrease_allowance
- kill_me
- commit_transfer_ownership
- apply_transfer_ownership
- minter
- crv_token
- lp_token
- gauge
- balance_of
- total_supply
- name
- symbol
- decimals
- future_admin
- admin
- claimable_crv
- approved_to_deposit
- is_killed
- Entry Point methods
- Deploying Liquidity Gauge Reward Wrapper contract manually
- Entry Point methods
- user_checkpoint
- claimable_tokens
- claimable_reward
- claim_tokens
- set_approve_deposit
- deposit
- withdraw
- allowance
- transfer
- transfer_from
- approve
- increase_allowance
- decrease_allowance
- kill_me
- commit_transfer_ownership
- apply_transfer_ownership
- minter
- crv_token
- lp_token
- rewarded_token
- gauge
- balance_of
- total_supply
- name
- symbol
- decimals
- future_admin
- admin
- claimable_crv
- approved_to_deposit
- is_killed
- reward_integral_for
- reward_integral
- claimable_rewards
- Entry Point methods
- Deploying Liquidity Gauge Reward contract manually
- Entry Point methods
- user_checkpoint
- claimable_tokens
- claimable_reward
- kick
- set_approve_deposit
- deposit
- withdraw
- claim_rewards
- integrate_checkpoint
- kill_me
- commit_transfer_ownership
- apply_transfer_ownership
- toggle_external_rewards_claim
- minter
- crv_token
- lp_token
- controller
- voting_escrow
- balance_of
- total_supply
- future_epoch_time
- approved_to_deposit
- working_balances
- working_supply
- period
- period_timestamp
- integrate_inv_supply
- integrate_inv_supply_of
- integrate_checkpoint_of
- integrate_fraction
- inflation_rate
- reward_contract
- rewarded_token
- reward_integral
- reward_integral_for
- rewards_for
- claimed_rewards_for
- admin
- future_admin
- is_killed
- is_claiming_rewards
- Entry Point methods
- Deploying Liquidity Gauge V3 contract manually
- Entry Point methods
- decimals
- integrate_checkpoint
- user_checkpoint
- claimable_tokens
- reward_contract
- last_claim
- claimed_reward
- claimable_reward
- claimable_reward_write
- set_rewards_receiver
- claim_rewards
- kick
- deposit
- withdraw
- transfer
- transfer_from
- approve
- increase_allowance
- decrease_allowance
- set_rewards
- set_killed
- commit_transfer_ownership
- accept_transfer_ownership
- minter
- crv_token
- lp_token
- controller
- voting_escrow
- future_epoch_time
- balance_of
- total_supply
- allowance
- name
- symbol
- working_balances
- working_supply
- period
- period_timestamp
- integrate_inv_supply
- integrate_inv_supply_of
- integrate_checkpoint_of
- integrate_fraction
- inflation_rate
- reward_tokens
- rewards_receiver
- reward_integral
- reward_integral_for
- admin
- future_admin
- is_killed
- Entry Point methods
- Deploying Curve Token V3 contract manually
- Deploying ERC20 CRV contract manually
- Entry Point methods
- start_epoch_time_write
- future-epoch-time-write
- available_supply
- update_mining_parameters
- mintable_in_timeframe
- set_minter
- set_admin
- total_supply
- allowance
- transfer
- transfer_from
- approve
- mint
- burn
- set_name
- name
- symbol
- decimals
- balance_of
- minter
- admin
- mining_epoch
- rate
- increase_allowance
- decrease_allowance
- Entry Point methods
- Deploying ERC20 contract manually
- Deploying Fee Distributor contract manually
- Entry Point methods
- checkpoint_token
- ve_for_at
- checkpoint-total-supply
- claim
- claim_many
- burn
- commit_admin
- apply_admin
- toggle_allow_checkpoint_token
- kill_me
- recover_balance
- start_time
- time_cursor
- time_cursor_of
- user_epoch_of
- last_token_time
- tokens_per_week
- voting_escrow
- token
- total_received
- token_last_balance
- ve_supply
- admin
- future_admin
- can_checkpoint_token
- emergency_return
- is_killed
- Entry Point methods
- Deploying Gauge Proxy contract manually
- Deploying I Reward Distribution Recipient contract manually
- Deploying Vesting Escrow contract manually
- Entry Point methods
- add_tokens
- fund
- toggle_disable
- disable_can_disable
- disable_fund_admins
- vested_supply
- lock_supply
- vested_of
- balance_of
- locked_of
- claim
- commit_transfer_ownership
- apply_transfer_ownership
- token
- start_time
- end_time
- initial_locked
- total_claimed
- initial_locked_supply
- unallocated_supply
- can_disable
- disabled_at
- admin
- future_admin
- fund_admins_enabled
- fund_admins
- Entry Point methods
- Deploying Vesting Escrow Simple contract manually
- Deploying Vesting Escrow Factory contract manually
- Entry Point methods
- deploy_vesting_contract
- commit_transfer_ownership_vef
- apply_transfer_ownership_vef
- future_admin_vef
- admin_vef
- target
- initialize
- toggle_disable
- disable_can_disable
- vested_supply
- lock_supply
- vested_of
- balance_of
- locked_of
- claim
- commit_transfer_ownership
- apply_transfer_ownership
- token
- start_time
- end_time
- initial_locked
- total_claimed
- initial_locked_supply
- can_disable
- disabled_at
- admin
- future_admin
- Entry Point methods
- Deploying Voting Escrow contract manually
- Entry Point methods
- commit_transfer_ownership
- apply_transfer_ownership
- get_last_user_slope
- user_point_history_ts
- locked_end
- checkpoint
- deposit_for
- create_lock
- increase_amount
- increase_unlock_time
- withdraw
- balance_of
- balance_of_at
- total_supply
- total_supply_at
- change_controller
- future_admin
- admin
- token
- supply
- locked
- epoch
- point_history
- user_point_history
- user_point_epoch
- slope_changes
- controller
- transfers_enabled
- name
- symbol
- version
- decimals
- Entry Point methods
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.
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.
sudo apt update
sudo apt install jq -y
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
rustup toolchain list
rustup default nightly-2022-04-04-x86_64-unknown-linux-gnu
rustup target add wasm32-unknown-unknown
rustup --version
sudo apt-get -y install cmake
Note:https://cgold.readthedocs.io/en/latest/first-step/installation.html
cmake --version
cargo +nightly-2022-11-17-x86_64-unknown-linux-gnu install cargo-casper
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
cargo +nightly-2022-11-17-x86_64-unknown-linux-gnu install casper-client
casper-client --version
casper-client --help
casper-client <command> --help
casper-client keygen script/keys
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
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'
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'
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.
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
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
make test-liquidity-gauge-v3
Run this command to build & test all smart contract.
make all
Run this command to build & test all smart contract.
make check-lint
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'"
Following are the RewardOnlyGauge's entry point methods.
-
Returns U256 decimal places.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns zero address if no reward is active.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
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
. -
Returns U256 Total amount of
token
already claimed byaddr
.Following is the table of parameters.
Parameter Name Type addr Key token Key This method returns
U256
. -
Returns U256 Claimable reward token amount.
Following is the table of parameters.
Parameter Name Type addr Key token Key This method returns
U256
. -
Returns U256 Claimable reward token amount.
Following is the table of parameters.
Parameter Name Type addr Key token Key This method returns
U256
. -
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 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
value
LP tokensFollowing is the table of parameters.
Parameter Name Type value U256 addr Option <Key>
claim_rewards Option <bool>
This method returns nothing.
-
Withdraw
value
LP tokensFollowing is the table of parameters.
Parameter Name Type value U256 claim_rewards Option <bool>
This method returns nothing.
-
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>
. -
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>
. -
Returns Result<(),u32> on success.
Following is the table of parameters.
Parameter Name Type spender Key amount U256 This method returns nothing.
-
Returns Result<(),u32> on success.
Following is the table of parameters.
Parameter Name Type spender Key amount U256 This method returns
Result<(),u32>
. -
Returns Result<(),u32> on success.
Following is the table of parameters.
Parameter Name Type spender Key amount U256 This method returns
Result<(),u32>
. -
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.
-
Transfer ownership of GaugeController to
addr
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Accept a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Returns the number of decimals for this token.
Following is the table of parameters.
Parameter Name Type This method returns
u8
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
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
. -
Returns the U256 for reward_token .
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the String.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the address of receiver.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
Key
. -
Returns the U256(amount) of receiver_balance.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the key of reward_tokens.
Following is the table of parameters.
Parameter Name Type index U256 This method returns
Key
. -
Returns the key of lp_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the balance of provided key.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the total_supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the allowance of provided key.
Following is the table of parameters.
Parameter Name Type owner Key spender Key This method returns
U256
. -
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
.
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'"
Following are the GaugeController's entry point methods.
-
Transfer ownership of GaugeController to
addr
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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
addr
of typegauge_type
with weightweight
.Following is the table of parameters.
Parameter Name Type addr Key type_id (bool,U128) weight Option <U256>
This method returns nothing.
-
Checkpoint to fill data common for all gauges
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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.
-
Returns Gauge relative weight
Following is the table of parameters.
Parameter Name Type addr Key time Option <U256>
This method returns
U256
. -
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 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 gauge type
type_id
weight toweight
.Following is the table of parameters.
Parameter Name Type type_id (bool,U128) weight U256 This method returns nothing.
-
Change weight of gauge
addr
toweight
.Following is the table of parameters.
Parameter Name Type addr Key weight U256 This method returns nothing.
-
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.
-
Returns current gauge weight.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Returns current type weight.
Following is the table of parameters.
Parameter Name Type type_id (bool,U128) This method returns
U256
. -
Returns current total (type-weighted) weight.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns Sum of gauge weights.
Following is the table of parameters.
Parameter Name Type type_id (bool,U128) This method returns
U256
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the key of CRV token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the key of voting_escrow.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns U128.
Following is the table of parameters.
Parameter Name Type This method returns
U128
. -
Returns U128.
Following is the table of parameters.
Parameter Name Type This method returns
U128
. -
Returns String.
Following is the table of parameters.
Parameter Name Type owner U128 This method returns
String
. -
Returns Key. Needed for enumeration.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
Key
. -
Returns VotedSlope by providing address.
Following is the table of parameters.
Parameter Name Type owner Key spender Key This method returns
VotedSlope
. -
Returns Total vote power used by user
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
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
. -
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
. -
Returns last scheduled time (next week).
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
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
. -
Returns last scheduled time (next week).
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
Returns total weight.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
Returns last scheduled time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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
. -
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
.
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'"
Following are the Minter's entry point methods.
-
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 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 tokens for
for
. Only possible whenmsg.sender
has been approved viatoggle_approve_mint
.Following is the table of parameters.
Parameter Name Type gauge_addr Key for Key This method returns nothing.
-
Allow
minting_user
to mint formsg.sender
.Following is the table of parameters.
Parameter Name Type minting_user Key This method returns nothing.
-
Returns the key of token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the key of Controller.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
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
. -
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
.
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'"
Following are the CurveRewards's entry point methods.
-
Returns the min value between blocktime and period_finish.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the rewards that is earned.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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 the amount.
Following is the table of parameters.
Parameter Name Type amount U256 This method returns nothing.
-
Withdraw the amount.
Following is the table of parameters.
Parameter Name Type amount U256 This method returns nothing.
-
Exit and withdraw all amount.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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.
-
Use to notify the reward amount.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Returns the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the balance of provided address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Stake function of lp token wrapper.
Following is the table of parameters.
Parameter Name Type amount U256 This method returns nothing.
-
Withdraw function lp token wrapper.
Following is the table of parameters.
Parameter Name Type amount U256 This method returns nothing.
-
Set the reward distribution key.
Following is the table of parameters.
Parameter Name Type reward_distribution Key This method returns nothing.
-
Returns owner key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
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.
-
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.
-
Return the address of uni(ERC20).
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the address of snx(ERC20).
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the duration.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the period_finish value.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the reward_rate value.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the last_update_time value.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the reward_per_token_stored value.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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
. -
Return the rewards value by providing the account.
Following is the table of parameters.
Parameter Name Type account Key This method returns
U256
.
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'"
Following are the LpTokenWrapper's entry point methods.
-
Stake the amount.
Following is the table of parameters.
Parameter Name Type amount U256 This method returns nothing.
-
Withdraw the amount.
Following is the table of parameters.
Parameter Name Type amount U256 This method returns nothing.
-
Returns the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the balance of provided address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the address of uni(ERC20).
Following is the table of parameters.
Parameter Name Type This method returns
Key
.
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'"
Following are the Ownable's entry point methods.
-
Returns owner key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
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.
-
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.
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'"
Following are the LiquidityGaugeWrapper's entry point methods.
-
Record a checkpoint for
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns
bool
. -
Return the number of claimable tokens per user.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Claim mintable CR.
Following is the table of parameters.
Parameter Name Type addr Option <Key>
This method returns nothing.
-
Set whether
addr
can deposit tokens formsg.sender
.Following is the table of parameters.
Parameter Name Type addr Key can_deposit bool This method returns nothing.
-
Deposit
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 addr Option <Key>
This method returns nothing.
-
Withdraw
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 This method returns nothing.
-
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
. -
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>
. -
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 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 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 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>
. -
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Transfer ownership of GaugeController to
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Return key of minter.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of crv_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of lp_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of gauge.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return balance of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the decimals.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the claimable_crv.
Following is the table of parameters.
Parameter Name Type account Key This method returns
U256
. -
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
. -
Return the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
.
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'"
Following are the LiquidityGaugeRewardWrapper's entry point methods.
-
Record a checkpoint for
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns
bool
. -
Return the number of claimable tokens per user.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Return the number of claimable reward per user.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Claim mintable CRV and reward tokens.
Following is the table of parameters.
Parameter Name Type addr Option <Key>
This method returns nothing.
-
Set whether
addr
can deposit tokens formsg.sender
.Following is the table of parameters.
Parameter Name Type addr Key can_deposit bool This method returns nothing.
-
Deposit
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 addr Option <Key>
This method returns nothing.
-
Withdraw
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 This method returns nothing.
-
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
. -
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>
. -
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 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 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 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>
. -
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Transfer ownership of GaugeController to
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Return key of minter.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of crv_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of lp_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of rewarded_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of gauge.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return balance of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the decimals.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the claimable_crv.
Following is the table of parameters.
Parameter Name Type account Key This method returns
U256
. -
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
. -
Return the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Returns the reward integral for of provided address.
Following is the table of parameters.
Parameter Name Type account Key This method returns
U256
. -
Returns the reward integral.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the claimable_rewards.
Following is the table of parameters.
Parameter Name Type account Key This method returns
U256
.
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'"
Following are the LiquidityGaugeReward's entry point methods.
-
Record a checkpoint for
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns
bool
. -
Return the number of claimable tokens per user.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Return the number of claimable reward per user.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
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 whether
addr
can deposit tokens formsg.sender
.Following is the table of parameters.
Parameter Name Type addr Key can_deposit bool This method returns nothing.
-
Deposit
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 addr Option <Key>
This method returns nothing.
-
Withdraw
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 This method returns nothing.
-
Claim reward tokens.
Following is the table of parameters.
Parameter Name Type addr Option <Key>
This method returns nothing.
-
Return U256.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Transfer ownership of GaugeController to
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Switch claiming rewards on/off.
Following is the table of parameters.
Parameter Name Type val bool This method returns nothing.
-
Return key of minter.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of crv_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of lp_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of controller.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of voting_escrow.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return balance of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the future_epoch_time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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
. -
Return working_balances of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the working supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the period.
Following is the table of parameters.
Parameter Name Type This method returns
U128
. -
Return the period_timestamp.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
Return the integrate_inv_supply.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
Return the integrate_inv_supply_of.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the integrate_checkpoint_of.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the integrate_fraction.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the inflation_rate.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return key of reward_contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of rewarded_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the reward integral.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the reward integral for of provided address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the rewards for of provided address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the claimed_rewards_for of provided address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Returns the bool.
Following is the table of parameters.
Parameter Name Type account Key This method returns
bool
.
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'"
Following are the LiquidityGaugeV3's entry point methods.
-
Returns the decimals.
Following is the table of parameters.
Parameter Name Type This method returns
u8
. -
Return the U256.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Record a checkpoint for
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns
bool
. -
Return the number of claimable tokens per user.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
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
. -
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
. -
Get the number of already-claimed reward tokens for a user. Returns total amount of
token
already claimed byaddr
.Following is the table of parameters.
Parameter Name Type addr Key token Key This method returns
U256
. -
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 useclaimable_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
. -
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 the default reward receiver for the caller.
Following is the table of parameters.
Parameter Name Type receiver Key This method returns nothing.
-
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
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
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
value
LP tokens.Following is the table of parameters.
Parameter Name Type value U256 claim_rewards Option <bool>
This method returns nothing.
-
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>
. -
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 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 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 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 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 the killed status for this contract.
Following is the table of parameters.
Parameter Name Type is_killed bool This method returns nothing.
-
Transfer ownership of GaugeController to
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Accept a pending ownership transfer.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Return key of minter.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of crv_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of lp_token.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of controller.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return key of voting_escrow.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the future_epoch_time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return balance of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the allowance of provided key.
Following is the table of parameters.
Parameter Name Type owner Key spender Key This method returns
U256
. -
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Return working_balances of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the working supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the period.
Following is the table of parameters.
Parameter Name Type This method returns
U128
. -
Return the period_timestamp.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
Return the integrate_inv_supply.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
U256
. -
Return the integrate_inv_supply_of.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the integrate_checkpoint_of.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the integrate_fraction.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the inflation_rate.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return key of reward_tokens.
Following is the table of parameters.
Parameter Name Type owner U256 This method returns
Key
. -
Returns the reward receiver.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
Key
. -
Returns the reward integral.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
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
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
.
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'"
Following are the CurveTokenV3's entry point methods.
-
Returns the decimals.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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>
. -
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 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 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 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 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 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 the minter.
Following is the table of parameters.
Parameter Name Type minter Key This method returns nothing.
-
Set the name of contract.
Following is the table of parameters.
Parameter Name Type name String symbol String This method returns nothing.
-
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Return the total supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the key of minter.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return balance of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the allowance of provided key.
Following is the table of parameters.
Parameter Name Type owner Key spender Key This method returns
U256
.
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'"
Following are the ERC20CRV's entry point methods.
-
Update mining rate and supply at the start of the epoch.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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
. -
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
. -
Current number of tokens in existence (claimed or unclaimed).
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
How much supply is mintable from start timestamp till end timestamp. Returns Tokens mintable from
start
tillend
.Following is the table of parameters.
Parameter Name Type start U256 end U256 This method returns
U256
. -
Set the minter.
Following is the table of parameters.
Parameter Name Type minter Key This method returns nothing.
-
Set the new admin.
Following is the table of parameters.
Parameter Name Type admin Key This method returns nothing.
-
Total number of tokens in existence.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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
. -
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>
. -
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 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
value
tokens and assign them toto
Following is the table of parameters.
Parameter Name Type to Key value U256 This method returns
bool
. -
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.
-
Change the token name and symbol to
name
andsymbol
.Following is the table of parameters.
Parameter Name Type name String symbol String This method returns nothing.
-
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the decimals.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return balance of given address.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the key of minter.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the key of admin.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the mining epoch.
Following is the table of parameters.
Parameter Name Type This method returns
U128
. -
Return the start_epoch_time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the rate.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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 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>
.
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'"
Following are the ERC20's entry point methods.
-
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>
. -
Sends pool tokens from one hash to another.
User needs to call approve method before calling thetranfer_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 asincreaseAllowance()
anddecreaseAllowance()
, 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. -
Lets
self.get_caller()
set their allowance for a spender.
user needs to call thisapprove
method before calling thetransfer_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 asincreaseAllowance()
anddecreaseAllowance()
, 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. -
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
. -
Returns the current
nonce
for an address.Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
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
. -
Returns the total amount of pool tokens for a pair.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
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.
-
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: Toburn
the tokens against the hash provided by user, User needs tomint
tokens first inERC20
. -
Returns the
name
of tokens for a pair.Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the
symbol
of tokens for a pair.Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the
decimals
.Following is the table of parameters.
Parameter Name Type This method returns
u8
. -
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 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>
. -
Return the package hash of contract.
Following is the table of parameters.
Parameter Name Type This method returns
ContractPackageHash
.
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'"
Following are the FeeDistributor's entry point methods.
-
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.
-
Get the veCRV balance for
user
attimestamp
. Return veCRV balance.Following is the table of parameters.
Parameter Name Type user U256 timestamp U256 This method returns
U256
. -
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 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 theClaimed
event that fires, ifclaim_epoch
is less thanmax_epoch
, the account may claim again.Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
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
. -
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 transfer of ownership.
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply transfer of ownership.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Toggle permission for checkpointing by any account.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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 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
. -
Return Start time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return time cursor.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return time cursor of.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Return user_epoch_of.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
U256
. -
Return last_token_time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return tokens_per_week.
Following is the table of parameters.
Parameter Name Type week U256 This method returns
U256
. -
Return voting_escrow key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return token key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return total_received.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return token_last_balance.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return ve_supply.
Following is the table of parameters.
Parameter Name Type week U256 This method returns
U256
. -
Return admin key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return future_admin key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return can_checkpoint_token bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Return emergency_return key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return is_killed bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
.
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'"
Following are the GaugeProxy's entry point methods.
-
Set ownership admin to
o_admin
and emergency admin toe_admin
.Following is the table of parameters.
Parameter Name Type o_admin Key e_admin Key This method returns nothing.
-
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.
-
Transfer ownership for liquidity gauge
gauge
tonew_owner
.Following is the table of parameters.
Parameter Name Type gauge Key new_owner Key This method returns nothing.
-
Apply transferring ownership of
gauge
.
Following is the table of parameters.
Parameter Name | Type |
---|---|
gauge | Key |
This method returns nothing.
-
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 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.
-
Return ownership_admin.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return emergency_admin.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return future_ownership_admin.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return future_emergency_admin.
Following is the table of parameters.
Parameter Name Type This method returns
Key
.
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'"
Following are the IRewardDistributionRecipient's entry point methods.
-
Set reward Distribution.
Following is the table of parameters.
Parameter Name Type reward_distribution Key This method returns nothing.
-
Returns owner key.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
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.
-
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.
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'"
Following are the VestingEscrow's entry point methods.
-
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.
-
Vest tokens for multiple recipients.
Following is the table of parameters.
Parameter Name Type recipients Vec <String>
amounts Vec <U256>
This method returns nothing.
-
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 the ability to call
toggle_disable
.Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Disable the funding admin accounts.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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
. -
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
. -
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
. -
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
. -
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 tokens which have vested.
Following is the table of parameters.
Parameter Name Type addr Option <Key>
This method returns
U256
. -
Transfer ownership of GaugeController to
addr
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Return the token address.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the start time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the end time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the initial locked.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total claimed.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the initial_locked_supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the unallocated_supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the can_disable.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Return the disabled_at.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the bool.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Returns the bool.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
bool
.
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'"
Following are the VestingEscrowSimple's entry point methods.
-
Initialize the contract. This function is seperate from
__init__
because of the factory pattern used inVestingEscrowFactory.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
. -
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 the ability to call
toggle_disable
.Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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
. -
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
. -
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
. -
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
. -
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 tokens which have vested.
Following is the table of parameters.
Parameter Name Type addr Option <Key>
This method returns
U256
. -
Transfer ownership of GaugeController to
addr
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Return the token address.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the start time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the end time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the initial locked.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total claimed.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the initial_locked_supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the can_disable.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Return the disabled_at.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
.
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'"
Following are the VestingEscrowFactory's entry point methods.
-
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
. -
Transfer ownership of GaugeController to
addr
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Initialize the contract. This function is seperate from
__init__
because of the factory pattern used inVestingEscrowFactory.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
. -
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 the ability to call
toggle_disable
.Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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
. -
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
. -
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
. -
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
. -
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 tokens which have vested.
Following is the table of parameters.
Parameter Name Type addr Option <Key>
This method returns
U256
. -
Transfer ownership of GaugeController to
addr
Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Return the token address.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Return the start time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the end time.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the initial locked.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the total claimed.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Return the initial_locked_supply.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Return the can_disable.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Return the disabled_at.
Following is the table of parameters.
Parameter Name Type owner Key This method returns
U256
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
.
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'"
Following are the VotingEscrow's entry point methods.
-
Transfer ownership of VotingEscrow contract to
addr
.Following is the table of parameters.
Parameter Name Type addr Key This method returns nothing.
-
Apply a pending ownership transfer
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
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
. -
Get the timestamp for checkpoint
idx
foraddr
.Following is the table of parameters.
Parameter Name Type addr Key idx U256 This method returns
U256
. -
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
. -
Record global data to checkpoint.
Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Deposit
value
tokens foraddr
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.
-
Deposit
value
tokens formsg.sender
and lock untilunlock_time
.Following is the table of parameters.
Parameter Name Type value U256 unlock_time U256 This method returns nothing.
-
Deposit
value
additional tokens formsg.sender
without modifying the unlock time.Following is the table of parameters.
Parameter Name Type value U256 This method returns nothing.
-
Extend the unlock time for
msg.sender
tounlock_time
.Following is the table of parameters.
Parameter Name Type unlock_time U256 This method returns nothing.
-
Withdraw all tokens for
msg.sender
.Following is the table of parameters.
Parameter Name Type This method returns nothing.
-
Get the current voting power for
msg.sender
. Adheres to the ERC20balanceOf
interface for Aragon compatibility.Following is the table of parameters.
Parameter Name Type addr Key t Option <U256>
This method returns
U256
. -
Measure voting power of
addr
at block heightblock
.Following is the table of parameters.
Parameter Name Type addr Key time U256 This method returns
U256
. -
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
. -
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 the controller. Dummy method required for Aragon compatibility.
Following is the table of parameters.
Parameter Name Type new_controller Key This method returns nothing.
-
Returns the future admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the admin of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the token of contract.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the supply of contract.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the locked balance of contract.
Following is the table of parameters.
Parameter Name Type addr Key This method returns
LockedBalance
. -
Returns the epoch.
Following is the table of parameters.
Parameter Name Type This method returns
U256
. -
Returns the point history.
Following is the table of parameters.
Parameter Name Type epoch U256 This method returns
Point
. -
Returns the user_point_history.
Following is the table of parameters.
Parameter Name Type user Key user_epoch U256 This method returns
Point
. -
Returns the user_point_epoch.
Following is the table of parameters.
Parameter Name Type user Key This method returns
U256
. -
Returns the slope_changes.
Following is the table of parameters.
Parameter Name Type time U256 This method returns
Tuple(bool,U128)
. -
Returns the address of controller.
Following is the table of parameters.
Parameter Name Type This method returns
Key
. -
Returns the transfers_enabled.
Following is the table of parameters.
Parameter Name Type This method returns
bool
. -
Returns the name.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the symbol.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the version.
Following is the table of parameters.
Parameter Name Type This method returns
String
. -
Returns the decimals.
Following is the table of parameters.
Parameter Name Type This method returns
U256
.