Skip to content

Commit 2b2a90b

Browse files
committed
docs: doc events and upgrade
1 parent c73cf0e commit 2b2a90b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/token_migration/src/events.cairo

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub mod TokenMigrationEvents {
22
use starknet::{ContractAddress, EthAddress};
33

4+
/// Emitted when a token swap sucessfully executed.
45
#[derive(Drop, starknet::Event, Debug, PartialEq)]
56
pub struct TokenMigrated {
67
#[key]
@@ -12,28 +13,34 @@ pub mod TokenMigrationEvents {
1213
pub amount: u256,
1314
}
1415

16+
/// Emitted upon handling l1-l2 msg verifying L1 recipient address.
1517
#[derive(Drop, starknet::Event, Debug, PartialEq)]
1618
pub struct L1RecipientVerified {
1719
pub l1_recipient: EthAddress,
1820
}
1921

22+
/// Emitted on a change in the token supplier address.
2023
#[derive(Drop, starknet::Event, Debug, PartialEq)]
2124
pub struct TokenSupplierSet {
2225
pub token_supplier: ContractAddress,
2326
}
2427

28+
/// Emitted on a change in the legacy token buffer level.
2529
#[derive(Drop, starknet::Event, Debug, PartialEq)]
2630
pub struct LegacyBufferSet {
2731
pub old_buffer: u256,
2832
pub new_buffer: u256,
2933
}
3034

35+
/// Emitted on a change in the fixed-size used for legacy token withdrawals to L1.
3136
#[derive(Drop, starknet::Event, Debug, PartialEq)]
3237
pub struct BatchSizeSet {
3338
pub old_batch_size: u256,
3439
pub new_batch_size: u256,
3540
}
3641

42+
/// Emitted when failed to send legacy tokens to L1.
43+
/// The failure is caught and handled without failing the user action.
3744
#[derive(Drop, starknet::Event, Debug, PartialEq)]
3845
pub struct SendToL1Failed {
3946
pub error: felt252,

packages/token_migration/src/token_migration.cairo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ pub mod TokenMigration {
113113

114114
#[abi(embed_v0)]
115115
impl UpgradeableImpl of IUpgradeable<ContractState> {
116+
/// Upgrades the contract to a new class hash.
117+
/// Caller must be the owner.
116118
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {
117119
self.ownable.assert_only_owner();
118120
self.upgradeable.upgrade(:new_class_hash);

0 commit comments

Comments
 (0)