Web3Swift icon indicating copy to clipboard operation
Web3Swift copied to clipboard

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

Open rockfridrich opened this issue 7 years ago • 7 comments

  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

rockfridrich avatar Feb 19 '18 19:02 rockfridrich

@biboran/z please, pay attention to this issue

0crat avatar Feb 19 '18 19:02 0crat

@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 avatar Mar 21 '18 16:03 abdulowork

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

abdulowork avatar Mar 22 '18 15:03 abdulowork

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

abdulowork avatar Mar 22 '18 15:03 abdulowork

@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 avatar Mar 22 '18 15:03 abdulowork

@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 avatar Mar 22 '18 16:03 abdulowork

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.

abdulowork avatar Mar 26 '18 13:03 abdulowork