This repository has been archived by the owner on Oct 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
EVM JIT Binary Interface
Edward Ruchevits edited this page Sep 30, 2015
·
6 revisions
#include <stdint.h>
// JIT object opaque type
typedef struct evm_jit evm_jit;
// Contract execution return code
typedef int evm_jit_return_code;
// Host-endian 256-bit integer type
typedef struct i256 i256;
// Big-endian right aligned 256-bit hash
typedef struct h256 h256;
// Runtime data struct - must be provided by external language (Go, C++, Python)
typedef struct evm_jit_rt evm_jit_rt;
// Runtime callback functions - implementations must be provided by external language (Go, C++, Python)
void evm_jit_rt_sload(evm_jit_rt* _rt, i256* _index, i256* _ret);
void evm_jit_rt_sstore(evm_jit_rt* _rt, i256* _index, i256* _value);
void evm_jit_rt_balance(evm_jit_rt* _rt, h256* _address, i256* _ret);
// And so on...
evm_jit* evm_jit_create(evm_jit_rt* _runtime_data);
evm_jit_return_code evm_jit_execute(evm_jit* _jit);
void evm_jit_get_return_data(evm_jit* _jit, char* _return_data_offset, size_t* _return_data_size);
void evm_jit_destroy(evm_jit* _jit);
Informs user about contract exit status:
Code | Exit Status |
---|---|
0 | Stop |
1 | Return |
2 | Suicide |
101 | Bad Jump Destination |
102 | Out Of Gas |
103 | Stack Underflow |
104 | Bad Instruction |
A set of data possibly needed by running contract, sometimes by the compiler itself. Can be called ExtVM data in C++, VMEnv data in Go.
Name | Type | Access | Description |
---|---|---|---|
Gas | i256 | inout | Gas counter. |
Address | h256 | in | Account address. |
Caller | h256 | in | |
Origin | h256 | in | |
CallValue | i256 | in | |
CallDataSize | i256 | in | |
GasPrice | i256 | in | |
PrevHash | i256 | in | |
CoinBase | h256 | in | |
TimeStamp | i256 | in | |
Number | i256 | in | |
Difficulty | i256 | in | |
GasLimit | i256 | in | |
CodeSize | i256 | const | |
CallData | byte* | in | |
Code | byte* | const |
- Ðapp Developer Resources
- JavaScript API
- JSON RPC API
- Solidity
- Solidity Features
- Useful Ðapp Patterns
- Standardized Contract APIs
- Ðapp using Meteor
- Ethereum development tutorial
- Mix Tutorial
- Mix Features
- Serpent
- LLL
- Mutan
- Morden Testnet
- Chain Spec Format
- Inter-exchange Client Address Protocol
- URL Hint Protocol
- NatSpec Determination
- Network Status
- Raspberry Pi
- Exchange Integration
- Mining
- Licensing
- Consortium Chain Development
- RLP Encoding
- RLPx Node Discovery Protocol
- ÐΞVp2p Wire Protocol
- ÐΞVp2p Whitepaper (WiP)
- Web3 Secret Storage
- Patricia Tree
- Wire protocol
- Light client protocol
- Subtleties
- Solidity, Docs & ABI
- NatSpec Format
- Contract ABI
- Bad Block Reporting
- Bad Chain Canary
- Extra Data
- Brain Wallet