hey @cryptokid. Sorry for taking so long to reply i was out for the whole day. Ok so i will break down exactly what im thinking so that you can understand better.
So as i was saying i have developed a multisig wallet that allows the owners to deposit, withdraw and transfer ethereum and other ERC20 tokens. And for transfers or withdrawals to get accepted a majority consensus between all of the wallet owners must be achieved in order for the transaction to be executed.
This is a ll fine. However i have now finished the development of my wallet and everything looks and work brialliantly. However i am now faced with an issue i had no even throught about when initially builiding the app out. There is currently only contract instance that gets deployed to the network (be it a local dev chain or to testnet etc). This means that the wallet owners can of open the dapp on their won browser and view the wallet and use it. However there is nothing from stopping another user who is NOT a wallet owner from opening the app on their own browser either. Although my Dapp will realise that they are not an owner, preventing them from being able to use the wallet, they will still be able to see the account which belongs to other people.
So what i am planning to do is to develop my own login system. The root of this login in system will be to modify my multisig smart contract to be a factory contract. In other words my main multisig contract will act as a child contract and below it i will write a new factory contract. I will then deploy this factory contract instead. The main functionality of the factory contract is that when deployed i will be able to call a function called
function createNewMultiSigWallet() public .......
for example that will create a new instance of my multisig contract and append it to an on-chain storage array. This method of deploying contract instance is used widely in the defi spaces one example being uniswap which uses a factory contract to make new liquidity pools anytime some user wants to create one. So this is great i now have a way for users to open my wallet user interface or dapp and create new wallet instances which they will be the owner of and then they can add other signaories as needed.
The problem is that i need a way to keep track of my user data. For example if a user logs on how can my dapp figure out if that user has previously created any wallets and if so how can my dapp fetch this data and display to the user all of their wallets (which are the contratc instances that they were the deployer of.)
This challenge has led me down two routes. The first is to set up a mongoDB database in which i can append user data to everytime a new user deploys a new contract instance using the factory contarct. This would work where i would store the contract address in the mondoDB and link that contractb instance to both the user who deployed it and other wallet owners of that instance. Thus when the owneer initially logs on to the Dapp i can simply use their address and query the database to see if that address maps to a contract instance. If it does i will return all instances so that the user can load it in using
var contractInstance = await new web3.eth.Contract(abi, contractInstanceChoosenByUser)
The only problem is it will most likley take me a week or more of constant coding to set up the mongo DB and link it to my front end. Mostly because i have only used mongoDB once before for an application that a blockhain Dapp thus i would have to also spend time increasing my knowledge. I do not mind this and at some later stage i will definitely return to this project and implement a mongoDB as i think it would add an extra level of complexity to my Dapp
So the other alternative i was pondering was to use Moralis. Although i have never used it before i have been watching lots of vides and i constantly watch ivans interviews on the channel as i am very interested in the tech. The main reason i have never used it before is because i prefer building this from scracth as it is more rewarding rather than one liners. Howeevr i do now want to use it (if possible to solve the issue i am describing above). That is why i have come to this forum to ask would it be possible to implement this.
Basically as i was saying in my post above, i know that you can use moralis to authenticate users and append all logged users to a users DB. However keeping track of users is not enough for me as i need an extra layer of checking that is able to map a user to a contratc instance. So is there a way for me to keep track of what address deployed what contracts using moralis. Because if there is i could finish my dapp in a few hours rather than having to spend ages inegrating a mongoDB.
I hope now i have made it a little clearer about exactly what i am after. Again i am only seeking general guidance and validation that this is possible using moraliis to save me starting to use the tech and then to realise after a few hours that what i want to achieve is able to be done. The rest i can handle myself. I want to appreciate you for atking the time to read my post. Thank you
Regards,
Evam