safe-global / safe-react-apps

A repository for applications for Safe Web Interface
MIT License
98 stars 73 forks source link

Tx builder not loading correct ABI #795

Closed czepluch closed 7 months ago

czepluch commented 7 months ago

Description

I am following this guide to try to update my Safe fallback implementation. However, when I paste my Safe address into the Transaction Builder I don't see other options than fallback in the "Contract Method Selector".

And the only content I see in the ABI is:

[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "_masterCopy",
        "type": "address"
      }
    ],
    "payable": false,
    "stateMutability": "nonpayable"
  },
  {
    "type": "fallback",
    "payable": true,
    "stateMutability": "payable"
  }
]

This leads be to believe that either there's something wrong with the TX builder or it's due to the fact that my Safe was one of the very first ever deployed. It is however updated to version 1.3.0 and has the compatibilityFallbackHandler 1.3.0 set to address 0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4.

Environment

katspaugh commented 7 months ago

AFAIK Tx builder fetches ABIs from etherscan and sourcify, and for proxy contracts, such as Safe accounts, it also offers to fetch the proxied implementation ABI. Don't think it's able to fetch mixins like fallback handlers. @dasanra please correct me if I'm wrong.

You might be able to just paste the fallback handler ABI manually though.

czepluch commented 7 months ago

Paste the fallback handler ABI where? As far as I understand I need to call a function on the safe to set the fallback handler.

katspaugh commented 7 months ago

Ah, I see now.

In the tx builder UI in the ABI field. You can paste the ABI of the “master copy” contract that your Safe account implements as a proxy. In your case, this contract: https://etherscan.io/address/0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552

Normally it should pick it up automatically.

czepluch commented 7 months ago

Ah, great. That worked. Thanks for the help. I will keep the issue open in case you want to look into why the TX builder isn't correctly fetching the ABI. If not, just close the issue please.

katspaugh commented 7 months ago

I'll close it because normally it picks up the proxy ABI w/o issue. I think it's really what you said, an edge case with an OG safe.

Screenshot 2024-02-08 at 14 34 21