0

So far a user can allow a smart contract or any address on Ethereum blockchain to spend their coins by calling the 'approve' function.

If I want to allow address X to spend 250 of my FabulousCoins I can call approve(x,250)

Is there a way for a user to approve an address to spend any type of coins? For example, let's say that I want to allow X to also spend 250 of my NiceCoins, 300 of my FantasticCoins and all of my GymCoins

1

First case: we are discussing about already deployed token. In this case:

  • The allowance is a local property of any token smart contract, not a general property.

  • You have to give the allowance to each user for each token.

  • the maximum here is to have a script or a dedicated contract which does it for you.

Second case: we are discussing about your new tokens that you are developing. In this case:

  • you can do what you want provided you write the code that realize that. If you have somewhere a multitoken ‘approve’ valid for all the token you are going to deploy, it can work.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.