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

out-of-gas exception when an app does an eth_call to a function transferring ETH to the avatar #202

Open
jfschwarz opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jfschwarz
Copy link
Collaborator

Describe the bug
When simulating calls involving the .transfer() of ETH to the Piloted Safe address, these fail with an out-of-gas exception. That is because for transactions with the avatar address as sender, the Safe proxy+implementation contracts are cold. This means that the stipend of 2300 gas is insufficient to execute the cold Safe's receive() hook.

To Reproduce
Steps to reproduce the behavior:

  1. Go to our example app, open Pilot
  2. Connect a Piloted Safe with an WETH balance
  3. Trigger an unwrap in our example app
  4. See error

Expected behavior
The simulated call should succeed.

Possible solutions:
The issue could be mitigated using EIP-2930 access lists. The question is how we could make sure that requests dispatched from apps will generally have the required access list. We'd need to start intercepting RPC traffic already before a fork has been launched.

Another possible solution would be encouraging the use of a custom Safe proxy, which directly owns the receive() hook instead of proxying to the implementation contract. This would ensure that the hook could be executed staying inside the 2300 gas quota even for cold safe proxies. This obviously won't fix the issue for existing Safes using the default proxy.

Additional context

The issue should hopefully become less important over time, as using .transfer() is discouraged. However, as it stands there are popular contracts, such as WETH, using it.

@jfschwarz jfschwarz added the bug Something isn't working label Nov 13, 2024
@jfschwarz jfschwarz self-assigned this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant