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

Fix Review #1

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

Fix Review #1

wants to merge 1 commit into from

Conversation

sherlock-admin
Copy link
Contributor

Fix Review of

Repo: bgd-labs/aave-v3-origin
Commit Hash: 21c30148d1484ddec57f5d223f530179b103cae6

Comment on lines +140 to +142
try
aWETH.permit(msg.sender, address(this), amount, deadline, permitV, permitR, permitS)
{} catch {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change related to bgd-labs/aave-v3-origin#50.

Fixes issues: #209

Comment on lines +230 to +268
function test_withdrawEth_permit_frontrunRegression() public {
test_depositNativeEthInPool();

uint256 withdrawAmount = 0.6e18;

EIP712SigUtils.Permit memory permit = EIP712SigUtils.Permit({
owner: alice,
spender: address(wrappedTokenGatewayV3),
value: withdrawAmount,
nonce: 0,
deadline: block.timestamp + 1 days
});
bytes32 digest = EIP712SigUtils.getTypedDataHash(
permit,
bytes(aWEth.name()),
bytes('1'),
address(aWEth)
);

(uint8 v, bytes32 r, bytes32 s) = vm.sign(alicePrivateKey, digest);

uint256 userEthBalanceBefore = alice.balance;

vm.prank(alice);
aWEth.permit(permit.owner, permit.spender, permit.value, permit.deadline, v, r, s);

// should not revert if permit is already executed
vm.prank(alice);
wrappedTokenGatewayV3.withdrawETHWithPermit(
report.poolProxy,
withdrawAmount,
alice,
permit.deadline,
v,
r,
s
);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change related to bgd-labs/aave-v3-origin#50.

Fixes issues: #209

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.

1 participant