VotingEscrow
Users create and control locks on the VotingEscrow
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 oklink.com/canto.
Creating a Lock
To create a lock, call the createLock(uint256 _value)
payable method. The call value and _value
parameter must match.
ethers.js
foundry
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
foundry
Reading Voting Power
To read voting power, call the balanceOf(address _owner)
view.
ethers.js
foundry
Withdrawing
To withdraw a completed lock, call the withdraw()
method.
ethers.js
foundry
Last updated