Timeline for How to create withdraw token requests on my custom token sale dashboard
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 15, 2018 at 18:30 | comment | added | Shawn Tabrizi |
You need to move that data from your database onto the blockchain. Your back-end code should have access to the "token wallet" address 0x1B8878c01eb3B89B17400b2AD06DEd37C0bF44F3 , and you need to call approve(address spender, uint tokens) using that address so that each customer address will be allowed to "withdraw" the tokens. Then on the front-end, you use Web3.js to call transferFrom(address from, address to, uint tokens) to allow the user to then withdraw the amount you allocated for them.
|
|
Aug 15, 2018 at 18:17 | comment | added | Berk | ropsten.etherscan.io/address/… I have the data "which user has how many tokens in his budget" on my database. | |
Aug 15, 2018 at 18:15 | comment | added | Shawn Tabrizi | But how are you tracking that user has "1000 XTokens". Is that stored in your smart contract? can you share your smart contract code? | |
Aug 15, 2018 at 18:14 | comment | added | Berk | Something like altcoin exchange. User have 1000 Xtokens in his balance. And he wants to transfer money to his personal wallet.. (I added a picture to question) | |
Aug 15, 2018 at 18:05 | comment | added | Shawn Tabrizi | You want something user initiated using JavaScript + Metamask? | |
Aug 15, 2018 at 17:55 | comment | added | Berk | Thank you! I can transfer tokens between wallets via Matemask or myetherwallet but my question is how to execute transfer(address to, uint tokens) function from my dashboard. | |
Aug 15, 2018 at 17:52 | history | answered | Shawn Tabrizi | CC BY-SA 4.0 |