Solc

Source Solc

Smart contracts solc representation. Is used to handle and sort the compiled SmartContracts compiled object.


constructor

new Solc(SmartContracts);

Constructor of the Solc. Takes unformatted SmartContracts.

Parameters

  1. SmartContracts - any: compiled SmartContracts object.

Returns

Solc: Smart contracts export of the smart contracts project.

Example

const solc = new Solc({
  "AbstractDescribed": {
    "interface": "[...]"
  },
  "AbstractENS": {
    "interface": "[...]"
  },
  ...
});

Usage: Solc


getContracts

solc.getContracts();

Takes the unformatted contracts from the constructor and format the object contract keys AbstractENS.sol => AbstractENS

Returns

any: Formatted Smart Contracts objects with shorted key names.

Example

solc.getContracts();
// {
//   "AbstractDescribed": {
//     "interface": "[...]"
//   },
//   "AbstractENS": {
//     "interface": "[...]"
//   },
//   ...
// }