yarn
yarn add --dev @defi-wonderland/smock
npm
npm install --save-dev @defi-wonderland/smock
Mocks allow you to manipulate any variable inside of a smart contract. If you'd like to use mocks, you must update your hardhat.config.<js/ts>
file to include the following:
JavaScript
// hardhat.config.js
... // your plugin imports and whatnot go here
module.exports = {
... // your other hardhat settings go here
solidity: {
... // your other Solidity settings go here
compilers: [
...// compiler options
settings: {
outputSelection: {
"*": {
"*": ["storageLayout"]
}
}
}
]
}
}
TypeScript
// hardhat.config.js
... // your plugin imports and whatnot go here
const config = {
... // your other hardhat settings go here
solidity: {
... // your other Solidity settings go here
compilers: [
...// compiler options
settings: {
outputSelection: {
"*": {
"*": ["storageLayout"]
}
}
}
]
}
}
export default config