Skip to content

Latest commit

 

History

History
90 lines (63 loc) · 1.84 KB

getting-started.rst

File metadata and controls

90 lines (63 loc) · 1.84 KB

Getting Started

Installation

yarn

yarn add --dev @defi-wonderland/smock

npm

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:

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

Optional config to use Smock Matchers