Skip to content

Commit

Permalink
Annotate events with index keys
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Apr 4, 2024
1 parent eb3192f commit bb2a676
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/src/emergency/sequencer_uptime_feed.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ mod SequencerUptimeFeed {
#[derive(Drop, starknet::Event)]
struct RoundUpdated {
status: u128,
#[key]
updated_at: u64
}

#[derive(Drop, starknet::Event)]
struct NewRound {
#[key]
round_id: u128,
#[key]
started_by: EthAddress,
Expand All @@ -93,21 +95,27 @@ mod SequencerUptimeFeed {
#[derive(Drop, starknet::Event)]
struct AnswerUpdated {
current: u128,
#[key]
round_id: u128,
#[key]
timestamp: u64
}

#[derive(Drop, starknet::Event)]
struct UpdateIgnored {
latest_status: u128,
#[key]
latest_timestamp: u64,
incoming_status: u128,
#[key]
incoming_timestamp: u64
}

#[derive(Drop, starknet::Event)]
struct L1SenderTransferred {
#[key]
from_address: EthAddress,
#[key]
to_address: EthAddress
}

Expand Down
2 changes: 2 additions & 0 deletions contracts/src/libraries/access_control.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ mod AccessControlComponent {

#[derive(Drop, starknet::Event)]
struct AddedAccess {
#[key]
user: ContractAddress
}

#[derive(Drop, starknet::Event)]
struct RemovedAccess {
#[key]
user: ContractAddress
}

Expand Down
2 changes: 2 additions & 0 deletions contracts/src/libraries/token/erc677.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ mod ERC677Component {

#[derive(Drop, starknet::Event)]
struct TransferAndCall {
#[key]
from: ContractAddress,
#[key]
to: ContractAddress,
value: u256,
data: Array<felt252>
Expand Down
1 change: 1 addition & 0 deletions contracts/src/libraries/upgradeable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ trait IUpgradeable<TContractState> {

#[derive(Drop, starknet::Event)]
struct Upgraded {
#[key]
new_impl: ClassHash
}

Expand Down
11 changes: 11 additions & 0 deletions contracts/src/multisig.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -107,36 +107,47 @@ mod Multisig {

#[derive(Drop, starknet::Event)]
struct TransactionSubmitted {
#[key]
signer: ContractAddress,
#[key]
nonce: u128,
#[key]
to: ContractAddress
}

#[derive(Drop, starknet::Event)]
struct TransactionConfirmed {
#[key]
signer: ContractAddress,
#[key]
nonce: u128
}

#[derive(Drop, starknet::Event)]
struct ConfirmationRevoked {
#[key]
signer: ContractAddress,
#[key]
nonce: u128
}

#[derive(Drop, starknet::Event)]
struct TransactionExecuted {
#[key]
executor: ContractAddress,
#[key]
nonce: u128
}

#[derive(Drop, starknet::Event)]
struct SignersSet {
#[key]
signers: Array<ContractAddress>
}

#[derive(Drop, starknet::Event)]
struct ThresholdSet {
#[key]
threshold: usize
}

Expand Down
15 changes: 15 additions & 0 deletions contracts/src/ocr2/aggregator.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ mod Aggregator {

#[derive(Drop, starknet::Event)]
struct NewTransmission {
#[key]
round_id: u128,
answer: u128,
#[key]
transmitter: ContractAddress,
observation_timestamp: u64,
observers: felt252,
Expand Down Expand Up @@ -418,7 +420,9 @@ mod Aggregator {

#[derive(Drop, starknet::Event)]
struct ConfigSet {
#[key]
previous_config_block_number: u64,
#[key]
latest_config_digest: felt252,
config_count: u64,
oracles: Array<OracleConfig>,
Expand Down Expand Up @@ -848,7 +852,9 @@ mod Aggregator {

#[derive(Drop, starknet::Event)]
struct BillingAccessControllerSet {
#[key]
old_controller: ContractAddress,
#[key]
new_controller: ContractAddress,
}

Expand All @@ -859,6 +865,7 @@ mod Aggregator {

#[derive(Drop, starknet::Event)]
struct OraclePaid {
#[key]
transmitter: ContractAddress,
payee: ContractAddress,
amount: u256,
Expand All @@ -867,7 +874,9 @@ mod Aggregator {

#[derive(Drop, starknet::Event)]
struct LinkTokenSet {
#[key]
old_link_token: ContractAddress,
#[key]
new_link_token: ContractAddress
}

Expand Down Expand Up @@ -1150,15 +1159,21 @@ mod Aggregator {

#[derive(Drop, starknet::Event)]
struct PayeeshipTransferRequested {
#[key]
transmitter: ContractAddress,
#[key]
current: ContractAddress,
#[key]
proposed: ContractAddress,
}

#[derive(Drop, starknet::Event)]
struct PayeeshipTransferred {
#[key]
transmitter: ContractAddress,
#[key]
previous: ContractAddress,
#[key]
current: ContractAddress,
}

Expand Down

0 comments on commit bb2a676

Please sign in to comment.