Hi all, I really need your help. I have an admin account on which the contract is deployed. It also stores the NFTMinter Resource in its storage. However, I want to borrow this minting capability for all other users i.e. the AuthAccounts who are signing the transaction, so that everyone is allowed to mint a token and not just admin.
In the contract, I have added the below code inside the init method :
self.account.link<&NFTMinter>(/public/NFTMinter, target: /storage/NFTMinter)
my init method of the contract now looks like :
init() {
self.account.save(<-self.createEmptyCollection(), to: /storage/NFTCollection)
self.account.link<&{NFTReceiver}>(/public/NFTReceiver, target: /storage/NFTCollection)
self.account.save(<-create NFTMinter(), to: /storage/NFTMinter)
self.account.link<&NFTMinter>(/public/NFTMinter, target: /storage/NFTMinter)
}
but still when I try to sign the transaction from another user, it throws this error :
Error
panic: could not borrow minter reference.
How can I resolve this issue? I have referred
admin account is 0x02.
@flowjosh , @qvvg , @dh77 any help would be really appreciated. Thanks in advance.