Voting
Asset Tokenization Studio Team
Voting
Abstract facet implementing the voting-rights corporate action lifecycle.
Delegates persistence to VotingStorageWrapper; access is gated by ROLE_CORPORATE_ACTION and the standard activation/pause modifiers.
Methods
cancelVoting
function cancelVoting(uint256 _voteId) external nonpayable returns (bool success_)
Cancels an existing voting
Parameters
| Name | Type | Description |
|---|---|---|
| _voteId | uint256 | The ID of the voting to be cancelled |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | Whether the cancellation was successful |
forceCancelVoting
function forceCancelVoting(uint256 _voteId) external nonpayable returns (bool success_)
Force-cancels a voting regardless of its record date
Restricted to ROLE_CORPORATE_ACTION_FORCE_CANCEL; gated by onlyOperational, onlyUnpaused, and onlyMatchingActionType(CORPORATE_ACTION_TYPE_VOTING_RIGHTS, _voteId - 1).
Parameters
| Name | Type | Description |
|---|---|---|
| _voteId | uint256 | The ID of the voting to force-cancel |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | Whether the force-cancellation was successful |
getVoting
function getVoting(uint256 _voteID) external view returns (struct IVotingTypes.RegisteredVoting registeredVoting_, bool isDisabled_)
Retrieves a registered voting by its ID
Parameters
| Name | Type | Description |
|---|---|---|
| _voteID | uint256 | The ID of the voting to retrieve |
Returns
| Name | Type | Description |
|---|---|---|
| registeredVoting_ | IVotingTypes.RegisteredVoting | The registered voting data |
| isDisabled_ | bool | Whether the voting is disabled |
getVotingCount
function getVotingCount() external view returns (uint256 votingCount_)
Retrieves the total number of votings
Returns
| Name | Type | Description |
|---|---|---|
| votingCount_ | uint256 | The total count of votings |
getVotingFor
function getVotingFor(uint256 _voteID, address _account) external view returns (struct IVotingTypes.VotingFor votingFor_)
Retrieves voting information for a specific account and voting ID
Return value includes user balance at voting record date
Parameters
| Name | Type | Description |
|---|---|---|
| _voteID | uint256 | The ID of the voting |
| _account | address | The account address |
Returns
| Name | Type | Description |
|---|---|---|
| votingFor_ | IVotingTypes.VotingFor | Voting information for the specified account |
initializeVoting
function initializeVoting() external nonpayable
Initialises the voting capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
setVoting
function setVoting(IVotingTypes.Voting _newVoting) external nonpayable returns (uint256 voteID_)
Parameters
| Name | Type | Description |
|---|---|---|
| _newVoting | IVotingTypes.Voting | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| voteID_ | uint256 | undefined |
Events
VotingCancelled
event VotingCancelled(uint256 voteId, address indexed operator)
Emitted when a voting is cancelled
Parameters
| Name | Type | Description |
|---|---|---|
| voteId | uint256 | The ID of the cancelled voting |
operator indexed | address | The address of the operator who cancelled the voting |
VotingForceCancelled
event VotingForceCancelled(uint256 voteId, address indexed operator)
Emitted when an admin force-cancels a voting, bypassing date guards
Parameters
| Name | Type | Description |
|---|---|---|
| voteId | uint256 | The ID of the force-cancelled voting |
operator indexed | address | The address of the operator who force-cancelled the voting |
VotingInitialized
event VotingInitialized()
Emitted once when the voting capability is initialised on a token.
Fires exclusively from initializeVoting.
VotingSet
event VotingSet(bytes32 corporateActionId, uint256 voteId, address indexed operator, uint256 indexed recordDate, bytes data)
Emitted when a voting is set
Parameters
| Name | Type | Description |
|---|---|---|
| corporateActionId | bytes32 | The ID of the corporate action |
| voteId | uint256 | The ID of the voting |
operator indexed | address | The address of the operator who set the voting |
recordDate indexed | uint256 | The voting record date |
| data | bytes | The voting payload |
Errors
AccountHasNoRole
error AccountHasNoRole(address account, bytes32 role)
Thrown when an account does not hold a required role.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account that lacks the role. |
| role | bytes32 | The role that is not held. |
AssetNotOperational
error AssetNotOperational(bytes32 configId, uint256 versionId)
Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.
Parameters
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Resolver-proxy configuration whose operational status was checked. |
| versionId | uint256 | Configuration version whose operational status was checked. |
Deactivated
error Deactivated()
Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.
FacetAlreadyRegistered
error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)
Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).
Parameters
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Identifier of the offending facet. |
| lastVersion | uint256 | Last version recorded for that facet at the time of the check. |
IsPaused
error IsPaused()
Thrown when an operation that requires the token to be unpaused is attempted while the token is paused (own flag or any external pause contract).
SnapshotIdDoesNotExists
error SnapshotIdDoesNotExists(uint256 snapshotId)
Thrown when the requested snapshot identifier has never been taken on this token.
Parameters
| Name | Type | Description |
|---|---|---|
| snapshotId | uint256 | The unrecognised snapshot identifier that was supplied. |
SnapshotIdNull
error SnapshotIdNull()
Thrown when a snapshot identifier of zero is supplied; zero is reserved and never assigned to a valid snapshot.
UnexpectedError
error UnexpectedError(bytes4 _errorId)
Reverts when an unreachable validation state is detected.
Replaces assertions for defensive handling of logically impossible states.
Parameters
| Name | Type | Description |
|---|---|---|
| _errorId | bytes4 | Identifier of the unexpected validation condition. |
UnrecognizedResolverProxyVersion
error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)
Thrown when the provided proxy version does not match any BLR compatible standard.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyVersion | bytes8 | proxy version that is not compatible with the BLR. |
VotingAlreadyRecorded
error VotingAlreadyRecorded(bytes32 corporateActionId, uint256 voteId)
Raised when attempting to cancel a voting that has already been recorded
Parameters
| Name | Type | Description |
|---|---|---|
| corporateActionId | bytes32 | The ID of the corporate action |
| voteId | uint256 | The ID of the voting |
VotingRightsCreationFailed
error VotingRightsCreationFailed()
Raised when voting rights creation fails
WalletRecovered
error WalletRecovered()
Thrown when attempting to recover a wallet that has already been recovered.
WrongIndexForAction
error WrongIndexForAction(uint256 index, bytes32 actionType)
Thrown when a type-scoped index does not correspond to an existing action.
Parameters
| Name | Type | Description |
|---|---|---|
| index | uint256 | The out-of-range index that was provided. |
| actionType | bytes32 | The action type against which the index was validated. |
WrongTimestamp
error WrongTimestamp(uint256 timeStamp)
Reverts when a scheduled timestamp is not strictly in the future.
Used for shared scheduling validation where the current block time is read through TimeTravelStorageWrapper.
Parameters
| Name | Type | Description |
|---|---|---|
| timeStamp | uint256 | Timestamp rejected for scheduling. |