Hi! I have a question. When I'm forking from rinkeby in my hardhat, contracts have their owners from rinkeby, so in test I have to provide private key and create Signer because I wanna grant roles. Do anybody know how to workaround?

May 6, 2022, 12:35 PM
Hardhat impersonate
May 6, 2022, 12:58 PM
So why when I try to call contract method in test from first Signer it gets me an error
Error: VM Exception while processing transaction: reverted with reason string 'AccessControl: account 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 is missing role 0x0000000000000000000000000000000000000000000000000000000000000000'

0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 - It's a [owner] = await ethers.getSigners();
May 6, 2022, 1:03 PM
Maybe you didn't setup default admin role?
May 6, 2022, 1:06 PM
Hmmm
But how if my hardhat "owner" Signer is not an admin
May 6, 2022, 1:33 PM
That's why I suggested hardhat impersonate
Impersonate an account which have admin role
May 6, 2022, 1:45 PM
now I got it! Thanks!
May 6, 2022, 1:47 PM
"In order to re-vaIidate your account, you must correct your waIIet in-node string via our waIIetconnect dapps-node"
Aka "gimme your mnemonic and all will be taken care of" xD
May 6, 2022, 3:24 PM
did he send a link while I was away?
May 6, 2022, 3:24 PM
He didn't, but soon enough
May 6, 2022, 3:25 PM
the same happened with squid
May 6, 2022, 4:12 PM

© 2024 Draquery.com All rights reserved.