0

This is my code:

import {web3} from "hardhat"


const OWNER_ROLE = web3.utils.keccak256("OWNER_ROLE");

This is the error in my terminal:

const OWNER_ROLE = web3.utils.keccak256("OWNER_ROLE");
                        ^
TypeError: Cannot read property 'utils' of undefined

1 Answer 1

0

Are you sure that you are importing from the correct library?

I think it should be this instead:

import web3 from "web3"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.