VotingEscrow
Last updated
Last updated
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 .
To create a lock, call the createLock(uint256 _value)
payable method. The call value and _value
parameter must match.
ethers.js
foundry
To add to your existing lock, call the increaseAmount(uint256 _value)
payable method. The call value and _value
parameter must match.
ethers.js
foundry
To read voting power, call the balanceOf(address _owner)
view.
ethers.js
foundry
To withdraw a completed lock, call the withdraw()
method.
ethers.js
foundry