Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define ABI #1

Open
axic opened this issue Mar 8, 2016 · 4 comments
Open

Define ABI #1

axic opened this issue Mar 8, 2016 · 4 comments

Comments

@axic
Copy link
Member

axic commented Mar 8, 2016

The word ABI is overused in ethereum and I think there are several levels to it. Not all of them are properly documented:

  • the way contracts pass data between themselves (was depending on the language, now it seems to be converging), this includes precompiled contracts
  • the way external inputs are entered to the contract (both during calls and creation) - it is defined in the Contract ABI
  • the way storage is used (specific to the language)

Since eWASM changes the word size from 256 bit to at most 64 bit, it is important to state whether it will follow the same ABI for contract data passing or define a new one, more appropriate to its word size.

@chfast
Copy link
Collaborator

chfast commented Mar 8, 2016

Why not fixing word size with 64-bit?

@axic
Copy link
Member Author

axic commented Mar 8, 2016

For case 2) it is a question of compatibility - does it want to be compatible with the current Contract ABI (and therefore web3.js and client apps).

For the other cases it is only about actually writing a specification down as we don't have any even for EVM1 on that matter.

See also #2

@axic
Copy link
Member Author

axic commented Apr 14, 2016

Can WASM code export multiple methods?

Each of the ABI signatures could be an exported method and this removes the need of writing a dispatcher as we have in current EVM/Solidity.

Example set of ABI methods:

5c19a95c delegate(address)
9e7b8d61 giveRightToVote(address)
b3f98adc vote(uint8)
609ff1bd winningProposal()

would become:

(func $5c19a95c (param ...
(func $9e7b8d61 (param ...

Update: well, I guess it really has to stay within a dispatcher given this is part of the calldata. Well at least proper methods can be defined in WASM.

@wanderer
Copy link
Member

one problem with that @axic is that funcs in wasm can only return a single parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants