Skip to content

Migration Guide

aion-jin edited this page Feb 2, 2018 · 2 revisions

Introduction

Aion (phase 1, as described in the white paper) provides source level compatibility for solidity contracts. You can migrate your Ethereum dapps to Aion's platform, with little or no efforts.

Before getting started, we assume that you have working knowledge of solidity language and knows how to use solidity compiler. If not, you can learn it from the Solidity Documentation v4.15.

Solidity changes

The most important change is that the basic computation unit, a.k.a. data word, is 128 bits rather than 256 bits. Therefore, you shouldn't use uint to carry 32 bytes of binary data; instead, you need to use bytes32 for this purpose.

Also, you need to use the aion official solidity compiler. It's currently the only compiler that targets Aion Fast VM.

Other changes include:

  1. Inline assembly and uint136 - uint256 are no longer supported;
  2. Aion address are represented in 32 bytes rather than 20 bytes.

ABI changes

You need to use the aion official web3 API or Java API library, because the ABI encoding has been updated to align with the VM changes. For example, integer array [1,2] is encoded as:

00000000000000000000000000000002
00000000000000000000000000000001
00000000000000000000000000000002
(Aion Fast VM)

0x0000000000000000000000000000000000000000000000000000000000000002
0x0000000000000000000000000000000000000000000000000000000000000001
0x0000000000000000000000000000000000000000000000000000000000000002
(Ethereum Virtual Machine)
Clone this wiki locally