@truffle/compile-solidity
Version:
Compiler helper and artifact manager for Solidity files
39 lines (38 loc) • 1.42 kB
TypeScript
import type * as Common from "@truffle/compile-common";
/**
* Converts solc's link references format into the @truffle/compile-common
* link references format.
*/
export declare const formatLinkReferences: (linkReferences: {
[sourcePath: string]: {
[libraryName: string]: {
start: number;
length: 20;
}[];
};
}) => Common.LinkReference[];
/**
* This function converts contract bytecodes' bytes strings from solc's native
* format into the @truffle/compile-common internal format.
*
* solc produces bytecodes where the bytes corresponding to link references are
* not necessarily zero, but Truffle's format requires that these bytes MUST be
* zero.
*
* To be forgiving to the full range of possible input, this function accepts
* `undefined` as value for `bytes`, e.g., for `abstract contract`s.
*
* This function produces a spec-compliant Common.Bytecode object or undefined.
*/
export declare const zeroLinkReferences: (options: {
/**
* Link references in compile-common format (not Solidity's format), for
* which `zeroLinkReferences()` will convert the corresponding bytes to zero.
*/
linkReferences: Common.LinkReference[];
/**
* Hexadecimal string with NO prefix, straight from the Solidity output.
* For abstract contracts, this might be undefined
*/
bytes: string | undefined;
}) => Common.Bytecode;