Implementing Vote Delegation in Mobile DAO Applications
Delegation — an ERC20Votes mechanism (OpenZeppelin) that allows token holders to transfer voting power to another address without transferring tokens themselves. Until a user calls delegate(), their tokens don't count in Governor voting — even with 10,000 UNI on the balance.
This is a frequent source of confusion: user bought tokens but can't vote. The first DAO app screen should solve exactly this problem.
Checking Delegation Status
// iOS — checking if votes are delegated
func getDelegationStatus(holder: EthereumAddress) async throws -> DelegationStatus {
let delegatee = try await governanceToken.delegates(account: holder)
let votingPower = try await governanceToken.getVotes(account: holder)
if delegatee == .zero {
return .notDelegated
} else if delegatee == holder {
return .selfDelegated(votes: votingPower)
} else {
return .delegatedTo(address: delegatee, votes: votingPower)
}
}
On .notDelegated — show banner "You haven't activated voting rights yet". "Delegate" button right in the banner.
Delegation Flow
Two options: delegate to yourself or another address.
Self-delegation — most common case. Function delegate(holder) — single transaction. After confirmation user sees their voting power.
Delegating to another — select address (manual input, ENS, or contacts). Show ENS name if available: vitalik.eth is clearer than 0xd8dA....
// Android — calling delegate via web3j
suspend fun delegateVotes(delegatee: String): String {
val function = Function(
"delegate",
listOf(Address(delegatee)),
emptyList()
)
val encodedFunction = FunctionEncoder.encode(function)
val txHash = web3j.ethSendRawTransaction(
buildSignedTx(to = tokenContractAddress, data = encodedFunction)
).send().transactionHash
return txHash
}
After delegation — update voting power indicator on DAO main screen.
Revoking Delegation
delegate(holder) with user's own address — redelegates to self. There's no separate "revoke" function: you can't remove delegatee without specifying new one. Explain in UI: "Delegate to yourself" instead of "Revoke".
Delegates Screen
For DAOs with public delegate lists (Compound, Uniswap, ENS) — show list with voting power, delegator count, voting history. Data via Tally API or custom The Graph subgraph.
Timeline: 2–3 days: checking status, delegating to self/other, ENS resolution, updating voting power UI.







