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

Update sendMessageToL2 function and add AaveStarknetBridgeUpgradePayload contract #135

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

achab
Copy link
Collaborator

@achab achab commented Mar 31, 2023

No description provided.

@achab achab changed the title Update sendMessageToL2 function and dependencies Update sendMessageToL2 function and add AavePayload contract to update L1 Bridge proxy Mar 31, 2023
@achab achab changed the title Update sendMessageToL2 function and add AavePayload contract to update L1 Bridge proxy Update sendMessageToL2 function and add AavePayload contract to update L1 Bridge Mar 31, 2023
@achab achab changed the title Update sendMessageToL2 function and add AavePayload contract to update L1 Bridge Update sendMessageToL2 function and add AaveStarknetBridgeUpgradePayload contract Mar 31, 2023
@achab achab force-pushed the feat/upgrade-bridge branch from f0d201e to 5afcf48 Compare March 31, 2023 07:47

function execute() external {
try
L1_BRIDGE_PROXY.upgradeTo(L1_BRIDGE_NEW_IMPLEMENTATION_ADDRESS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put upgradeToAndCall here to update revision

contracts/l1/Bridge.sol Show resolved Hide resolved
@@ -312,26 +321,29 @@ contract Bridge is IBridge, Initializable {
(payload[5], payload[6]) = Cairo.toSplitUint(blockNumber);
(payload[7], payload[8]) = Cairo.toSplitUint(currentRewardsIndex);

_messagingContract.sendMessageToL2(
uint256 nonce;
(, nonce) = _messagingContract.sendMessageToL2{value: fee}(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our opinion, there should be some hard limit of this fee ie, 0.1ETH, and revert in case a user sends more. Because, most likely, it can happen only in the case of some bug.

So I would wrap this logic into some internal function because it is used many times in a code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants