DEV Community

flat cash
flat cash

Posted on

Guide: How to verify FLAT Protocol contracts on Etherscan

Hey fam! 👋 Ever heard the crypto mantra "Don't trust, verify"? It's super important, especially in DeFi. Today, I'm gonna walk you through how to verify FLAT Protocol's smart contracts directly on Etherscan. No need to be a Solidity wizard – just follow these steps and you'll be a pro at checking under the hood!

This guide will help you understand:

  • Where to find FLAT Protocol's core contract addresses.
  • How to navigate Etherscan to view verified source code.
  • What to look for to ensure transparency and immutability.
  • How to read key contract states like total supply and oracle prices.
  • How to check the Uniswap LP position.

Let's dive in!

FLAT Protocol's Core Contract Addresses

First things first, let's get you the addresses you'll need. These are the main brains behind FLAT Protocol:

  • CPIOracle: 0x7a65b16f3166C931f6920f32194677764A96845f
  • FlatSale: 0x42f7160359876e53E3250b9918231E7934091a1B
  • FlatReserve: 0x1927702f7415170C3138b7e289c09930C83602f7
  • FLAT Token: 0x48e1A1429947547146e25F7065091bB1eB90b4d4
  • SAVE Vault: 0x72a5aA28e9329971D0E03F3f380F951a37A4926F

How to Find Them on Etherscan

  1. Copy an address: Pick any of the addresses above. Let's start with the FLAT Token address: 0x48e1A1429947547146e25F7065091bB1eB90b4d4.
  2. Go to Etherscan: Open your browser and head to etherscan.io.
  3. Paste and search: Paste the copied address into the search bar at the top of the Etherscan page and hit Enter.

You'll now be on the contract's overview page!

What to Look For: Verification, No Proxies, No Owner Functions

Once you're on a contract's Etherscan page, here's how to verify its integrity:

  1. Verified Source Code:

    • Click on the "Contract" tab.
    • You should see a green checkmark next to "Contract Source Code Verified (Exact Match)". This means the code you're seeing on Etherscan is exactly what's deployed on the blockchain. If it's not verified, be wary!
    • You can then click on the "Read Contract" and "Write Contract" tabs to interact with the contract's public functions.
  2. No Proxy Pattern:

    • Within the "Contract" tab, scroll through the source code. For core contracts like FLAT's, you generally want to avoid "proxy" patterns unless there's a clear, documented reason for upgradeability. FLAT Protocol's core contracts are designed to be immutable, meaning their code cannot be changed after deployment.
    • You won't find references to common proxy patterns (like ERC1967Proxy or UUPSUpgradeable) in FLAT's core contracts, which is a good sign for immutability.
  3. No Owner Functions (or limited, non-critical ones):

    • Still in the "Contract" tab, look at the "Write Contract" section.
    • You're looking for an absence of functions that allow a single "owner" or "admin" to unilaterally change critical parameters, mint tokens, or drain funds.
    • For FLAT's core contracts, you'll notice that the "Write Contract" functions are primarily for user interactions (e.g., depositing into FlatReserve, buying FLAT on FlatSale) rather than privileged admin controls. This indicates decentralization and reduced risk of rug pulls.

How to Read the Contract State

This is where you can peek at the live data within the contract!

  1. Go to the "Read Contract" tab.
  2. totalSupply (for FLAT Token):
    • On the FLAT Token contract page, scroll down in the "Read Contract" section until you find totalSupply.
    • Click "Query" next to it. This will show you the total number of FLAT tokens currently in existence.
  3. Balances (for any token):
    • You can often find a balanceOf function. Enter an address (e.g., your own wallet or the FlatReserve contract address) and click "Query" to see how many tokens that address holds.
  4. Oracle Price (for CPIOracle):
    • Navigate to the CPIOracle contract address: `0x7a65b16f3166C931f6920f32194677

Top comments (0)