Automate processUnwrapsForAccount

Hello team!

I am looking for a way to automate processUnwrapsForAccount for all shipments.

Is there any way? If not, what is the problem, why can't it be done?

Thank you!

This was a functional requirement to use account-based deposits during unwraps - since not all ethereum wallets support adding a message to a transaction. So, to start the unwraps automatically, the Ardor contract must continuously monitor the Ethereum blockchain for transfer of ERC-1155 tokens (which by itself is not an easy task), and out of all such transfers to select only the transfers to deposit addresses. With the current mechanism for generating deposit addresses we cannot know which addresses are for deposit and which are not.

Of course you can program your UI to automatically call processUnwrapsForAccount with the Ardor-side public key, which you know because it is provided to you by the user when the user initiates the unwrap.

It seems like a good solution but... this could overload my Infura node?

I make the request to the node... but the node makes the request to Infura, right?

I could quickly reach the limit.
Confirm me if this is the case.

Could the process be modified to automate it without making continuous requests?

Yes, every time you call that API a request is made to Infura or whichever Ethereum full node you use.

I don't think the Ethereum request can be changed with something else. Of course I can hide from you the loop which makes that request regularly, but prefer not to do that.

The aim is for users to receive their assets automatically without having to press a button.

  • If I automate it and make recurring queries, the node can become saturated.
  • If I do it manually (with a button) many users forget to click and the asset never arrives. This is our current system and it is giving us a lot of headaches.

Is there any way to solve this?

Maybe automate it with recurring queries but with significant delay like 30 seconds. And allow the user to click the button if she is in a hurry.

Sounds good. I will try to implement it to see if the node is overloaded. We have limited requests.

Wouldn't it be better to handle the unwrap with the events in the smart contract.

I have noticed that there is currently none. I think it could be a nice option to solve the problem.

I have advanced knowledge about Solidity, if you need I can prepare this part.

I'm not good with Solidity, so almost certainly there is a better way to do this. Sure, feel free to create a pull request to Bitbucket, which uses events. Frankly I didn't know about such feature.

Sorry, now I remembered what are the solidity events and I do use them even though I inherit them from the openzeppelin contract. I use them on several places to filter the ethereum transactions. I think I remember that the Ethereum node can notify the client software (which is the Ardor contract in our case) when some event appears but this was unfeasible for some reason, which I don't remember

I am trying to learn how to modify your code in Java. When I feel confident, I will do it. I'm sure I will.

Please check: Bridge | Parameters when deploying

I need to establish some knowledge first.

I can study it for you, no problem.
We are interested in automating the bridge.