LogoLogo
Block ExplorerDiscordTwitterMirror
  • What Is Canto?
  • Free Public Infrastructure
    • NOTE
    • Canto Lending Market
    • Canto DEX
  • Canto Neofinance
    • Overview
    • Application Specific Dollar
  • User Guides
    • Connecting to Canto
    • Bridging Assets
      • Bridging to Canto
      • Bridging from Canto
      • Synapse Bridge
      • Celer cBridge
    • Providing Liquidity
    • Lending & Borrowing
    • Staking
    • Governance
  • EVM Development
    • Overview
    • Quickstart Guide
    • NOTE, DEX, and Lending Market
    • Contract Secured Revenue (CSR)
    • Verifying Contracts
    • Contract Addresses
    • Testnet
  • Running a Node
    • Validators
      • Quickstart Guide
      • Useful Commands
      • Snapshots
      • FAQ
      • Troubleshooting
      • Uptime
      • Slashing
    • Archive Node
    • Graph Node (Subgraphs)
  • Technical Reference
    • Application Specific Dollar
      • asdOFT
      • asdRouter
      • asdUSDC
    • Liquidity Coordinator
      • VotingEscrow
      • GaugeController
      • LendingLedger
      • LiquidityGauge
    • Architecture & Design
      • Onboarding Module
      • Gravity Bridge
      • NOTE Design
      • Canto Lending Protocol
      • IBC Token Recovery
    • Governance
      • Governance Module
      • GovShuttle Module
      • Lending Market Governance
    • Tokenomics
    • Audits
Powered by GitBook
On this page
  • Creating a Lock
  • Reading Voting Power
  • Withdrawing
  1. Technical Reference
  2. Liquidity Coordinator

VotingEscrow

PreviousLiquidity CoordinatorNextGaugeController

Last updated 1 year ago

Users create and control locks on the contract. A user may only have one lock at any given time. Adding to a lock resets the 5-year lock period.

The code samples below demonstrate how to manage locks using ethers.js or foundry. You can also manage locks using a block explorer like .

Creating a Lock

To create a lock, call the createLock(uint256 _value) payable method. The call value and _value parameter must match.

ethers.js

amount = ethers.utils.parseEther("100") // 100 CANTO
await VotingEscrow.createLock(amount, { value: amount })

foundry

cast send --ledger 0x... "createLock(uint256)" 100 --value 100ether

Adding to a Lock

To add to your existing lock, call the increaseAmount(uint256 _value) payable method. The call value and _value parameter must match.

ethers.js

amount = ethers.utils.parseEther("100") // 100 CANTO
await VotingEscrow.increaseAmount(amount, { value: amount })

foundry

cast send --ledger 0x... "increaseAmount(uint256)" 100 --value 100ether

Reading Voting Power

To read voting power, call the balanceOf(address _owner) view.

ethers.js

const votingPower = await VotingEscrow.balanceOf("0x...")

foundry

cast call 0x... "balanceOf(address)" 0x...

Withdrawing

To withdraw a completed lock, call the withdraw() method.

ethers.js

await VotingEscrow.withdraw()

foundry

cast send --ledger 0x... "withdaw()"

VotingEscrow
oklink.com/canto