Skip to content

0x transaction developer experience improvements #34

@abandeali1

Description

@abandeali1

Preamble

ZEIP: 34
Title: 0x transaction developer experience improvements
Author: 0x Core Team
Type: Standard Track
Category: Core
Status: Final
Created: 2019-10-29

Discussion: #34

Summary

This is a catch-all for smaller developer experience improvements to 0x transactions. Improvements include:

  • Logging an event upon successful transaction execution
  • Refactoring executeTransaction to take a ZeroExTransaction struct as an input
  • Adding a bytes return value to executeTransaction that is equal to the return data of the underlying function call

Motivation

All of these features should make it easier to work with 0x transactions, both off-chain and at the smart contract level.

Specification

TransactionExecuted event

Upon successful execution, executeTransaction will log a TransactionExecution event.

// TransactionExecution event is emitted when a ZeroExTransaction is executed.
event TransactionExecution(
    bytes32 indexed transactionHash
);

New executeTransaction function signature

The inputs and outputs of executeTransaction will be modified as follows:

struct ZeroExTransaction {
    uint256 salt;                   // Arbitrary number to ensure uniqueness of transaction hash.
    uint256 expirationTimeSeconds;  // Timestamp in seconds at which transaction expires.
    uint256 gasPrice;               // gasPrice that transaction is required to be executed with.
    address signerAddress;          // Address of transaction signer.
    bytes data;                     // AbiV2 encoded calldata.
}

/// @dev Executes an Exchange method call in the context of signer.
/// @param transaction 0x transaction containing salt, signerAddress, and data.
/// @param signature Proof that transaction has been signed by signer.
/// @return ABI encoded return data of the underlying Exchange function call.
function executeTransaction(
    LibZeroExTransaction.ZeroExTransaction memory transaction,
    bytes memory signature
)
    public
    payable
    returns (bytes memory);

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: implementedProposed changes have been implemented (and deployed, if smart contract)type: core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions