Skip to content
Kotlin Ethereum ABI code bindings
Kotlin
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ci
gradle/wrapper
src
LICENSE
README.md
build.gradle.kts
gradlew
gradlew.bat

README.md

What is it?

This is a gradle plugin to generate Kotlin bindings for Ethereum contracts.

How to use it?

To use it you must have kethabi in your buildscript classpath:

buildscript {
    repositories {
        maven("https://jitpack.io")
    }

    dependencies {
        classpath("com.github.komputing:kethabi:<INSERT CURRENT KETHABI VERSION>")
    }
}

And then apply the plugin:

plugins {
    id("kethabi")
}

Now kethabi will look into the src/main/abi folder for *.abi files (optionally accompanied by a *.config file). It will then generate code based on these abi files. If the abi file starts with an underscore (_) the classes will be marked as internal. The filename will determine the classname (if not changed via the config file). The package name will be generated from the path the abi file is in. E.g. if the file is in src/main/abi/org/foo/contracts then the package name will be org.foo.contracts.

It will generate 3 classes:

  • transaction generator
  • a class that uses RPC to be able directly call functions of the contract
  • transaction detector to check if a given transaction is a function call for the given contract function

Under the hood

It uses the KEthereum module abi_codegen which itself uses KotlinPoet to generate the code.

Example usages

You can’t perform that action at this time.