-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feat v3.5 #52
Conversation
…nagement CII-56: Pending transactions management
CII-53: Deposit Endpoint
CII-54: Execute endpoint
CII-55: Finish execute gracefully
CII-58: Refund workflow
contracts/BridgeProxy.sol
Outdated
|
||
require(txn.amount != 0, "BridgeProxy: No amount bridged"); | ||
|
||
if (txn.callData.length > 0) { |
There was a problem hiding this comment.
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;
}
There was a problem hiding this comment.
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?
function execute(uint256 txId) external whenNotPaused { | ||
require(txId < currentTxId, "BridgeExecutor: Invalid transaction ID"); | ||
MvxTransaction memory txn = pendingTransactions[txId]; | ||
|
There was a problem hiding this comment.
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
No description provided.