Sub topic 12
Verifying Vesting Schedules Against On-Chain Data
This chapter assumes you know wallets, transactions, token decimals, and basic vesting terms such as cliff, duration, TGE, and linear release. The goal is to test whether a published schedule matches what a blockchain contract can actually release.
A published spreadsheet is a claim. The vesting contract is the enforcement mechanism. Compare both instead of trusting either one alone.
Start with the correct contract
First identify:
- The blockchain network.
- The token contract address.
- The vesting contract address.
- The beneficiary address.
- The contract's verified source code and ABI, if available.
An ABI is a description of a contract's callable functions and events. A block explorer may show the ABI when the contract source is verified.
Do not assume that every contract uses the same schedule. Some contracts use a standard linear formula. Others use monthly batches, manually approved releases, multiple beneficiaries, or a proxy contract whose logic lives at another address.
| Evidence | What it can confirm |
|---|---|
| Contract calls | Start time, duration, beneficiary, released amount, and currently releasable amount |
| Token transfer logs | Tokens actually sent from the vesting contract |
| Verified source and ABI | The formula and rules used by the contract |
| Published allocation table | The project's stated total and ownership terms |
Reconstruct the contract's formula
A common vesting contract uses this model:
- Before the cliff, vested amount is zero or only the TGE amount.
- During the release period, vested amount increases with elapsed time.
- At the end, the full allocation is vested.
- The beneficiary can claim vested tokens that have not already been released.
The important distinction is:
vested: the amount the contract says the beneficiary has earned so far.released: the amount already transferred.releasable: usuallyvested - released.
A contract may hold tokens that are not yet vested. Its token balance therefore does not prove that all those tokens are available to the beneficiary.
Query an OpenZeppelin-compatible contract
The following example reads an Ethereum-compatible chain through an RPC endpoint. It assumes an OpenZeppelin-style VestingWallet with one beneficiary. Install the dependency with pip install web3, then set the three environment variables before running it.
import os
from decimal import Decimal
from web3 import Web3
rpc_url = os.environ["RPC_URL"]
token_address = Web3.to_checksum_address(os.environ["TOKEN_ADDRESS"])
vesting_address = Web3.to_checksum_address(os.environ["VESTING_ADDRESS"])
w3 = Web3(Web3.HTTPProvider(rpc_url))
if not w3.is_connected():
raise RuntimeError("RPC connection failed")
vesting_abi = [
{"inputs": [], "name": "beneficiary", "outputs": [{"type": "address"}],
"stateMutability": "view", "type": "function"},
{"inputs": [], "name": "start", "outputs": [{"type": "uint64"}],
"stateMutability": "view", "type": "function"},
{"inputs": [], "name": "duration", "outputs": [{"type": "uint64"}],
"stateMutability": "view", "type": "function"},
{"inputs": [{"name": "token", "type": "address"}], "name": "released",
"outputs": [{"type": "uint256"}], "stateMutability": "view", "type": "function"},
{"inputs": [{"name": "token", "type": "address"}], "name": "releasable",
"outputs": [{"type": "uint256"}], "stateMutability": "view", "type": "function"},
{"inputs": [{"name": "token", "type": "address"},
{"name": "timestamp", "type": "uint64"}],
"name": "vestedAmount", "outputs": [{"type": "uint256"}],
"stateMutability": "view", "type": "function"},
]
token_abi = [
{"inputs": [], "name": "decimals", "outputs": [{"type": "uint8"}],
"stateMutability": "view", "type": "function"},
]
vesting = w3.eth.contract(address=vesting_address, abi=vesting_abi)
token = w3.eth.contract(address=token_address, abi=token_abi)
decimals = token.functions.decimals().call()
now = int(w3.eth.get_block("latest")["timestamp"])
start = vesting.functions.start().call()
duration = vesting.functions.duration().call()
vested = vesting.functions.vestedAmount(token_address, now).call()
released = vesting.functions.released(token_address).call()
releasable = vesting.functions.releasable(token_address).call()
def display(raw):
return Decimal(raw) / (Decimal(10) ** decimals)
print("beneficiary:", vesting.functions.beneficiary().call())
print("start:", start)
print("duration_seconds:", duration)
print("vested:", display(vested))
print("released:", display(released))
print("releasable:", display(releasable))
assert releasable == vested - releasedThe final assertion checks the contract's internal accounting at the current block. It does not prove that the published allocation is correct. To test that claim, compare the contract's total funding and beneficiary records with the allocation table.
Check transfers and edge cases
Use the token's Transfer event logs to find actual payments. Record the transaction hash, block timestamp, sender, recipient, and raw token amount. Convert raw units using the token's decimals value, not a guessed number.
Watch for these failure modes:
- The address is a treasury or multisignature wallet, not a vesting contract.
- A proxy hides the implementation containing the schedule.
- The contract has several beneficiaries or several token addresses.
- The published date uses local time while the contract uses Unix seconds.
- A pause, revocation, or administrative override changes release behavior.
- A schedule was migrated to a new contract without updating public documents.
Exercise
A contract reports 1,000 tokens vested, 300 released, and 700 releasable. Its token balance is 2,000 tokens. How many tokens can the beneficiary claim now, and why can the remaining balance not be counted as immediately available?
Show answer
The beneficiary can claim 700 tokens. The other 1,300 tokens in the contract are either already released accounting, not yet vested, or reserved for another rule. Contract balance alone does not determine current availability.