Skip to content

Commit

Permalink
Add CREATE2 salt to evmc_message
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Jul 25, 2018
1 parent cac4f6f commit 0c32ac1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 11 additions & 3 deletions include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ struct evmc_address
enum evmc_call_kind
{
EVMC_CALL = 0, /**< Request CALL. */
EVMC_DELEGATECALL = 1, /**< Request DELEGATECALL. The value param ignored. */
EVMC_DELEGATECALL = 1, /**< Request DELEGATECALL. Valid since Homestead.
The value param ignored. */
EVMC_CALLCODE = 2, /**< Request CALLCODE. */
EVMC_CREATE = 3, /**< Request CREATE. Semantic of some params changes. */
EVMC_CREATE2 = 4 /**< Request CREATE2. Semantic of some params changes. */
EVMC_CREATE = 3, /**< Request CREATE. */
EVMC_CREATE2 = 4 /**< Request CREATE2. Valid since Constantinople.*/
};

/** The flags for ::evmc_message. */
Expand Down Expand Up @@ -117,6 +118,13 @@ struct evmc_message
*/
struct evmc_uint256be code_hash;

/**
* The optional value used in new contract address construction.
*
* Ignored unless kind == EVMC_CREATE2.
*/
struct evmc_uint256be salt;

/** The amount of gas for message execution. */
int64_t gas;

Expand Down
1 change: 0 additions & 1 deletion test/vmtester/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static_assert(sizeof(evmc_uint256be) == 32, "evmc_uint256be is too big");
static_assert(sizeof(evmc_address) == 20, "evmc_address is too big");
static_assert(sizeof(evmc_result) <= 64, "evmc_result does not fit cache line");
static_assert(sizeof(evmc_instance) <= 64, "evmc_instance does not fit cache line");
static_assert(sizeof(evmc_message) <= 18 * 8, "evmc_message not optimally packed");
static_assert(offsetof(evmc_message, code_hash) % 8 == 0, "evmc_message.code_hash not aligned");

// Check enums match int size.
Expand Down

0 comments on commit 0c32ac1

Please sign in to comment.