Ran prettier to clean up

This commit is contained in:
Patrick Dowell
2023-02-21 15:37:10 -08:00
parent cdb94d1780
commit 3b55a88fc5
2 changed files with 720 additions and 710 deletions

View File

@@ -1,90 +1,90 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
/* /*
Copyright 2023 ZeroEx Intl. Copyright 2023 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
pragma solidity ^0.6.5; pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import "@0x/contracts-erc20/src/IERC20Token.sol"; import "@0x/contracts-erc20/src/IERC20Token.sol";
import "../libs/LibSignature.sol"; import "../libs/LibSignature.sol";
/// @dev Meta-transactions feature. /// @dev Meta-transactions feature.
interface IMetaTransactionsFeatureV2 { interface IMetaTransactionsFeatureV2 {
/// @dev Describes an exchange proxy meta transaction. /// @dev Describes an exchange proxy meta transaction.
struct MetaTransactionFeeData { struct MetaTransactionFeeData {
// ERC20 fee recipient // ERC20 fee recipient
address recipient; address recipient;
// ERC20 fee amount // ERC20 fee amount
uint256 amount; uint256 amount;
} }
struct MetaTransactionDataV2 { struct MetaTransactionDataV2 {
// Signer of meta-transaction. On whose behalf to execute the MTX. // Signer of meta-transaction. On whose behalf to execute the MTX.
address payable signer; address payable signer;
// Required sender, or NULL for anyone. // Required sender, or NULL for anyone.
address sender; address sender;
// MTX is invalid after this time. // MTX is invalid after this time.
uint256 expirationTimeSeconds; uint256 expirationTimeSeconds;
// Nonce to make this MTX unique. // Nonce to make this MTX unique.
uint256 salt; uint256 salt;
// Encoded call data to a function on the exchange proxy. // Encoded call data to a function on the exchange proxy.
bytes callData; bytes callData;
// ERC20 fee `signer` pays `sender`. // ERC20 fee `signer` pays `sender`.
IERC20Token feeToken; IERC20Token feeToken;
// ERC20 fees. // ERC20 fees.
MetaTransactionFeeData[] fees; MetaTransactionFeeData[] fees;
} }
/// @dev Emitted whenever a meta-transaction is executed via /// @dev Emitted whenever a meta-transaction is executed via
/// `executeMetaTransaction()` or `executeMetaTransactions()`. /// `executeMetaTransaction()` or `executeMetaTransactions()`.
/// @param hash The meta-transaction hash. /// @param hash The meta-transaction hash.
/// @param selector The selector of the function being executed. /// @param selector The selector of the function being executed.
/// @param signer Who to execute the meta-transaction on behalf of. /// @param signer Who to execute the meta-transaction on behalf of.
/// @param sender Who executed the meta-transaction. /// @param sender Who executed the meta-transaction.
event MetaTransactionExecuted(bytes32 hash, bytes4 indexed selector, address signer, address sender); event MetaTransactionExecuted(bytes32 hash, bytes4 indexed selector, address signer, address sender);
/// @dev Execute a single meta-transaction. /// @dev Execute a single meta-transaction.
/// @param mtx The meta-transaction. /// @param mtx The meta-transaction.
/// @param signature The signature by `mtx.signer`. /// @param signature The signature by `mtx.signer`.
/// @return returnResult The ABI-encoded result of the underlying call. /// @return returnResult The ABI-encoded result of the underlying call.
function executeMetaTransactionV2( function executeMetaTransactionV2(
MetaTransactionDataV2 calldata mtx, MetaTransactionDataV2 calldata mtx,
LibSignature.Signature calldata signature LibSignature.Signature calldata signature
) external payable returns (bytes memory returnResult); ) external payable returns (bytes memory returnResult);
/// @dev Execute multiple meta-transactions. /// @dev Execute multiple meta-transactions.
/// @param mtxs The meta-transactions. /// @param mtxs The meta-transactions.
/// @param signatures The signature by each respective `mtx.signer`. /// @param signatures The signature by each respective `mtx.signer`.
/// @return returnResults The ABI-encoded results of the underlying calls. /// @return returnResults The ABI-encoded results of the underlying calls.
function batchExecuteMetaTransactionsV2( function batchExecuteMetaTransactionsV2(
MetaTransactionDataV2[] calldata mtxs, MetaTransactionDataV2[] calldata mtxs,
LibSignature.Signature[] calldata signatures LibSignature.Signature[] calldata signatures
) external payable returns (bytes[] memory returnResults); ) external payable returns (bytes[] memory returnResults);
/// @dev Get the block at which a meta-transaction has been executed. /// @dev Get the block at which a meta-transaction has been executed.
/// @param mtx The meta-transaction. /// @param mtx The meta-transaction.
/// @return blockNumber The block height when the meta-transactioin was executed. /// @return blockNumber The block height when the meta-transactioin was executed.
function getMetaTransactionV2ExecutedBlock( function getMetaTransactionV2ExecutedBlock(
MetaTransactionDataV2 calldata mtx MetaTransactionDataV2 calldata mtx
) external view returns (uint256 blockNumber); ) external view returns (uint256 blockNumber);
/// @dev Get the block at which a meta-transaction hash has been executed. /// @dev Get the block at which a meta-transaction hash has been executed.
/// @param mtxHash The meta-transaction hash. /// @param mtxHash The meta-transaction hash.
/// @return blockNumber The block height when the meta-transactioin was executed. /// @return blockNumber The block height when the meta-transactioin was executed.
function getMetaTransactionV2HashExecutedBlock(bytes32 mtxHash) external view returns (uint256 blockNumber); function getMetaTransactionV2HashExecutedBlock(bytes32 mtxHash) external view returns (uint256 blockNumber);
/// @dev Get the EIP712 hash of a meta-transaction. /// @dev Get the EIP712 hash of a meta-transaction.
/// @param mtx The meta-transaction. /// @param mtx The meta-transaction.
/// @return mtxHash The EIP712 hash of `mtx`. /// @return mtxHash The EIP712 hash of `mtx`.
function getMetaTransactionV2Hash(MetaTransactionDataV2 calldata mtx) external view returns (bytes32 mtxHash); function getMetaTransactionV2Hash(MetaTransactionDataV2 calldata mtx) external view returns (bytes32 mtxHash);
} }