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

💰 Conditional Order Fee Rework #10

Merged
merged 30 commits into from
Oct 19, 2023
Merged

💰 Conditional Order Fee Rework #10

merged 30 commits into from
Oct 19, 2023

Conversation

JaredBorders
Copy link
Contributor

Rework how a fee is calculated and imposed. Introduce a new field to conditional order defining object that represents a max fee that an account is willing to pay for conditional order execution. Change fee to be denominated in ETH. Add

Description

  • Rework fee calculation
  • Rework how fee is imposed
  • Introduce new field to ConditionalOrder: maxExecutorFee
  • Introduce ETH Management logic: Engine.depositEth, Engine.withdrawEth, Engine._withdrawEth
  • Introduce new events: EthDeposit, EthWithdraw
  • introduce new custom errors: InsufficientEthBalance, EthTransferFailed
  • Increase test depth
  • Add new tests for new logic
  • Update Engine.execute and Engine.canExecute to include a fee param
  • Improve Engine.canExecute logic to better predict whether an order can be executed (takes into consideration conditional order fees)

Related issue(s)

N/A

Motivation and Context

Improve UX for traders and ensure more precise fees per order executed

@JaredBorders JaredBorders added enhancement New feature or request smart-contracts labels Oct 13, 2023
@JaredBorders JaredBorders self-assigned this Oct 13, 2023
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #10 (cd99533) into main (7ac8eb4) will increase coverage by 2.86%.
Report is 16 commits behind head on main.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   72.86%   75.73%   +2.86%     
==========================================
  Files           5        5              
  Lines         129      136       +7     
  Branches       26       28       +2     
==========================================
+ Hits           94      103       +9     
+ Misses         28       27       -1     
+ Partials        7        6       -1     
Files Coverage Δ
src/libraries/ConditionalOrderHashLib.sol 0.00% <ø> (ø)
src/utils/EIP7412.sol 100.00% <100.00%> (ø)
src/Engine.sol 92.30% <86.95%> (+1.68%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@JaredBorders JaredBorders merged commit e5f045a into main Oct 19, 2023
5 checks passed
@JaredBorders JaredBorders deleted the co-fee-rework branch October 19, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request smart-contracts
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants