Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore): update events in L1 & L2 contracts #378

Open
viraj124 opened this issue Dec 30, 2024 · 0 comments · May be fixed by #384
Open

(chore): update events in L1 & L2 contracts #378

viraj124 opened this issue Dec 30, 2024 · 0 comments · May be fixed by #384
Assignees

Comments

@viraj124
Copy link
Contributor

viraj124 commented Dec 30, 2024

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 to event FuelChainStateUpdated(address sender, address indexed oldValue, address indexed newValue); as only addresses with DEFAULT_ADMIN_ROLE can 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 to event 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 to event 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 to pub 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 to pub struct WithdrawalEvent {pub amount: u64, pub from: b256, pub to: Identity, pub token_id: b256} to add the withdrawn token id.

@viraj124 viraj124 self-assigned this Dec 30, 2024
@viraj124 viraj124 changed the title chore: update events chore: update events in L1 & L2 contracts Jan 8, 2025
@viraj124 viraj124 changed the title chore: update events in L1 & L2 contracts chore): update events in L1 & L2 contracts Jan 9, 2025
@viraj124 viraj124 changed the title chore): update events in L1 & L2 contracts (chore): update events in L1 & L2 contracts Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant