DAO Contracts
Technical reference for KalyDAO smart contracts.
Contract Addresses
Redeployed on the new chain
KalyDAO was redeployed when KalyChain relaunched on chain ID 3890. The governance token is
now gKMT (it wraps native KMT). All addresses from the old chain 3888 and testnet 3889 are
retired.
| Contract | Address |
|---|---|
| Governance Token (gKMT) | 0xf05c285340FC6DE9fC1a8F225b553DF21f47aFA8 |
| Governor | 0xf889D405710b7746A48f177506d621ed37f65F65 |
| Timelock | 0xBD2d65Bfddbd220572121F9D2042006e21181dA5 |
| DAO Settings | 0x07272a62e1C80dB9b74f551693e23749DB2EDaD1 |
| Treasury | 0xDF8CFefEa7DaA5E5B23c262A461aCcA6356BCA90 |
Governance Parameters
| Parameter | Value |
|---|---|
| Voting delay | 43,200 blocks (~1 day) |
| Voting period | 129,600 blocks (~3 days) |
| Quorum | 4% of gKMT supply |
| Timelock minimum delay | 3,600 seconds (1 hour) |
Contract Architecture
Governance Token (gKMT)
Wraps native KMT to enable voting.
Based on: OpenZeppelin ERC20Votes
Key Functions:
// Deposit native KMT, receive gKMT
function deposit() public payable;
// Withdraw native KMT, burn gKMT
function withdraw(uint256 amount) public;
// Delegate voting power
function delegate(address delegatee) public;
Features:
- 1:1 backing with native KMT
- Voting power through delegation
- Permissionless wrap/unwrap
Governor Contract
Manages proposals and voting.
Based on: OpenZeppelin Governor
Key Functions:
// Create a new proposal
function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public returns (uint256 proposalId);
// Cast a vote
function castVote(uint256 proposalId, uint8 support) public returns (uint256);
// Queue a successful proposal
function queue(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) public returns (uint256);
// Execute after timelock
function execute(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) public returns (uint256);
Parameters:
- Quorum: 4%
- Voting Delay: 302,400 blocks (~1 week)
- Voting Period: 604,800 blocks (~1 week)
Timelock Contract
Provides security delay between proposal approval and execution.
Based on: OpenZeppelin TimelockController
Minimum Delay: 3,600 seconds (1 hour)
Treasury Vault
Holds community funds, controlled by governance.
Features:
- Holds native KMT
- Holds any ERC20 token
- Only Timelock can execute transfers
Integration Guide
Ethers.js Example
import { ethers } from 'ethers';
const GOVERNANCE_TOKEN = '0x4BA2369743c4249ea3f6777CaF433c76dBBa657a';
const GOVERNOR = '0xF6C1af62e59D3085f10ac6F782cFDaE23E6352dE';
// Wrap KMT
async function wrapKMT(signer, amount) {
const tx = await signer.sendTransaction({
to: GOVERNANCE_TOKEN,
value: ethers.parseEther(amount)
});
return tx.wait();
}
// Delegate voting power
async function delegate(signer, delegatee) {
const token = new ethers.Contract(GOVERNANCE_TOKEN, [
'function delegate(address delegatee)'
], signer);
return token.delegate(delegatee);
}
// Get voting power
async function getVotes(provider, address) {
const token = new ethers.Contract(GOVERNANCE_TOKEN, [
'function getVotes(address account) view returns (uint256)'
], provider);
return token.getVotes(address);
}
Source Code
- dao-contracts — Smart contracts
- KalyDAO — Frontend interface
Further Reading
- Voting Guide — How to participate
- Proposals Guide — Creating proposals
- OpenZeppelin Governor Docs