Module ethers_solc::utils[][src]

Expand description

Utility functions

Statics

A regex that matches the import path and identifier of a solidity import statement with the named groups “path”, “id”.

A regex that matches the version part of a solidity pragma as follows: pragma solidity ^0.5.2; => ^0.5.2 statement with the named groups “path”, “id”.

Functions

Finds the common ancestor of both paths

Find the common ancestor, if any, between the given paths

Returns all path parts from any solidity import statement in a string, import "./contracts/Contract.sol"; -> "./contracts/Contract.sol".

Returns the solidity version pragma from the given input: pragma solidity ^0.5.2; => ^0.5.2

Reads the list of Solc versions that have been installed in the machine. The version list is sorted in ascending order. Checks for installed solc versions under the given path as <root>/<major.minor.path>, (e.g.: ~/.svm/0.8.10) and returns them sorted in ascending order

Attempts to determine if the given source is a local, relative import

Returns the 36 char (deprecated) fully qualified name placeholder

Returns the library placeholder for the given name The placeholder is a 34 character prefix of the hex encoding of the keccak256 hash of the fully qualified library name.

Returns the library hash placeholder as $hex(library_hash(name))$

Returns the path to the library if the source path is in fact determined to be a library path, and it exists. Note: this does not handle relative imports or remappings.

Returns a list of absolute paths to all the solidity files under the root

Returns the source name for the given source path, the ancestors of the root path /Users/project/sources/contract.sol -> sources/contracts.sol