ApeWorX / ape

The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
https://apeworx.io
Apache License 2.0
880 stars 132 forks source link

Update contract_types in contracts cache when their code gets updates #733

Open antazoey opened 2 years ago

antazoey commented 2 years ago

Overview

Detect if a contract's type can be updated or deleted from upgradeable or selfdestructed designs and update the contract_type in the chain.contracts cache.

Specification

TBD

Dependencies

https://github.com/ApeWorX/ape/pull/712#pullrequestreview-976042673

fubuloubu commented 2 years ago

Gets me thinking if the cached addresses need some additional information to them, maybe a structure more like this (in ethpm-types):

class ContractType(...):
    abi: ...
    ...
    immutable: bool = True
    proxyInfo: Optional[ProxyInfo] = None

Where ProxyInfo is like this:

class ProxyType(enum.Enum):
    EIP1167 = "eip1167"
    ...

class ProxyInfo(...):
    type: ProxyType = ProxyType.EIP1167
    implementation: AddressType