Getting Started¶
Installation¶
yarn add --dev @defi-wonderland/smock
npm install --save-dev @defi-wonderland/smock
Required Config for Mocks¶
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:
// 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"]
}
}
}
]
}
}
// 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