Hello guys! can anyone explain to me how to declare contract owner’s wallet address in the Nft contract to transfer commission cut from a purchase..trying to develop a demo nftmarketplace :)

Nov 19, 2021, 7:17 PM
Create state variable and initialize in contract constructor during deploy from msg.sender field)
Nov 19, 2021, 7:18 PM
Thank you andrey.. Isn’t the msg.sender the one interact with the market.. how can i get the contract owners address from that??
Nov 19, 2021, 8:26 PM
there is a standartized contract for managing contract ownership - Ownable
https://docs.openzeppelin.com/contracts/2.x/access-control
Nov 19, 2021, 8:28 PM
Only contract owner deploy contract and constructor is working only during contract creation.
It means that your code will take address of person who will deploy contract = contract owner
Nov 19, 2021, 8:28 PM
Ohh i see thank you 🙏🏻
Nov 19, 2021, 8:33 PM
I was glad to help you with your problem :)
Nov 19, 2021, 8:34 PM
Thank you😊
Nov 19, 2021, 8:35 PM

© 2024 Draquery.com All rights reserved.