Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: batch multiplex #1

Open
wants to merge 45 commits into
base: development
Choose a base branch
from
Open

feat: batch multiplex #1

wants to merge 45 commits into from

Commits on Dec 29, 2023

  1. feat: add batch multiplex feature

    - add batch multiple feature smart contract
    - add its interface
    - update 0x interface to inherit batch multiple methods
    - add sample batch multiplex validator contract
    gabririgo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    c686e47 View commit details
    Browse the repository at this point in the history
  2. move BatchMultiplexValidator contract to /examples folder

    - create new /examples folder
    - move BatchMultiplesValidator.sol to /examples
    gabririgo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    72caeec View commit details
    Browse the repository at this point in the history
  3. use _getValidateSelector private method

    - use private method instead of copy constant
    gabririgo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    085b237 View commit details
    Browse the repository at this point in the history
  4. minor fixes in BatchMultiplexFeature

    - added missing overrides
    - added missing parenthesis
    gabririgo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    d00b7a4 View commit details
    Browse the repository at this point in the history
  5. create new contracts artifacts

    - update scripts to include new contracts
    - deploy new contracts in tests/utils/DeployZeroEx.sol
    - update artifacts.ts and wrappers.ts files
    gabririgo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    c86a07b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9a00232 View commit details
    Browse the repository at this point in the history
  7. update solc comments

    gabririgo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    2012d50 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5bd76c3 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2023

  1. style: lint contracts

    gabririgo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    639d588 View commit details
    Browse the repository at this point in the history
  2. fix import in tests

    gabririgo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    a9ea1aa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b1761ba View commit details
    Browse the repository at this point in the history
  4. remove unnecessary input

    remove input in BatchMultiplexFeature constructor in DeployZeroEx.sol
    gabririgo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    1b007fd View commit details
    Browse the repository at this point in the history
  5. style: improvements

    gabririgo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    059610d View commit details
    Browse the repository at this point in the history
  6. minor fix

    - pass encoded calls instead of calls array as validate(...args) first input
    gabririgo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    8fc4a18 View commit details
    Browse the repository at this point in the history
  7. update copy

    gabririgo committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    08199f5 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. add comments

    gabririgo committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    c885a4c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    85418da View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2024

  1. test: fix linting error

    gabririgo committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    c9dc5b9 View commit details
    Browse the repository at this point in the history
  2. test: fix initial batchMultiplex tests

    - assert meta transaction can be executed with batchMultiplex
    - assert onlySelf, onlyOwner modifiers not overruled by batchMultiples
    gabririgo committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    10d250f View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2024

  1. only revert if error handling is revert

    - move revert transaction failed without error in if statement
    gabririgo committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    ce0c4dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e3a998c View commit details
    Browse the repository at this point in the history
  3. comments and docs linting

    gabririgo committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    249eb15 View commit details
    Browse the repository at this point in the history
  4. test contract linting

    gabririgo committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    29ddaba View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2024

  1. style: fixed comments

    - removed solved comments
    - added payable modifier to feature methods
    - added refundsAttachedEth, doesNotReduceEthBalance, onlyDelegateCall modifiers to methods
    - added new guard flag in reentrancy guard dep
    gabririgo committed Jan 13, 2024
    Configuration menu
    Copy the full SHA
    b6d315c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    adeb8df View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. refund up to sent eth excluding prev balance

    - refund the minimum between eth attached and the eth left in the proxy net of eth stuck in the proxy before the transaction
    gabririgo committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    6f0e417 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2024

  1. add .ts batchMultiplex tests

    - add test file
    - update setup pipeline
    gabririgo committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    eaa13af View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2f8f2af View commit details
    Browse the repository at this point in the history
  3. batch multiplex improvement

    - merge two batchMultiplex methods
    - name differently the 2 implemented methods to prevent console warning in tests and easier testing integration, using `batchMultiplex` and `batchMultiplexOptionalParams`
    - remove validate deploy and immutable, as moved in foundry test
    - use Contract.selector instead of hashing selector in migrate
    - use _revertWithData from ZeroEx.sol to allow decoding expected error
    - update interface
    - minor linting
    gabririgo committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    606fbaf View commit details
    Browse the repository at this point in the history
  4. lint test file

    gabririgo committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    b8e6feb View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2024

  1. test: add batch of swaps with multiple features

    - swap zrx and dai with native fill RFQ order and multiplex sell token for token to uniswap through `batchMultiplex`method
    gabririgo committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    e8959b9 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2024

  1. handle ETH transfer

    - handle edge cases of ETH transfers
    - added internal methods for routing
    - prevent weth stuck if behavior is STOP
    - blacklist non-supported methods
    - store implementations of methods that require special handling
    - reserve 2 EP storage slots for batch multiplex stoage
    - update ci pipeline
    gabririgo committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    f04ecca View commit details
    Browse the repository at this point in the history
  2. lint new changes

    gabririgo committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    48f645e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    31fffe0 View commit details
    Browse the repository at this point in the history
  4. minor refactoring

    - create private method _dispatch to handle execution in both external batch execute methods
    - remove unnecessary variable definitions
    - remove eventual weth balance in both methods
    gabririgo committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    14075e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    02884e2 View commit details
    Browse the repository at this point in the history
  6. retrieve target implementations from proxy storage

    - removed mapping of selector to implementations from feature storage
    - store mapping of selectors that require routing
    - storage variable name shortening
    - retrieve address of target implementations from proxy storage
    - revert on more selectors
    gabririgo committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    fa3da7c View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2024

  1. simplify batch multiplex storage

    - define only 1 mapping in storage, use enum instead of bool to define selector status
    - update storage initialization
    - move duplicate unwrap weth block to private method
    - added method for owner to update storage
    - added method to query a selector's status
    - rename immutable _weth to WETH
    gabririgo committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    028a51f View commit details
    Browse the repository at this point in the history
  2. lint changes

    gabririgo committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    8a6afd1 View commit details
    Browse the repository at this point in the history
  3. style: reorder methods

    - reorder some methods according to flow: external, public, internal, private; write, read (view, pure)
    gabririgo committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    07844bf View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2024

  1. limit use of .call where required

    - use delegatecall in transformERC20 if ETH is not the input token
    - use non-conditional `value` in .call as the non-ETH calls are re-routed with delegatecall
    - comment improvements
    gabririgo committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    f189991 View commit details
    Browse the repository at this point in the history
  2. custom-route fillLimitOrder method

    - create custom route as method will fail whenever eth is involved and another call using eth is executed
    - blacklist other limit orders
    - update comments
    gabririgo committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    c4daa73 View commit details
    Browse the repository at this point in the history
  3. update tests

    - add limit order and wrap eth tests
    - refactor batch multiplex tests without using non-supported meta transactions
    gabririgo committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    3e1db28 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2024

  1. feat: add BatchMultiplexV2Feature

    - add new contract with non payable method for executing batch calls to ZeroEx
    gabririgo committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    7cd9a25 View commit details
    Browse the repository at this point in the history
  2. variables and methods renaming

    - renamed batch multiplex calls for better read
    - define a type in libs and use in the 2 batch multiplex feature contracts and interfaces
    - use same error behavior as pZEIP1 for uniformity
    gabririgo committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    3b2ffa7 View commit details
    Browse the repository at this point in the history