You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to make this issue on the npm zksync-contracts repo but I'm unsure as to where that is.
Problem
As of token, if I want to make a Transaction object (which I often do... Although I'm not sold on the name yet, but it's growing on me) I have to fill in this behemoth:
/// @notice Structure used to represent zkSync transaction.structTransaction{// The type of the transaction.uint256txType;// The caller.uint256from;// The callee.uint256to;// The gasLimit to pass with the transaction.// It has the same meaning as Ethereum's gasLimit.uint256gasLimit;// The maximum amount of gas the user is willing to pay for a byte of pubdata.uint256gasPerPubdataByteLimit;// The maximum fee per gas that the user is willing to pay.// It is akin to EIP1559's maxFeePerGas.uint256maxFeePerGas;// The maximum priority fee per gas that the user is willing to pay.// It is akin to EIP1559's maxPriorityFeePerGas.uint256maxPriorityFeePerGas;// The transaction's paymaster. If there is no paymaster, it is equal to 0.uint256paymaster;// The nonce of the transaction.uint256nonce;// The value to pass with the transaction.uint256value;// In the future, we might want to add some// new fields to the struct. The `txData` struct// is to be passed to account and any changes to its structure// would mean a breaking change to these accounts. In order to prevent this,// we should keep some fields as "reserved".// It is also recommended that their length is fixed, since// it would allow easier proof integration (in case we will need// some special circuit for preprocessing transactions).uint256[4]reserved;// The transaction's calldata.bytesdata;// The signature of the transaction.bytessignature;// The properly formatted hashes of bytecodes that must be published on L1// with the inclusion of this transaction. Note, that a bytecode has been published// before, the user won't pay fees for its republishing.bytes32[]factoryDeps;// The input to the paymaster.bytespaymasterInput;// Reserved dynamic type for the future use-case. Using it should be avoided,// But it is still here, just in case we want to enable some additional functionality.bytesreservedDynamic;}
It would be great if the TransactionHelper library came packed with a generateDefaultTransaction API for one to generate default transactions.
Potential Solution
The function could look as such:
/* * @param txType: 0x0, 0x1, 0x2, 0x3, 0x71, or 0xff */functiongenerateDefaultTransaction(uint8txType)publicreturns(Transactionmemory){// proceed to populate the transaction with some good defaults..}
I'd like to make this issue on the npm zksync-contracts repo but I'm unsure as to where that is.
Problem
As of token, if I want to make a
Transaction
object (which I often do... Although I'm not sold on the name yet, but it's growing on me) I have to fill in this behemoth:It would be great if the
TransactionHelper
library came packed with agenerateDefaultTransaction
API for one to generate default transactions.Potential Solution
The function could look as such:
This way, my API could be:
Instead of having to populate everything myself.
The text was updated successfully, but these errors were encountered: