Skip to content
/ zink Public

Rustic programming language that targets the Ethereum Virtual Machine

License

Notifications You must be signed in to change notification settings

zink-lang/zink

Repository files navigation

The Zink Project

Caution

This project is still under active development, plz DO NOT use it in production.

zink ci telegram

The Zink project mainly provides a singlepass compiler zinkc which compiles WASM to EVM bytecode, the source code of your smart contracts could be any language you like!

flowchart LR
    R{{Rust}} --> W(WebAssembly)
    O[...] --> W
    W --> Z{Zink Compiler}
    Z --> V[(EVM)]
Loading

Here we highly recommend you to choose rust as the language of your smart contracts which will unlock all of the following features:

  • Safe: rustc is watching you! Furthermore, after compiling your rust code to WASM, zinkc will precompute all of the stack and memory usage in your contracts to ensure they are safe in EVM bytecode as well!

  • High Performance: The optimizations are provided by the three of rustc, wasm-opt and zinkc, your contracts will have the smallest size with strong performance in EVM bytecode at the end!

  • Compatible: All of the no_std libraries in rust are your libraries, you can use your solidity contracts as part of your zink contracts and your zink contracts as part of your solidity contracts :)

  • Easy Debugging: Developing your smart contracts with only one programming language! zink will provide everything you need for developing your contracts officially based on the stable projects in rust like the foundry tools.

Run cargo install zinkup to install the toolchain!

Fibonacci Example

fib(n) Zink [email protected]
0 110 614
1 110 614
2 262 1322
3 414 2030
4 718 3446
5 1174 5570
/// Calculates the nth fibonacci number using recursion.
#[no_mangle]
pub extern "C" fn recursion(n: usize) -> usize {
    if n < 2 {
        n
    } else {
        recursion(n - 1) + recursion(n - 2)
    }
}

As an example for the benchmark, calculating fibonacci sequence with recursion, missed vyper because it doesn't support recursion...Zink is 5x fast on this, but it is mainly caused by our current implementation is not completed yet ( missing logic to adapt to more situations ), let's stay tuned for v0.3.0.

Donation

After completing the ERC20 implementation, Zink will focus on MEV logic since everything could be even more compact and realistic from this dark forest.

Zink is now moving forward without any grants or backups, if you like this dreaming project, please feel free to reach out, would be appreciated for any opportunities ^ ^

  • ETH: 0xf0306047Fa598fe95502f466aeb49b68dd94365B
  • SOL: AZGXAerErfwVzJkiSR8moVPZxe1nEhvjdkvxQ7qR6Yst

LICENSE

GPL-3.0-only