-
Notifications
You must be signed in to change notification settings - Fork 77
Description
We can make some updates to events in the L1 contracts, mainly to save gas on L1, the potential changes would be as follows:
-
event FuelChainStateUpdated(address indexed sender, address indexed oldValue, address indexed newValue);can be updated toevent FuelChainStateUpdated(address sender, address indexed oldValue, address indexed newValue);as only addresses withDEFAULT_ADMIN_ROLEcan update the chain state contract, and addresses with that role are limited. -
event Deposit(bytes32 indexed sender, address indexed tokenAddress, uint256 amount);can be changed toevent Deposit(bytes32 sender, address indexed tokenAddress, uint256 amount);to remove the number of indexed arguments and save gas. -
event Withdrawal(bytes32 indexed recipient, address indexed tokenAddress, uint256 amount);can be changed toevent Withdrawal(bytes32 recipient, address indexed tokenAddress, uint256 amount);to remove the number of indexed arguments and save gas.
There is another update we can make to the L2 bridge contract events, which would be as follows:
-
pub struct DepositEvent {pub amount: u64, pub from: b256, pub to: Identity}can be updated topub struct DepositEvent {pub amount: u64, pub from: b256, pub to: Identity, pub token_id: b256}to add the deposited token id. -
pub struct WithdrawalEvent {pub amount: u64, pub from: b256, pub to: Identity}can be updated topub struct WithdrawalEvent {pub amount: u64, pub from: b256, pub to: Identity, pub token_id: b256}to add the withdrawn token id.