Addresses, ABI, and Upgradeable Contracts

·

When navigating the Ethereum blockchain, understanding how smart contracts work—and how to interact with them—is essential for both developers and users. Two fundamental concepts in this process are contract addresses and Application Binary Interface (ABI). Together, they form the foundation for calling functions on smart contracts, whether standard or upgradeable. This guide breaks down these components in clear, practical terms, helping you confidently engage with decentralized applications.

Understanding Addresses and ABI

On platforms like Etherscan, you typically explore blocks, transactions, or addresses. An address can represent either an externally owned account (EOA) controlled by a private key or a smart contract. When interacting with a contract—such as swapping tokens on Uniswap V2—you're not just sending a transaction; you're calling specific functions within that contract.

For example, to swap Token A for Token B on Uniswap V2, you’d call the function swapExactTokensForTokens. But how does your wallet or tool know what parameters this function expects? That’s where ABI comes in.

👉 Discover how blockchain interactions power real-world DeFi applications

The ABI defines a contract’s interface: its functions, their input/output types, and state mutability. Here’s a simplified version of the swapExactTokensForTokens ABI:

[
  {
    "inputs": [
      { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
      { "internalType": "uint256", "name": "amountOutMin", "type": "uint256" },
      { "internalType": "address[]", "name": "path", "type": "address[]" },
      { "internalType": "address", "name": "to", "type": "address" },
      { "internalType": "uint256", "name": "deadline", "type": "uint256" }
    ],
    "name": "swapExactTokensForTokens",
    "outputs": [
      { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Tools like ethers.js use this ABI to encode function calls correctly before sending them to the blockchain. However, it's crucial to understand: an ABI is not inherently tied to a specific address. You can technically use any ABI to interact with any contract address. If the function signatures don’t match what the contract actually implements, the call will fail—but the attempt is still valid from a technical standpoint.

This flexibility becomes especially important when dealing with upgradeable contracts, where the logic behind an address may change over time.

What Are Upgradeable Contracts?

Smart contracts on Ethereum are immutable by default—once deployed, their code cannot be altered. Yet, many projects need the ability to fix bugs or add features post-deployment. This is where upgradeable contracts come into play.

Upgradeable contracts solve this limitation using a proxy pattern. They consist of two main parts:

  1. Proxy Contract: This is the public-facing address users interact with.
  2. Logic (Implementation) Contract: This contains the actual business logic.

Users send transactions to the proxy contract, which then delegates execution to the current logic contract using a low-level EVM opcode called delegatecall.

How delegatecall Works

Unlike regular function calls, delegatecall allows one contract to execute code from another while maintaining the context (storage, balance, etc.) of the calling contract. In practice, this means the proxy contract forwards the call to the logic contract, which runs the requested function as if it were part of the proxy itself.

As a result:

Interacting with Upgradeable Contracts

Since users interact with the proxy but expect functionality defined in the logic contract, they must use the logic contract’s ABI, not the proxy’s. The proxy typically only exposes administrative functions (e.g., upgrading the implementation), while core features like token transfers are defined in the logic layer.

For example, when working with USDT on Arbitrum (0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9), Etherscan detects that it's an upgradeable contract and provides two sets of interaction options:

👉 Learn how DeFi protocols leverage upgradeable contracts for security and scalability

Etherscan identifies upgradeable contracts by checking for standardized patterns like EIP-1967, which stores the logic contract address in a predefined storage slot. Other standards like EIP-897 (used by Compound’s cTokens) offer alternative approaches.

What If Source Code Isn’t Verified?

Not all contracts publish their source code on block explorers. Without verification, Etherscan won’t display readable functions or ABIs. In such cases, you’ll need external tools like MyCrypto, MyEtherWallet, or Remix—but only if you have access to the correct ABI.

Good news: even if source code isn’t public, most reputable projects share their deployed contract addresses and ABIs in documentation, GitHub repositories, or developer portals. With those two pieces of information—address and ABI—you can manually connect and interact with almost any contract.

Frequently Asked Questions

Q: Can I use any ABI with any contract address?

A: Technically yes, but success depends on whether the function signatures match what the contract actually supports. Mismatched calls will revert.

Q: Why do some contracts show “Read as Proxy” on Etherscan?

A: This indicates an upgradeable contract using standards like EIP-1967. “Read as Proxy” uses the logic contract’s ABI, giving access to user-facing functions.

Q: Is it safe to interact with unverified contracts?

A: It carries risk. Always verify ABIs through official channels and consider using audited tools or interfaces when possible.

Q: How do I find a contract’s ABI if it’s not on Etherscan?

A: Check the project’s GitHub, official docs, or developer resources. Some platforms also host public ABI repositories.

Q: Can upgradeable contracts be trusted?

A: While they introduce centralization risks (e.g., admin keys), many use governance mechanisms or timelocks to enhance security. Always review trust assumptions.

Q: Does using delegatecall pose security risks?

A: Yes—if improperly implemented, it can lead to storage collisions or unauthorized upgrades. Stick to well-audited proxy patterns like OpenZeppelin’s.

Final Thoughts

Mastering the relationship between addresses, ABI, and upgradeable architectures empowers you to interact with smart contracts more effectively and securely. Whether you're building dApps or simply using DeFi protocols, knowing how these layers fit together enhances both usability and safety.

As blockchain technology evolves, so too do interaction patterns. Staying informed ensures you're not just participating—but doing so wisely.

👉 Explore secure ways to interact with smart contracts across multiple chains