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

[WIP] batch transactions #82

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

[WIP] batch transactions #82

wants to merge 1 commit into from

Conversation

regynald
Copy link
Contributor

No description provided.

@regynald regynald requested a review from jake-nyquist March 30, 2023 13:41
@regynald regynald marked this pull request as draft March 30, 2023 13:41
@@ -292,16 +302,23 @@ contract HookCoveredCallImplV1 is
uint128 strikePrice,
uint32 expirationTime
) external nonReentrant whenNotPaused returns (uint256) {
address msgSender = msg.sender;
emit log_named_address("msg.sender", msgSender);
if (msg.sender == execAddr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be a modifier, that way we can always just use the msgSender variable. Or an alternative would be a library or internal function somehow, and we chang all other usages to msgSender (which falls back to msg.Sender if not the trusted proxy address)

}
}

contract BatchUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

can be a library? perhaps should also be in a different file?

emit log_named_address("msg.sender", msgSender);
if (msg.sender == execAddr) {
msgSender = unpackTrailingParamMsgSender();
emit log_named_address("msgSender", msgSender);
Copy link
Contributor

Choose a reason for hiding this comment

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

should cut these logs?

@@ -82,6 +84,7 @@ contract HookProtocolTest is Test, EIP712, PermissionConstants {
}

function setUpFullProtocol() public {
exec = new Exec();
weth = new WETH();
protocol = new HookProtocol(
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to have exec live on HookProtocol and then just make the HookProtocol address that all of these contracts already store the exec address?

@@ -64,7 +67,9 @@ contract HookCoveredCallImplV1 is
HookInstrumentERC721,
Copy link
Contributor

Choose a reason for hiding this comment

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

are there functions within here, like on the OZ contracts, that pay attention to msg.Sender... do we need to update them?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems likely that we want to allow only a fixed set of external functions call with msg.sender, but perhaps there are some like safeTransferFrom where that is not the case?

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.

2 participants