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

Feat v3.5 #52

Merged
merged 51 commits into from
Sep 18, 2024
Merged

Feat v3.5 #52

merged 51 commits into from
Sep 18, 2024

Conversation

dragos-rebegea
Copy link
Contributor

No description provided.

cosmatudor and others added 30 commits August 21, 2024 14:25
…nagement

CII-56: Pending transactions management
evelinemolnar
evelinemolnar previously approved these changes Aug 27, 2024
contracts/BridgeProxy.sol Outdated Show resolved Hide resolved
contracts/SharedStructs.sol Outdated Show resolved Hide resolved
contracts/BridgeProxy.sol Outdated Show resolved Hide resolved
contracts/BridgeProxy.sol Outdated Show resolved Hide resolved
contracts/BridgeProxy.sol Outdated Show resolved Hide resolved
contracts/BridgeProxy.sol Outdated Show resolved Hide resolved

require(txn.amount != 0, "BridgeProxy: No amount bridged");

if (txn.callData.length > 0) {
Copy link
Collaborator

@ccorcoveanu ccorcoveanu Aug 29, 2024

Choose a reason for hiding this comment

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

would it be cleaner to do?:

if (txn.callData.length == 0) {
    _finishExecuteGracefully(txId, true);
    return;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

@cosmatudor I guess this still applies, wouldn't it read better with an early exit?

contracts/BridgeProxy.sol Outdated Show resolved Hide resolved
CostinCarabas
CostinCarabas previously approved these changes Sep 12, 2024
contracts/Bridge.sol Outdated Show resolved Hide resolved
contracts/BridgeProxy.sol Outdated Show resolved Hide resolved
contracts/BridgeExecutor.sol Outdated Show resolved Hide resolved
function execute(uint256 txId) external whenNotPaused {
require(txId < currentTxId, "BridgeExecutor: Invalid transaction ID");
MvxTransaction memory txn = pendingTransactions[txId];

Copy link
Collaborator

@ccorcoveanu ccorcoveanu Sep 16, 2024

Choose a reason for hiding this comment

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

We should also have a check that txn still exists (it was not deleted). In case of reentrancy, when reaching back into this code, it will go on the else case, _refundAndDeleteTxn(txId);. Indeed it will try to transfer 0 back and the call will fail, but let's actually catch this behaviour and revert

@cosmatudor cosmatudor merged commit 3e64909 into feat/v3.5 Sep 18, 2024
1 check passed
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.

6 participants