Skip to content

Conversation

olga24912
Copy link

No description provided.


let post_actions = self.check_deposit_msg(deposit_msg, mint_amount);
let post_actions =
self.check_deposit_msg(deposit_msg, mint_amount, pending_utxo_info.tx_id.clone());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure that the tx_id is unique?
As I see it is possible to verify_deposit with different vout for same transaction

Copy link
Author

Choose a reason for hiding this comment

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

fixed: 3293a0e

let mut total_gas = 0;
let mut total_amount = 0;
for (index, post_action) in post_actions.iter().enumerate() {
for (index, post_action) in post_actions.iter_mut().enumerate() {
Copy link
Collaborator

@karim-en karim-en Sep 11, 2025

Choose a reason for hiding this comment

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

Suggested change
for (index, post_action) in post_actions.iter_mut().enumerate() {
for (index, post_action) in post_actions.iter_mut().enumerate() {
post_action.msg = post_action.msg.replace("{{UTXO_TX_ID}}", utxo_storage_key);

I think the changes can be done with less code.

Copy link
Author

Choose a reason for hiding this comment

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

In general, we can do it this way, it’s really the simplest option. In that case, the replacement will always happen regardless of what is specified in the templates.

I also thought about adding a special template like 'add UTXO', and if such a template exists, then perform the replacement.

Copy link
Author

Choose a reason for hiding this comment

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

I think about something like that:
3145bfa

I’d like to isolate the contracts to which the changes are applied.

In this option, the code is simpler. However, the logic becomes stranger. Templates stop being templates and turn into modifiers.

The first option sounds more logical in the context of templates.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also thought that it is important to add additional restrictions, but after thinking more on it, I think we can make things simple and just do replace.
There is a low chance to get collision with this naming.

@olga24912 olga24912 requested a review from karim-en September 11, 2025 21:38
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