Hi there, I'm working on Locals. It's an app that makes interacting with smart contracts easy for GUI users.
What I want to achieve: pay a custom token to a "store" contract, that will create / deploy a new contract.
Currently I'm first doing an approveAndCall in my custom token contract (the users address, the store address) so the store can spend the users tokens.
After the approve and call function, the store contract does the transfer and then deploys the new contract.
I set up an event, so my web3js can listen to the new contract address and fire this in my front end.
This strategy doesnt feel right, as sometimes it works, sometimes it doesnt and it's a hassle to debug this
Can someone advize on wether im using the right strategy / architecture here, or do you guys have a better idea to achieve this?