Skip to main content

VotingFacet

Asset Tokenization Studio Team

VotingFacet

Diamond facet that exposes voting rights management selectors.

Inherits all business logic from the Voting abstract contract and registers selectors and interface IDs via IStaticFunctionSelectors.

Methods​

cancelVoting​

function cancelVoting(uint256 _voteId) external nonpayable returns (bool success_)

Cancels an existing voting

Parameters​

NameTypeDescription
_voteIduint256The ID of the voting to be cancelled

Returns​

NameTypeDescription
success_boolWhether 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​

NameTypeDescription
_voteIduint256The ID of the voting to force-cancel

Returns​

NameTypeDescription
success_boolWhether the force-cancellation was successful

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[])

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[])

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
_0bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

getVoting​

function getVoting(uint256 _voteID) external view returns (struct IVotingTypes.RegisteredVoting registeredVoting_, bool isDisabled_)

Retrieves a registered voting by its ID

Parameters​

NameTypeDescription
_voteIDuint256The ID of the voting to retrieve

Returns​

NameTypeDescription
registeredVoting_IVotingTypes.RegisteredVotingThe registered voting data
isDisabled_boolWhether the voting is disabled

getVotingCount​

function getVotingCount() external view returns (uint256 votingCount_)

Retrieves the total number of votings

Returns​

NameTypeDescription
votingCount_uint256The 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​

NameTypeDescription
_voteIDuint256The ID of the voting
_accountaddressThe account address

Returns​

NameTypeDescription
votingFor_IVotingTypes.VotingForVoting 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​

NameTypeDescription
_newVotingIVotingTypes.Votingundefined

Returns​

NameTypeDescription
voteID_uint256undefined

Events​

VotingCancelled​

event VotingCancelled(uint256 voteId, address indexed operator)

Emitted when a voting is cancelled

Parameters​

NameTypeDescription
voteIduint256The ID of the cancelled voting
operator indexedaddressThe 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​

NameTypeDescription
voteIduint256The ID of the force-cancelled voting
operator indexedaddressThe 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​

NameTypeDescription
corporateActionIdbytes32The ID of the corporate action
voteIduint256The ID of the voting
operator indexedaddressThe address of the operator who set the voting
recordDate indexeduint256The voting record date
databytesThe voting payload

Errors​

AccountHasNoRole​

error AccountHasNoRole(address account, bytes32 role)

Thrown when an account does not hold a required role.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the role.
rolebytes32The 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​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration 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​

NameTypeDescription
facetIdbytes32Identifier of the offending facet.
lastVersionuint256Last 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​

NameTypeDescription
snapshotIduint256The 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​

NameTypeDescription
_errorIdbytes4Identifier of the unexpected validation condition.

UnrecognizedResolverProxyVersion​

error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)

Thrown when the provided proxy version does not match any BLR compatible standard.

Parameters​

NameTypeDescription
_resolverProxyVersionbytes8proxy 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​

NameTypeDescription
corporateActionIdbytes32The ID of the corporate action
voteIduint256The 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​

NameTypeDescription
indexuint256The out-of-range index that was provided.
actionTypebytes32The 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​

NameTypeDescription
timeStampuint256Timestamp rejected for scheduling.