Skip to main content

Events

Contract events for real-time UI subscriptions. Use watchContractEvent (viem) or contract.on (ethers) to listen.

Staking Events​

Emitted by both NodeRegistry and AppRegistry (inherited from Locker).

EventParametersIndexed
Lockeduser (address), deposited (uint256), newBalance (uint256)user
Relockeduser (address), balance (uint256)user
UnlockInitiateduser (address), balance (uint256), availableAt (uint256)user
Withdrawnuser (address), destination (address), balance (uint256)user, destination

Voting Events​

Emitted by NodeRegistry only (inherited from OZ Votes).

EventParametersIndexed
DelegateChangeddelegator (address), fromDelegate (address), toDelegate (address)delegator, fromDelegate, toDelegate
DelegateVotesChangeddelegate (address), previousVotes (uint256), newVotes (uint256)delegate
EIP712DomainChanged—

Slashing Events​

Emitted by AppRegistry only.

EventParametersIndexed
MinSlashAmountUpdatedoldAmount (uint256), newAmount (uint256)—
RoleAdminChangedrole (bytes32), previousAdminRole (bytes32), newAdminRole (bytes32)role, previousAdminRole, newAdminRole
RoleGrantedrole (bytes32), account (address), sender (address)role, account, sender
RoleRevokedrole (bytes32), account (address), sender (address)role, account, sender
SlashCooldownUpdatedoldCooldown (uint256), newCooldown (uint256)—

Governance Events​

Emitted by YellowGovernor.

EventParametersIndexed
LateQuorumVoteExtensionSetoldVoteExtension (uint64), newVoteExtension (uint64)—
ProposalCanceledproposalId (uint256)—
ProposalCreatedproposalId (uint256), proposer (address), targets (address[]), values (uint256[]), signatures (string[]), calldatas (bytes[]), voteStart (uint256), voteEnd (uint256), description (string)—
ProposalExecutedproposalId (uint256)—
ProposalExtendedproposalId (uint256), extendedDeadline (uint64)proposalId
ProposalGuardianSetoldProposalGuardian (address), newProposalGuardian (address)—
ProposalQueuedproposalId (uint256), etaSeconds (uint256)—
ProposalThresholdSetoldProposalThreshold (uint256), newProposalThreshold (uint256)—
QuorumFloorUpdatedoldFloor (uint256), newFloor (uint256)—
QuorumNumeratorUpdatedoldQuorumNumerator (uint256), newQuorumNumerator (uint256)—
TimelockChangeoldTimelock (address), newTimelock (address)—
VoteCastvoter (address), proposalId (uint256), support (uint8), weight (uint256), reason (string)voter
VoteCastWithParamsvoter (address), proposalId (uint256), support (uint8), weight (uint256), reason (string), params (bytes)voter
VotingDelaySetoldVotingDelay (uint256), newVotingDelay (uint256)—
VotingPeriodSetoldVotingPeriod (uint256), newVotingPeriod (uint256)—

Treasury Events​

Emitted by Treasury.

EventParametersIndexed
OwnershipTransferStartedpreviousOwner (address), newOwner (address)previousOwner, newOwner
OwnershipTransferredpreviousOwner (address), newOwner (address)previousOwner, newOwner
Transferredtoken (address), to (address), amount (uint256)token, to

Faucet Events​

Emitted by Faucet (Sepolia only).

EventParametersIndexed
CooldownUpdatednewCooldown (uint256)—
DripAmountUpdatednewAmount (uint256)—
Drippedrecipient (address), amount (uint256)recipient
OwnerUpdatednewOwner (address)newOwner

Subscribing with the SDK​

import { NodeRegistryAbi, YellowGovernorAbi, addresses } from "@yellow-org/contracts";

// Watch locks
publicClient.watchContractEvent({
address: addresses[1].nodeRegistry!,
abi: NodeRegistryAbi,
eventName: "Locked",
onLogs: (logs) => {
for (const log of logs) {
console.log(`${log.args.user} locked ${log.args.deposited}`);
}
},
});

// Watch proposals
publicClient.watchContractEvent({
address: addresses[1].governor!,
abi: YellowGovernorAbi,
eventName: "ProposalCreated",
onLogs: (logs) => {
for (const log of logs) {
console.log(`New proposal: ${log.args.proposalId}`);
}
},
});