Skip to main content
10 events
when toggle format what by license comment
Mar 22, 2022 at 10:51 comment added Invest Data Systems FR @Sky Ok I see. So once more, this has to be coded first. But okay I see. That would have been for any smart contract :) But that is not possible without something coded first (or by bruteforcing/having the private key of the address to which to contract is deployed...).
Mar 22, 2022 at 10:47 comment added Sky @InvestDataSystemsFR Yes, there is a way, but only if your Initial contract has a function that can call another contract (And you can set the address for that other contract). The way I showed in the code above. But I would have to see the code of your contract to know more.
Mar 22, 2022 at 10:10 comment added Invest Data Systems FR @Sky So do you mean that there is a way only from another contract ??
Mar 22, 2022 at 10:09 comment added Invest Data Systems FR @PatriceTisserand Thank you but I wanted to know if there were a way without an existing function. But yes you are right.
Mar 21, 2022 at 12:22 comment added Patrice Tisserand As far as I know, there is no way from a smart contract to know which ERC20 token have been received: you need to manage it offchain. To transfer tokens received by your smart contract, you can add a function calling ER20.approve which allow you to call ER20.transferFrom(your_contract, user, amount)
Mar 21, 2022 at 11:57 history edited Sky CC BY-SA 4.0
added 879 characters in body
Mar 21, 2022 at 11:51 comment added Sky Does your contract happen by any chance to have a function that calls another contract? It would help if I had the code of the smart-contract in question. Because there might be some workaround solutions (I can't promise anything, but it wouldn't hurt to have a look)
Mar 21, 2022 at 10:43 comment added Invest Data Systems FR Ok thank you. What you wrote is exactly what I think. I will try to find if there is a way to retrieve all tokens and all funds that are not tokens, from the smart contract, through a dedicated function.
Mar 21, 2022 at 10:42 vote accept Invest Data Systems FR
Mar 21, 2022 at 10:33 history answered Sky CC BY-SA 4.0