1

I am trying to find out how to allow multiple transactions on ethereum block chain by simply approving once on meta mask.

My use case is to make a portfolio management system.

for example consider:

token ------------ before ---- after

eth         10$      20$
usdt        20$      10$
btc         20$      50$
old_coin    50$       0$
new_coin     0$      20$

result ============> |after-before== |result

------------------------------------
eth               |20-10        |+10 (buy)
usdt              |10-20        |-10 (sell)
btc               |50-20        |+30 (buy)
old_coin          |00-50        |-50 (sell)
new_coin          |20-00        |+20 (buy)

Now i want to send all this transactions:

buy eth worth 10$,

sell usdt worth 10$,

buy btc worth 30$,

sell old_coin worth 50$,

buy new_coin worth 50$.

If any one can help me please let me know,

Thank You for your time...

1 Answers1

1

First, you need to write your smart contract into one function call you mentioned above and deploy it. Then approve all tokens for max allowance (or upper limit) that you will be using to your smart contract address. Finally, call your smart contract function (you can do it thru REMIX IDE after you successfully deployed)

8nite
  • 26
  • 1