Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubt about login from contract owner #1

Open
damianlluch opened this issue Jun 20, 2022 · 1 comment
Open

Doubt about login from contract owner #1

damianlluch opened this issue Jun 20, 2022 · 1 comment

Comments

@damianlluch
Copy link

Hi, I've been looking at your code.
I ask you a question.
How would you make a general frontend where both the owner of the lottery contract and the buyers can access?
And only show a getWinner button for the owner?
I am using ethers.js
and I'm not sure how to do it.

Thanks

@Hugo0
Copy link

Hugo0 commented Aug 28, 2022

@damianlluch not sure if you still have this problem, but you could setup the frontend so that if connectedWallet == ownerWallet, then you show getWinner button or whatever.

Obvious security concerns if you're just doing this on the frontend, you have to make sure that it's just visual and that whatever actions owner takes have to be validated by backend (either blockchain or ur server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants