Skip to content

Conversation

@arhtudormorar
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @arhtudormorar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new isGuarded property into the transaction processing flow, which, when active, automatically increases the gas limit for various batch transactions. This enhancement likely supports specific account types or transaction scenarios that require additional on-chain resources or security measures. Alongside this functional change, several project dependencies have been updated, and new Vue-related packages have been added, potentially laying groundwork for future UI integrations or broader framework support.

Highlights

  • New isGuarded Property: Introduced an isGuarded boolean property to TransactionProps and integrated it across various batch transaction helper functions.
  • Conditional Gas Limit Increase: When isGuarded is true, an additional 50,000 gas is now added to individual transactions within batch, swap-and-lock, and wrap-and-multi-transfer operations.
  • Dependency Updates: Updated several @multiversx/sdk-* packages, debug and @ledgerhq/errors dependencies, and introduced new Vue-related packages like @stencil/vue-output-target.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly introduces the isGuarded property to handle transactions for guarded accounts by increasing the gas limit. The implementation is straightforward and propagated through the necessary functions. I've left a few comments suggesting improvements regarding code clarity and maintainability, such as replacing a magic number with a constant, fixing a typo, and reducing some code repetition. Overall, good work!

Comment on lines 39 to 41
if (isGuarded) {
tokenTransfer.gasLimit = tokenTransfer.gasLimit + BigInt(50_000);
}

Choose a reason for hiding this comment

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

medium

The value 50_000 is a magic number. It would be better to define it as a named constant, for example GAS_LIMIT_ADDITIONAL_FOR_GUARDED_ACCOUNT, in a shared configuration file (e.g., src/config/index.ts). This improves readability and maintainability, as the value is used in multiple places (getSwapAndLockTransactions.ts, getWrapAndMultiTransferTransactions.ts).

For example:

// src/config/constants.ts
export const GAS_LIMIT_ADDITIONAL_FOR_GUARDED_ACCOUNT = 50_000;

// Then in this file:
import { GAS_LIMIT_ADDITIONAL_FOR_GUARDED_ACCOUNT } from 'config/constants';
// ...
if (isGuarded) {
  tokenTransfer.gasLimit += BigInt(GAS_LIMIT_ADDITIONAL_FOR_GUARDED_ACCOUNT);
}

nonce
}: TransactionProps): Transaction[] => {
return [
const transcations = [

Choose a reason for hiding this comment

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

medium

There's a typo in the variable name transcations. It should be transactions. This should be corrected here and in its usages on lines 63 and 68.

Suggested change
const transcations = [
const transactions = [

Comment on lines 72 to 78
if (isGuarded) {
wrapOneEgld.gasLimit = wrapOneEgld.gasLimit + BigInt(50_000);
swapHalfWEgldToUsdc.gasLimit =
swapHalfWEgldToUsdc.gasLimit + BigInt(50_000);
multiTransferOneUsdcHalfWEgld.gasLimit =
multiTransferOneUsdcHalfWEgld.gasLimit + BigInt(50_000);
}

Choose a reason for hiding this comment

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

medium

This block of code is repetitive. You could group the transactions into an array and iterate over them to add the extra gas limit, similar to how it's done in getSwapAndLockTransactions.ts. This would make the code more concise and easier to maintain if more transactions are added in the future.

Also, as mentioned in another comment, the magic number 50_000 should be replaced with a named constant.

Suggested change
if (isGuarded) {
wrapOneEgld.gasLimit = wrapOneEgld.gasLimit + BigInt(50_000);
swapHalfWEgldToUsdc.gasLimit =
swapHalfWEgldToUsdc.gasLimit + BigInt(50_000);
multiTransferOneUsdcHalfWEgld.gasLimit =
multiTransferOneUsdcHalfWEgld.gasLimit + BigInt(50_000);
}
if (isGuarded) {
[wrapOneEgld, swapHalfWEgldToUsdc, multiTransferOneUsdcHalfWEgld].forEach(
(tx) => {
tx.gasLimit += BigInt(50_000);
}
);
}

* Fix typo

* Update
@mgavrila mgavrila merged commit 3f605e5 into main Dec 9, 2025
2 checks 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.

3 participants