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: remove ContextUpgradeable from ExchangeCore #1164

Merged

Conversation

adjisb
Copy link
Contributor

@adjisb adjisb commented Sep 27, 2023

Description

Pass the from == _msgSender() all the way down into ExcangeCore

Pass the from == _msgSender() all the way down into ExcangeCore
@adjisb adjisb requested a review from a team as a code owner September 27, 2023 18:12
@adjisb adjisb requested review from mvanmeerbeck and atkinsonholly and removed request for a team September 27, 2023 18:12
@@ -295,56 +270,62 @@ abstract contract ExchangeCore is Initializable, ContextUpgradeable, TransferExe
uint256 takeBuyAmount = newFill.rightValue;
uint256 makeBuyAmount = newFill.leftValue;

if (((_msgSender() != msg.sender) && !nativeMeta) || ((_msgSender() == msg.sender) && !nativeOrder)) {
// TODO: this force me to pass from, do we want it ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do. @mvanmeerbeck ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of that is for native eth, which we're removing so, lets just ignore

{
bytes32 leftOrderKeyHash = LibOrder.hashKey(orderLeft);
bytes32 rightOrderKeyHash = LibOrder.hashKey(orderRight);

address msgSender = _msgSender();
// TODO: this force me to pass from, do we want it ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this case has been introduced when rarible added directPurchase & directAcceptBid.
I think we should enforce maker != address(0)

@@ -478,8 +461,9 @@ abstract contract ExchangeCore is Initializable, ContextUpgradeable, TransferExe
}
}

// TODO: can we move this out so we don't need to pass from ?
Copy link
Contributor

@mvanmeerbeck mvanmeerbeck Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this event should be emitted in the same function as the change of the variable fills

@mvanmeerbeck mvanmeerbeck merged commit b283be4 into feat/move-ownable-to-parent Sep 28, 2023
3 of 5 checks passed
@mvanmeerbeck mvanmeerbeck deleted the feat/remove-context-upgradable branch September 28, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants