zeriontech / Web3Swift

Ethereum Web3 library implementation for Swift
https://web3swift.io
Apache License 2.0
107 stars 32 forks source link

5. Implement contracts abi abstraction and contract compilation (solc) #32

Open rockfridrich opened 6 years ago

rockfridrich commented 6 years ago
  1. Implement abi functions and events parsing
  2. Implement function construction and deceralisation
  3. Implement solc compiler (https://github.com/ethereum/solidity)
  4. Implement extraction of compiler meta data
0crat commented 6 years ago

@biboran/z please, pay attention to this issue

abdulowork commented 6 years ago

@rockfridrich could you elaborate on what does this mean?

The data of a variable or array element is not interleaved with other data and it is relocatable, i.e. it only uses relative “addresses”

abdulowork commented 6 years ago

For future reference: structs are encoded as tuples. update: this is not currently possible.

abdulowork commented 6 years ago

enum is not a part of ABI as of now and is converted to the minimally needed capacity uint

abdulowork commented 6 years ago

@bashalex specification on tuple (X) encoding says:

enc(X) = head(X(1)) ... head(X(k-1)) tail(X(0)) ... tail(X(k-1))

There is tail(X(0)) but there is no head(X(0)). Where does the head(X(0)) go? Should you drop it or is it just a typo in the specification?

abdulowork commented 6 years ago

@bashalex there is a similar issue with specification on variable-length array vs fixed-length array.

For fixed-length it is:

enc(X) = enc((X[0], ..., X[k-1]))

and for variable-length it is:

enc(X) = enc(k) enc([X[1], ..., X[k]])

is it supposed to be X[1] to X[k]?

abdulowork commented 6 years ago

As of now the following constraints also apply:

  1. Structures cannot be an external dependency
  2. There is no such type as tuple of tuples.