Binding generator for EVM and ink!

Related tags

Cryptography sumi
Overview


Sumi is a binding generator specifically designed for Astar Network ecosystem with XVM in mind. It takes EVM metadata and converts it to an ink! module that can later be used to call into original EVM smart contract.

Please note that Sumi is not a transpiler, it's a binding generator. If you need to convert your existing Solidity smart contract to ink! please use Sol2ink instead.

Why Sumi?

すみ (墨) is a Japanese word meaning solid ink that is used for calligraphy and fine arts. In this project we're dealing with Solididy and ink!, hence the name.

Quick start guide

  1. Install Sumi using cargo install --git https://github.com/0x7CFE/sumi
  2. Use Solidity compiler (or Remix IDE if in doubt) to obtain smart contract metadata:
    solc --pretty-json --abi <input>.sol -o .
    Don't forget to replace <input>.sol with your actual file name.
  3. solc should produce file <input>.abi that will contain ABI in JSON format
  4. Use the ABI file to feed Sumi:
    sumi --input <input>.abi --output binding.rs --module-name <my_module>

Sumi can also work in pipeline mode. By default it will read from stdin and write to stdout which can be handy for shell processing:

cat IERC20_meta.json | jq '.output.abi ' | sumi -m erc20 -e 0x0F | rustfmt > erc20.rs

Command line reference

Usage: sumi [OPTIONS] --module-name <MODULE_NAME>

Options:
  -i, --input <INPUT>              Input filename or stdin if empty
  -o, --output <OUTPUT>            Output filename or stdout if empty
  -m, --module-name <MODULE_NAME>  Ink module name to generate
  -e, --evm-id <EVM_ID>            EVM ID to use in module [default: 0x0F]
  -h, --help                       Print help information

You can always use sumi --help to get the same reference.

Current limitations

Due to XVM v2 limitations currently Sumi processes only:

  • functions (events are ignored)
  • returning a single value (bool) which is currently ignored
  • altering contract state, so no views

Overloaded functions are supported, but their return type is also ignored for now.

You might also like...
Parser and test runner for testing compatable common Ethereum full node tests against Polygon Zero's EVM.

EVM Test Parses and runs compatible common Ethereum tests from ethereum/tests against Polygon Zero's EVM. Note: This repo is currently very early in d

🛠️ Uses zkevm-circuits and anvil mainnetfork to prove that a tx solves an EVM challenge

zk-proof-of-evm-execution This is a PoC developed at hackathon that enables a user to prove that they know some calldata that can solve a challenge on

A tool for quickly collecting function selectors and decoding signatures from on-chain EVM bytecode.
A tool for quickly collecting function selectors and decoding signatures from on-chain EVM bytecode.

Overview | Disclaimer | Tests | Installation | Usage | Examples | Aknowledgements | License Overview Sigmund provides a CLI that allows users to colle

EVM compatible chain with NPoS/PoC consensus

Reef Chain Reef chain is written in Rust. A basic familiarity with Rust tooling is required. To learn more about Reef chain, please refer to Documenta

A temporary repo for ETH connector to be used by EVM

ETH connector for Rainbow bridge Definitions bridgedETH - NEP-141 fungible-token representation of ETH inside Near. nETH - native ETH inside Near EVM.

DFIP 2111-B: VOC: Ethereum Virtual Machine (EVM) Support

DeFiCh/metachain is a codename research & development for DFIP 2111-B: VOC: Ethereum Virtual Machine (EVM) Support . Proposed as a DFIP on Nov 2021; D

Minimalistic EVM-compatible chain indexer.

EVM Indexer Minimalistic EVM-compatible blockchain indexer written in rust. This repository contains a program to index helpful information from any E

Minimalistic EVM-compatible chain indexer.

EVM Indexer Minimalistic EVM-compatible blockchain indexer written in rust. This repository contains a program to index helpful information from any E

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844blobs.

stress4844 Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844 blobs. ca

Releases(v0.1.1)
  • v0.1.1(Dec 13, 2022)

  • v0.1(Dec 7, 2022)

    First prealpha release.

    This release covers everything that was originally planned. But a lot of work is yet to be done, including:

    • code refactoring and organization
    • proper error handling and user facing messages
    • function return types, including overloaded functions
    • reverse transformation, i.e. ink! → EVM
    Source code(tar.gz)
    Source code(zip)
Owner
Dmitry
Dmitry
Substrate NFT !ink smart contract base

Substrate !ink NFT simple implementation This is a simple working version of base NFT smart contract written using latest (as of this date) !ink 3.0.0

POLK4.NET 14 Dec 3, 2022
Webb Protocol implementation in Ink!

Webb Protocol Ink! ??️ Webb Protocol Ink! ⧫ ⚠️ Beta Software ⚠️ Dependencies A prerequisite for compiling smart contracts is to have Rust and Cargo in

webb 4 Aug 5, 2022
Helpers crate to simplify ink! chain extension development

OpenBrush Chain Extension library The library provides tools and primitives to simplify the development of chain extensions for ink! and for the subst

Supercolony 7 Dec 1, 2022
The Ink! smart contract SDK for XVM interface

Ink! XVM SDK The Ink! smart contract SDK for XVM interface. This SDK contains contract wrappers and all middleware code to make XVM development easy.

Astar Network 13 Jan 3, 2023
Example NFT marketplace project using ink! smart contract.

NFT Marketplace project This contract is an example for the NFT marketplace implementation. License Apache 2.0 ??️ How to use - Contracts ?? Build Use

Swanky dApps 8 Jan 18, 2023
De-chained Ready-to-play ink! playground

DRink! Dechained Ready-to-play ink! playground drink.mp4 What is DRink? DRink! aims providing support for ink! developers. It comes in two parts: drin

Cardinal 9 Jun 23, 2023
An attempt to use risc0 with ink!

zink! - risc0 + ink! A demo project prepared for the ParisDot talk ("Zero-Knowledge Proofs using ink!"). The repo contains Substrate node configured w

German 4 Jul 20, 2023
Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Ahmad Abdullahi Adamu 7 Jan 9, 2023
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 16 Nov 29, 2022
An extensible and practical demonstration of constructing evm-based sandwich attacks built with ethers-rs and Huff language.

subway-rs • Construct evm-based sandwich attacks using Rust and Huff. Getting Started subway-rs is a port of libevm's original subway, implemented wit

refcell.eth 230 Apr 25, 2023