Skip to content

⛓️🛠️ Extendable wrapper for targeting Solidity compiler (solc) bindings in Go

License

Notifications You must be signed in to change notification settings

alperencantez/gsolc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gsolc

This Go package provides a basic Solidity compiler by leveraging the existing Solidity compiler package in Node.js. It uses the V8 engine bindings from Chromium to run the Node.js compiler within the Go environment.

Table of Contents

Installation

Prerequisites

Ensure you have the following installed:

  • Go (1.19+)

Steps

  1. Clone the repository:

    git clone https://github.com/alperencantez/gsolc.git
    cd gsolc
  2. Build the Go package:

    cd ..
    go build

Usage

Here's a basic example of how to use the package:

package main

import (
    "fmt"
    "log"
    "github.com/alperencantez/gsolc"
)

func main() {
    source := `pragma solidity ^0.8.0; contract HelloWorld { string public message = "Hello, World!"; }`
    compiled, err := gscolc.Compile(source)
    if err != nil {
        log.Fatalf("Compilation error: %v", err)
    }
    fmt.Println("Compiled bytecode:", compiled.Bytecode)
}

Dependencies

This project relies on the following dependencies:

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

⛓️🛠️ Extendable wrapper for targeting Solidity compiler (solc) bindings in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages