Skip to content

ILockManager ​

Interface · src/interfaces/ILockManager.sol

Explained in: The LockManager

Author: Aragon X 2025

Helper contract acting as the vault for locked tokens used to vote on LockToGovern plugins.

Functions ​

activeProposalsCreatedBy ​

solidity
function activeProposalsCreatedBy(address _creator) external view returns (uint256 _result)

Selector: 0x2383ff1e

Returns how many active proposalID's were created by the given address

ParameterTypeDescription
_creatoraddressThe address to use for filtering

canVote ​

solidity
function canVote(
    uint256 proposalId,
    address voter,
    IMajorityVoting.VoteOption voteOption
) external view returns (bool)

Selector: 0x17d1b404

Checks if an account can participate on a proposal. This can be because the proposal

  • has not started,
  • has ended,
  • was executed, or
  • the voter doesn't have any tokens locked.

Dev: The function assumes that the queried proposal exists.

ParameterTypeDescription
proposalIduint256The proposal Id.
voteraddressThe account address to be checked.
voteOptionIMajorityVoting.VoteOptionThe value of the new vote to register.

getLockedBalance ​

solidity
function getLockedBalance(address account) external view returns (uint256)

Selector: 0xc4086893

Returns the currently locked balance that the given account has on the contract.

ParameterTypeDescription
accountaddressThe address whose locked balance is returned.

lock() ​

solidity
function lock() external

Selector: 0xf83d08ba

Locks the balance currently allowed by msg.sender on this contract NOTE: Tokens locked and not allocated into a proposal are treated in the same way as the rest. They can only be unlocked when all active proposals with votes have ended.

lock(uint256) ​

solidity
function lock(uint256 amount) external

Selector: 0xdd467064

Locks the given amount from msg.sender on this contract NOTE: Tokens locked and not allocated into a proposal are treated in the same way as the rest. They can only be unlocked when all active proposals with votes have ended.

ParameterTypeDescription
amountuint256How many tokens the contract should lock

lockAndVote(uint256,uint8,uint256) ​

solidity
function lockAndVote(
    uint256 proposalId,
    IMajorityVoting.VoteOption vote,
    uint256 amount
) external

Selector: 0x1adb4f63

Locks the given amount from msg.sender on this contract and registers the given vote on the target plugin

ParameterTypeDescription
proposalIduint256The ID of the proposal where the vote will be registered
voteIMajorityVoting.VoteOptionThe vote to cast (Yes, No, Abstain)
amountuint256How many tokens the contract should lock and use for voting

lockAndVote(uint256,uint8) ​

solidity
function lockAndVote(uint256 proposalId, IMajorityVoting.VoteOption vote) external

Selector: 0x98f7aab1

Locks the balance currently allowed by msg.sender on this contract and registers the given vote on the target plugin

ParameterTypeDescription
proposalIduint256The ID of the proposal where the vote will be registered
voteIMajorityVoting.VoteOptionThe vote to cast (Yes, No, Abstain)

plugin ​

solidity
function plugin() external view returns (ILockToGovernBase)

Selector: 0xef01df4f

Returns the address of the voting plugin.

ReturnsTypeDescription
[0]ILockToGovernBase

proposalCreated ​

solidity
function proposalCreated(uint256 proposalId, address creator) external

Selector: 0x6c393965

Called by the lock to vote plugin whenever a proposal is created. It instructs the manager to start tracking the given proposal.

ParameterTypeDescription
proposalIduint256The ID of the proposal that msg.sender is reporting as created.
creatoraddressThe address creating the proposal.

proposalSettled ​

solidity
function proposalSettled(uint256 proposalId) external

Selector: 0x6689ef0f

Called by the lock to vote plugin whenever a proposal is executed (or settled). It instructs the manager to remove the proposal from the list of active proposal locks. There's no guarantee that proposalSettled() will be reliably called for a proposal ID. Manually checking a proposal's state may be necessary in order to verify that it has ended.

ParameterTypeDescription
proposalIduint256The ID of the proposal that msg.sender is reporting as done.

pruneProposals ​

solidity
function pruneProposals(uint256 count) external

Selector: 0xbfadf8f7

Triggers a manual cleanup of the known proposal ID's that have already ended. Settled proposals are garbage collected when they are executed or when a user unlocks his tokens. Use this method if a long list of unsettled yet ended proposals ever creates a gas bottleneck that discourages users from unlocking.

ParameterTypeDescription
countuint256How many proposals should be cleaned up, at most.

setPluginAddress ​

solidity
function setPluginAddress(ILockToGovernBase plugin) external

Selector: 0x587a6b40

Defines the given plugin address as the target for voting.

ParameterTypeDescription
pluginILockToGovernBaseThe address of the contract to use as the plugin.

settings ​

solidity
function settings() external view returns (PluginMode pluginMode)

Selector: 0xe06174e4

Returns the current settings of the LockManager.

ReturnsTypeDescription
pluginModePluginModeThe plugin mode (currently, voting only)

token ​

solidity
function token() external view returns (address)

Selector: 0xfc0c546a

Returns the address of the token contract used to determine the voting power.

unlock ​

solidity
function unlock() external

Selector: 0xa69df4b5

If the governance plugin allows it, releases all active locks placed on active proposals and transfers msg.sender's locked balance back. Depending on the current mode, it withdraws only if no locks are being used in active proposals.

vote ​

solidity
function vote(uint256 proposalId, IMajorityVoting.VoteOption vote) external

Selector: 0x943e8216

Uses the locked balance to vote on the given proposal for the registered plugin

ParameterTypeDescription
proposalIduint256The ID of the proposal where the vote will be registered
voteIMajorityVoting.VoteOptionThe vote to cast (Yes, No, Abstain)