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: issue deploying contract with default payable method #18

Merged
merged 2 commits into from
Feb 15, 2025

Conversation

antazoey
Copy link
Member

What I did

For some reason, could not deploy a contract with a default payable method. It had to do with Ape's proxy detection system, which attempt certain contract-calls. In this case, instead of a ContractLogicError like we'd expect, we were getting write-errors from the EVM.

How I did it

Handle the error and raise a ContractLogicError to tell the proxy system what's up

How to verify it

You can deploy contracts like:

# pragma version ^0.4.0

# Event for tracking donations
event Donation:
    sender: address
    amount: uint256

@external
@payable
def __default__():
    log Donation(msg.sender, msg.value)

now

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

@antazoey antazoey force-pushed the fix/calls-write-err branch from 152584d to 33cd338 Compare February 15, 2025 22:30
@antazoey antazoey force-pushed the fix/calls-write-err branch from 33cd338 to 7469c05 Compare February 15, 2025 22:34
@antazoey antazoey enabled auto-merge (squash) February 15, 2025 22:38
@antazoey antazoey merged commit 6041d95 into ApeWorX:main Feb 15, 2025
11 checks passed
@antazoey antazoey deleted the fix/calls-write-err branch February 15, 2025 22:39
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