2021-01-07 21:45:32 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package ethermint.evm.v1alpha1;
|
|
|
|
|
|
|
|
import "gogoproto/gogo.proto";
|
|
|
|
|
|
|
|
option go_package = "github.com/cosmos/ethermint/x/evm/types";
|
|
|
|
|
|
|
|
// Params defines the EVM module parameters
|
|
|
|
message Params {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
|
|
|
|
// evm_denom represents the token denomination used to run the EVM state
|
|
|
|
// transitions.
|
2021-04-19 07:10:57 +00:00
|
|
|
string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""];
|
2021-01-07 21:45:32 +00:00
|
|
|
// enable_create toggles state transitions that use the vm.Create function
|
2021-04-19 07:10:57 +00:00
|
|
|
bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""];
|
2021-01-07 21:45:32 +00:00
|
|
|
// enable_call toggles state transitions that use the vm.Call function
|
2021-04-19 07:10:57 +00:00
|
|
|
bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""];
|
2021-01-07 21:45:32 +00:00
|
|
|
// extra_eips defines the additional EIPs for the vm.Config
|
2021-04-19 07:10:57 +00:00
|
|
|
repeated int64 extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.moretags) = "yaml:\"extra_eips\""];
|
2021-01-07 21:45:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ChainConfig defines the Ethereum ChainConfig parameters using sdk.Int values
|
|
|
|
// instead of big.Int.
|
|
|
|
//
|
|
|
|
// NOTE 1: Since empty/uninitialized Ints (i.e with a nil big.Int value) are
|
|
|
|
// parsed to zero, we need to manually specify that negative Int values will be
|
|
|
|
// considered as nil. See getBlockValue for reference.
|
|
|
|
//
|
|
|
|
// NOTE 2: This type is not a configurable Param since the SDK does not allow
|
|
|
|
// for validation against a previous stored parameter values or the current
|
|
|
|
// block height (retrieved from context). If you want to update the config
|
|
|
|
// values, use an software upgrade procedure.
|
|
|
|
message ChainConfig {
|
|
|
|
// Homestead switch block (< 0 no fork, 0 = already homestead)
|
|
|
|
string homestead_block = 1 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"homestead_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// TheDAO hard-fork switch block (< 0 no fork)
|
|
|
|
string dao_fork_block = 2 [
|
|
|
|
(gogoproto.customname) = "DAOForkBlock",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"dao_fork_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// Whether the nodes supports or opposes the DAO hard-fork
|
2021-04-19 07:10:57 +00:00
|
|
|
bool dao_fork_support = 3
|
|
|
|
[(gogoproto.customname) = "DAOForkSupport", (gogoproto.moretags) = "yaml:\"dao_fork_support\""];
|
2021-01-07 21:45:32 +00:00
|
|
|
// EIP150 implements the Gas price changes
|
|
|
|
// (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (< 0 no fork)
|
|
|
|
string eip150_block = 4 [
|
|
|
|
(gogoproto.customname) = "EIP150Block",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"eip150_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// EIP150 HF hash (needed for header only clients as only gas pricing changed)
|
2021-04-19 07:10:57 +00:00
|
|
|
string eip150_hash = 5 [(gogoproto.customname) = "EIP150Hash", (gogoproto.moretags) = "yaml:\"byzantium_block\""];
|
2021-01-07 21:45:32 +00:00
|
|
|
// EIP155Block HF block
|
|
|
|
string eip155_block = 6 [
|
|
|
|
(gogoproto.customname) = "EIP155Block",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"eip155_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// EIP158 HF block
|
|
|
|
string eip158_block = 7 [
|
|
|
|
(gogoproto.customname) = "EIP158Block",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"eip158_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// Byzantium switch block (< 0 no fork, 0 = already on byzantium)
|
|
|
|
string byzantium_block = 8 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"byzantium_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// Constantinople switch block (< 0 no fork, 0 = already activated)
|
|
|
|
string constantinople_block = 9 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"constantinople_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// Petersburg switch block (< 0 same as Constantinople)
|
|
|
|
string petersburg_block = 10 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"petersburg_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// Istanbul switch block (< 0 no fork, 0 = already on istanbul)
|
|
|
|
string istanbul_block = 11 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"istanbul_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// Eip-2384 (bomb delay) switch block (< 0 no fork, 0 = already activated)
|
|
|
|
string muir_glacier_block = 12 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"muir_glacier_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
2021-05-10 16:34:00 +00:00
|
|
|
// YOLO v3: Gas repricings
|
|
|
|
string yolo_v3_block = 13 [
|
2021-01-07 21:45:32 +00:00
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-05-10 16:34:00 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"yolo_v3_block\"",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
|
|
|
// EWASM switch block (< 0 no fork, 0 = already activated)
|
|
|
|
string ewasm_block = 14 [
|
|
|
|
(gogoproto.customname) = "EWASMBlock",
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
2021-04-19 07:10:57 +00:00
|
|
|
(gogoproto.moretags) = "yaml:\"ewasm_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
2021-01-07 21:45:32 +00:00
|
|
|
];
|
2021-05-10 16:34:00 +00:00
|
|
|
// Catalyst switch block (< 0 = no fork, 0 = already on catalyst)
|
|
|
|
string catalyst_block = 15 [
|
|
|
|
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
|
|
|
|
(gogoproto.moretags) = "yaml:\"catalyst_block\"",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2021-01-07 21:45:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// State represents a single Storage key value pair item.
|
|
|
|
message State {
|
2021-04-19 07:10:57 +00:00
|
|
|
string key = 1;
|
2021-01-07 21:45:32 +00:00
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TransactionLogs define the logs generated from a transaction execution
|
|
|
|
// with a given hash. It it used for import/export data as transactions are not
|
|
|
|
// persisted on blockchain state after an upgrade.
|
|
|
|
message TransactionLogs {
|
2021-04-19 07:10:57 +00:00
|
|
|
string hash = 1;
|
2021-01-07 21:45:32 +00:00
|
|
|
repeated Log logs = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Log represents an protobuf compatible Ethereum Log that defines a contract
|
|
|
|
// log event. These events are generated by the LOG opcode and stored/indexed by
|
|
|
|
// the node.
|
|
|
|
message Log {
|
|
|
|
// Consensus fields:
|
|
|
|
|
|
|
|
// address of the contract that generated the event
|
|
|
|
string address = 1;
|
|
|
|
// list of topics provided by the contract.
|
|
|
|
repeated string topics = 2;
|
|
|
|
// supplied by the contract, usually ABI-encoded
|
|
|
|
bytes data = 3;
|
|
|
|
|
|
|
|
// Derived fields. These fields are filled in by the node
|
|
|
|
// but not secured by consensus.
|
|
|
|
|
|
|
|
// block in which the transaction was included
|
2021-04-19 07:10:57 +00:00
|
|
|
uint64 block_number = 4 [(gogoproto.jsontag) = "blockNumber"];
|
2021-01-07 21:45:32 +00:00
|
|
|
// hash of the transaction
|
2021-04-19 07:10:57 +00:00
|
|
|
string tx_hash = 5 [(gogoproto.jsontag) = "transactionHash"];
|
2021-01-07 21:45:32 +00:00
|
|
|
// index of the transaction in the block
|
2021-04-19 07:10:57 +00:00
|
|
|
uint64 tx_index = 6 [(gogoproto.jsontag) = "transactionIndex"];
|
2021-01-07 21:45:32 +00:00
|
|
|
// hash of the block in which the transaction was included
|
2021-04-19 07:10:57 +00:00
|
|
|
string block_hash = 7 [(gogoproto.jsontag) = "blockHash"];
|
2021-01-07 21:45:32 +00:00
|
|
|
// index of the log in the block
|
2021-04-19 07:10:57 +00:00
|
|
|
uint64 index = 8 [(gogoproto.jsontag) = "logIndex"];
|
2021-01-07 21:45:32 +00:00
|
|
|
|
|
|
|
// The Removed field is true if this log was reverted due to a chain
|
|
|
|
// reorganisation. You must pay attention to this field if you receive logs
|
|
|
|
// through a filter query.
|
|
|
|
bool removed = 9;
|
|
|
|
}
|
2021-04-18 15:54:18 +00:00
|
|
|
|
|
|
|
// TxReceipt defines the receipt type stored in KV for each EVM transaction.
|
|
|
|
message TxReceipt {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2021-05-14 06:52:18 +00:00
|
|
|
string hash = 1;
|
|
|
|
string from = 2;
|
2021-04-19 07:10:57 +00:00
|
|
|
TxData data = 3;
|
|
|
|
TxResult result = 4;
|
|
|
|
uint64 index = 5;
|
2021-05-10 16:34:00 +00:00
|
|
|
uint64 block_height = 6;
|
2021-05-14 06:52:18 +00:00
|
|
|
string block_hash = 7;
|
2021-04-18 15:54:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TxResult stores results of Tx execution.
|
|
|
|
message TxResult {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
// contract_address contains the ethereum address of the created contract (if
|
|
|
|
// any). If the state transition is an evm.Call, the contract address will be
|
|
|
|
// empty.
|
2021-04-19 07:10:57 +00:00
|
|
|
string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""];
|
2021-04-18 15:54:18 +00:00
|
|
|
// bloom represents the bloom filter bytes
|
|
|
|
bytes bloom = 2;
|
|
|
|
// tx_logs contains the transaction hash and the proto-compatible ethereum
|
|
|
|
// logs.
|
2021-04-19 07:10:57 +00:00
|
|
|
TransactionLogs tx_logs = 3 [(gogoproto.moretags) = "yaml:\"tx_logs\"", (gogoproto.nullable) = false];
|
2021-04-18 15:54:18 +00:00
|
|
|
// ret defines the bytes from the execution.
|
|
|
|
bytes ret = 4;
|
|
|
|
// reverted flag is set to true when the call has been reverted
|
|
|
|
bool reverted = 5;
|
|
|
|
// gas_used notes the amount of gas consumed while execution
|
|
|
|
uint64 gas_used = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TxData implements the Ethereum transaction data structure. It is used
|
|
|
|
// solely as intended in Ethereum abiding by the protocol.
|
|
|
|
message TxData {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
2021-05-10 16:34:00 +00:00
|
|
|
// destination EVM chain ID
|
|
|
|
bytes chain_id = 1 [
|
|
|
|
(gogoproto.customname) = "ChainID",
|
|
|
|
(gogoproto.jsontag) = "chainID"
|
|
|
|
];
|
2021-04-18 15:54:18 +00:00
|
|
|
// nonce corresponds to the account nonce (transaction sequence).
|
2021-05-10 16:34:00 +00:00
|
|
|
uint64 nonce = 2;
|
2021-04-18 15:54:18 +00:00
|
|
|
// price defines the unsigned integer value of the gas price in bytes.
|
2021-05-10 16:34:00 +00:00
|
|
|
bytes gas_price = 3 [(gogoproto.customname) = "GasPrice"];
|
2021-04-18 15:54:18 +00:00
|
|
|
// gas defines the gas limit defined for the transaction.
|
2021-05-10 16:34:00 +00:00
|
|
|
uint64 gas = 4 [(gogoproto.customname) = "GasLimit"];
|
2021-05-14 06:52:18 +00:00
|
|
|
// hex formatted address of the recipient
|
|
|
|
string to = 5;
|
2021-04-18 15:54:18 +00:00
|
|
|
// value defines the unsigned integer value of the transaction amount.
|
2021-05-10 16:34:00 +00:00
|
|
|
bytes value = 6 [(gogoproto.customname) = "Amount"];
|
2021-04-18 15:54:18 +00:00
|
|
|
// input defines the data payload bytes of the transaction.
|
2021-05-10 16:34:00 +00:00
|
|
|
bytes input = 7;
|
2021-05-14 06:52:18 +00:00
|
|
|
repeated AccessTuple accesses = 8 [
|
|
|
|
(gogoproto.castrepeated) = "AccessList",
|
|
|
|
(gogoproto.jsontag) = "accessList",
|
|
|
|
(gogoproto.nullable) = false
|
|
|
|
];
|
2021-04-18 15:54:18 +00:00
|
|
|
// v defines the signature value
|
2021-05-10 16:34:00 +00:00
|
|
|
bytes v = 9;
|
2021-04-18 15:54:18 +00:00
|
|
|
// r defines the signature value
|
2021-05-10 16:34:00 +00:00
|
|
|
bytes r = 10;
|
2021-04-18 15:54:18 +00:00
|
|
|
// s define the signature value
|
2021-05-10 16:34:00 +00:00
|
|
|
bytes s = 11;
|
2021-04-18 15:54:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message BytesList {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
repeated bytes bytes = 1;
|
|
|
|
}
|
2021-05-10 16:34:00 +00:00
|
|
|
|
|
|
|
// AccessTuple is the element type of an access list.
|
|
|
|
message AccessTuple {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
// hex formatted ethereum address
|
|
|
|
string address = 1;
|
|
|
|
// hex formatted hashes of the storage keys
|
|
|
|
repeated string storage_keys = 2 [(gogoproto.jsontag) = "storageKeys"];
|
|
|
|
}
|