{"modulePath":"github.com/Evolution404/simcore","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package compiler\n\nPackage compiler wraps the Solidity and Vyper compiler executables (solc; vyper).\n\nPackage compiler wraps the Solidity and Vyper compiler executables (solc; vyper).\n\nPackage compiler wraps the Solidity and Vyper compiler executables (solc; vyper).\n\n## Functions\n\n```go\nfunc CompileSolidity(solc string, sourcefiles ...string) (map[string]*Contract, error)\n```\nCompileSolidity compiles all given Solidity source files.\n\n```go\nfunc CompileSolidityString(solc, source string) (map[string]*Contract, error)\n```\nCompileSolidityString builds and returns all the contracts contained within a source string.\n\n```go\nfunc CompileVyper(vyper string, sourcefiles ...string) (map[string]*Contract, error)\n```\nCompileVyper compiles all given Vyper source files.\n\n```go\nfunc ParseCombinedJSON(combinedJSON []byte, source string, languageVersion string, compilerVersion string, compilerOptions string) (map[string]*Contract, error)\n```\nParseCombinedJSON takes the direct output of a solc --combined-output run and parses it into a map of string contract name to Contract structs. The provided source, language and compiler version, and compiler options are all passed through into the Contract structs.\n\nThe solc output is expected to contain ABI, source mapping, user docs, and dev docs.\n\nReturns an error if the JSON is malformed or missing data, or if the JSON embedded within the JSON is malformed.\n\n```go\nfunc ParseVyperJSON(combinedJSON []byte, source string, languageVersion string, compilerVersion string, compilerOptions string) (map[string]*Contract, error)\n```\nParseVyperJSON takes the direct output of a vyper --f combined\\_json run and parses it into a map of string contract name to Contract structs. The provided source, language and compiler version, and compiler options are all passed through into the Contract structs.\n\nThe vyper output is expected to contain ABI and source mapping.\n\nReturns an error if the JSON is malformed or missing data, or if the JSON embedded within the JSON is malformed.\n\n## Types\n\n```go\ntype Contract struct {\n\tCode        string            `json:\"code\"`\n\tRuntimeCode string            `json:\"runtime-code\"`\n\tInfo        ContractInfo      `json:\"info\"`\n\tHashes      map[string]string `json:\"hashes\"`\n}\n```\nContract contains information about a compiled contract, alongside its code and runtime code.\n\n```go\ntype ContractInfo struct {\n\tSource          string      `json:\"source\"`\n\tLanguage        string      `json:\"language\"`\n\tLanguageVersion string      `json:\"languageVersion\"`\n\tCompilerVersion string      `json:\"compilerVersion\"`\n\tCompilerOptions string      `json:\"compilerOptions\"`\n\tSrcMap          interface{} `json:\"srcMap\"`\n\tSrcMapRuntime   string      `json:\"srcMapRuntime\"`\n\tAbiDefinition   interface{} `json:\"abiDefinition\"`\n\tUserDoc         interface{} `json:\"userDoc\"`\n\tDeveloperDoc    interface{} `json:\"developerDoc\"`\n\tMetadata        string      `json:\"metadata\"`\n}\n```\nContractInfo contains information about a compiled contract, including access to the ABI definition, source mapping, user and developer docs, and metadata.\n\nDepending on the source, language version, compiler version, and compiler options will provide information about how the contract was compiled.\n\n```go\ntype Solidity struct {\n\tPath, Version, FullVersion string\n\tMajor, Minor, Patch        int\n}\n```\nSolidity contains information about the solidity compiler.\n\n```go\nfunc SolidityVersion(solc string) (*Solidity, error)\n```\nSolidityVersion runs solc and parses its version output.\n\n```go\ntype Vyper struct {\n\tPath, Version, FullVersion string\n\tMajor, Minor, Patch        int\n}\n```\nVyper contains information about the vyper compiler.\n\n```go\nfunc VyperVersion(vyper string) (*Vyper, error)\n```\nVyperVersion runs vyper and parses its version output.\n\n","path":"github.com/Evolution404/simcore/common/compiler","name":"compiler","synopsis":"Package compiler wraps the Solidity and Vyper compiler executables (solc; vyper).","isRedistributable":true}
