AVATAR (AVA) Whitepaper
v1.0.0Transparent Token Economy with On-Chain Vesting

12. Contract API Reference
모든 함수는 Proxy 주소를 통해 호출합니다.
AVAToken: 0x3aDBb3f9F9f8F9A77E4CfA100a3C197488e7ACD5
AVAVesting: 0x1a4bDdBFe0C0a4e8681d067A4a100a4760aeC95D
12.1 AVAToken — Owner Functions (ByOwner)
setVestingContractByOwner
setVestingContractByOwner(address _vesting)
AVAVesting 프록시 주소를 등록합니다. 1회만 호출 가능하며, 설정 후 변경 불가합니다.
| Parameter | Type | Description |
|---|---|---|
_vesting | address | AVAVesting 프록시 주소 |
Role: DEFAULT_ADMIN_ROLE (Owner) | Revert: VestingContractAlreadySet, ZeroAddress
burnByAdmin
burnByAdmin(address from, uint256 amount, VestingGroup group)
그룹별 조건에 따라 토큰을 소각합니다. AVAVesting의 validateBurn → adjustForBurn 순서로 검증 후 실행됩니다.
| Parameter | Type | Description |
|---|---|---|
from | address | 소각 대상 지갑 주소 |
amount | uint256 | 소각 수량 (wei) |
group | VestingGroup | 소각 대상 그룹 (enum 0~6) |
Role: ADMIN_BURNER_ROLE | Event: TokensBurned(from, amount, group)
pauseByOwner / unpauseByOwner
pauseByOwner() unpauseByOwner()
모든 토큰 전송을 일시 중지/재개합니다. 긴급 상황 시 사용합니다.
Role: OWNER_PAUSER_ROLE
12.2 AVAToken — Transfer Functions
transfer
transfer(address to, uint256 amount) → bool
ERC-20 표준 전송. 사용 가능한 잔액(Available Balance) 범위 내에서만 전송 가능합니다. 잠긴(Locked) 토큰은 전송할 수 없습니다.
| Parameter | Type | Description |
|---|---|---|
to | address | 수신자 주소 |
amount | uint256 | 전송 수량 (wei) |
Role: 없음 (누구나) | Revert: InsufficientAvailableBalance
transferFrom
transferFrom(address from, address to, uint256 amount) → bool
ERC-20 위임 전송. approve로 승인된 범위 내에서 제3자가 전송합니다. Available Balance 제한 동일 적용.
| Parameter | Type | Description |
|---|---|---|
from | address | 토큰 보유자 주소 |
to | address | 수신자 주소 |
amount | uint256 | 전송 수량 (wei) |
Role: 없음 (approve 필요) | Revert: InsufficientAvailableBalance
approve
approve(address spender, uint256 amount) → bool
ERC-20 표준 승인. 제3자(spender)가 지정 수량까지 transferFrom으로 전송할 수 있도록 허용합니다.
Role: 없음 (누구나) | Event: Approval(owner, spender, amount)
executeVestingTransfer
executeVestingTransfer(address from, address to, uint256 amount)
베스팅 전용 내부 전송. Available Balance 검사를 우회하여 잠긴 토큰을 이동합니다. AVAVesting 컨트랙트만 호출 가능합니다.
| Parameter | Type | Description |
|---|---|---|
from | address | 송신자 주소 |
to | address | 수신자 주소 |
amount | uint256 | 전송 수량 (wei) |
Role: AVAVesting 컨트랙트만 (내부 호출) | Revert: VestingTransferOnly
12.3 AVAToken — View Functions
| Function | Parameters | Returns | Description |
|---|---|---|---|
balanceOf(address) | account | uint256 | 전체 토큰 잔액 (잠긴 토큰 포함) |
totalSupply() | 없음 | uint256 | 총 발행량 (10,000,000,000 AVA) |
getAvailableBalance(address) | account | uint256 | 사용 가능한 잔액 (전송/거래 가능한 수량) |
getLockedBalance(address) | account | uint256 | 잠긴 잔액 (아직 해제되지 않은 베스팅 수량) |
getVestingContract() | 없음 | address | 연결된 AVAVesting 프록시 주소 |
allowance(address,address) | owner, spender | uint256 | 승인된 위임 전송 수량 |
name() | 없음 | string | 토큰 이름 ("AVATAR") |
symbol() | 없음 | string | 토큰 심볼 ("AVA") |
decimals() | 없음 | uint8 | 소수점 자릿수 (18) |
version() | 없음 | string | 컨트랙트 버전 ("1.0.0") |
getImplementation() | 없음 | address | 현재 Implementation 주소 (ERC-1967) |
paused() | 없음 | bool | 일시 중지 상태 여부 |
# 사용 가능 잔액 조회 cast call $TOKEN_PROXY "getAvailableBalance(address)(uint256)" $WALLET --rpc-url $RPC_URL # 버전 조회 cast call $TOKEN_PROXY "version()(string)" --rpc-url $RPC_URL
12.4 AVAVesting — Admin Functions (ByAdmin)
setGroupConfigByAdmin
setGroupConfigByAdmin( VestingGroup group, address groupWallet, uint256 totalAllocation, uint256 initialUnlock, uint256 cliffDuration, uint256 vestingDuration, StartTimeMode startTimeMode )
그룹별 베스팅 설정을 등록합니다. 1회만 호출 가능하며, cliff/vesting은 일(day) 단위 정렬 필수 (max 3,650일).
| Parameter | Type | Description |
|---|---|---|
group | VestingGroup | 그룹 enum (0:Foundation ~ 6:VC) |
groupWallet | address | 그룹 대표 지갑 주소 |
totalAllocation | uint256 | 총 배분량 (wei) |
initialUnlock | uint256 | TGE 시 즉시 해제량 (wei) |
cliffDuration | uint256 | 클리프 기간 (초, 86400 배수) |
vestingDuration | uint256 | 베스팅 기간 (초, 86400 배수) |
startTimeMode | StartTimeMode | 0: TGE 기준, 1: TransferTime 기준 |
Role: ADMIN_VESTING_MANAGER_ROLE | Event: GroupConfigSet(...)
setTGETimestampByAdmin
setTGETimestampByAdmin(uint256 timestamp)
TGE(Token Generation Event) 시점을 설정합니다. 1회만 호출 가능하며, 과거 90일 ~ 미래 365일 범위만 허용.
| Parameter | Type | Description |
|---|---|---|
timestamp | uint256 | TGE Unix 타임스탬프 (초) |
Role: ADMIN_VESTING_MANAGER_ROLE | Event: TGETimestampSet(timestamp)
distributeToGroupByAdmin
distributeToGroupByAdmin(VestingGroup group, address from, uint256 amount)
Deployer에서 그룹 지갑으로 토큰을 배분하고 초기 베스팅 스케줄을 생성합니다. 그룹당 1회만 호출 가능.
| Parameter | Type | Description |
|---|---|---|
group | VestingGroup | 대상 그룹 enum |
from | address | 토큰 보유자 (deployer) 주소 |
amount | uint256 | 배분 수량 (wei, totalAllocation과 일치) |
Role: ADMIN_VESTING_MANAGER_ROLE | Event: GroupDistributed(group, wallet, amount)
vestingTransferByAdmin
vestingTransferByAdmin( VestingGroup group, address from, address to, uint256 amount, uint256 scheduleIndex )
잠긴 토큰을 베스팅 조건과 함께 다른 지갑으로 전송합니다. 수신자는 cliff/vesting 조건을 상속받으며, initialUnlock은 상속되지 않습니다.
| Parameter | Type | Description |
|---|---|---|
group | VestingGroup | 대상 그룹 enum |
from | address | 송신자 주소 (잠긴 토큰 보유자) |
to | address | 수신자 주소 |
amount | uint256 | 전송 수량 (wei, 잠긴 토큰 범위 내) |
scheduleIndex | uint256 | 송신자의 베스팅 스케줄 인덱스 |
Role: ADMIN_VESTING_MANAGER_ROLE | Event: VestingTransferExecuted(group, from, to, amount, startTime)
groupWalletTransferByAdmin
groupWalletTransferByAdmin(VestingGroup group, address to, uint256 amount)
그룹 지갑에서 외부 지갑으로 자유잔액(해제된 토큰)을 전송합니다. 그룹 지갑은 일반 transfer가 차단되어 이 함수를 통해서만 전송 가능합니다.
| Parameter | Type | Description |
|---|---|---|
group | VestingGroup | 대상 그룹 enum |
to | address | 수신자 주소 |
amount | uint256 | 전송 수량 (wei, 자유잔액 범위 내) |
Role: ADMIN_VESTING_MANAGER_ROLE | Event: GroupWalletTransferExecuted(group, from, to, amount)
pauseByOwner / unpauseByOwner
pauseByOwner() unpauseByOwner()
모든 베스팅 작업(distributeToGroupByAdmin, vestingTransferByAdmin, groupWalletTransferByAdmin)을 일시 중지/재개합니다.
Role: OWNER_PAUSER_ROLE
12.5 AVAVesting — View Functions
| Function | Parameters | Returns | Description |
|---|---|---|---|
getAvailableBalance(address) | account | uint256 | 사용 가능 잔액 (balanceOf - totalLocked) |
getLockedBalance(address) | account | uint256 | 잠긴 잔액 (미해제 베스팅 토큰 합계) |
getUnlockedBalance(address) | account | uint256 | 해제된 잔액 (시간 경과로 해제된 토큰 합계) |
getVestingSchedules(address) | account | WalletVesting[] | 지갑의 전체 베스팅 스케줄 배열 |
getGroupConfig(VestingGroup) | group | GroupConfig | 그룹 베스팅 설정 구조체 |
getTGETimestamp() | 없음 | uint256 | TGE 타임스탬프 (0이면 미설정) |
getTokenContract() | 없음 | address | 연결된 AVAToken 프록시 주소 |
isGroupWallet(address) | account | bool | 그룹 지갑 여부 조회 |
version() | 없음 | string | 컨트랙트 버전 ("1.0.0") |
getImplementation() | 없음 | address | 현재 Implementation 주소 (ERC-1967) |
paused() | 없음 | bool | 일시 중지 상태 여부 |
# 베스팅 스케줄 조회 cast call $VESTING_PROXY "getVestingSchedules(address)" $WALLET --rpc-url $RPC_URL # 그룹 설정 조회 (0=Foundation, 1=Ecosystem, ...) cast call $VESTING_PROXY "getGroupConfig(uint8)" 0 --rpc-url $RPC_URL # TGE 타임스탬프 조회 cast call $VESTING_PROXY "getTGETimestamp()(uint256)" --rpc-url $RPC_URL
12.6 Access Control Functions
OpenZeppelin AccessControl 상속. 양쪽 컨트랙트에서 동일하게 사용 가능합니다.
| Function | Parameters | Description |
|---|---|---|
grantRole(bytes32, address) | role, account | 역할 부여 (admin만 가능) |
revokeRole(bytes32, address) | role, account | 역할 회수 (admin만 가능) |
renounceRole(bytes32, address) | role, callerAddress | 본인 역할 포기 |
hasRole(bytes32, address) | role, account | 역할 보유 여부 조회 (view) |
getRoleAdmin(bytes32) | role | 해당 역할의 관리 역할 조회 (view) |
12.7 Role Constants
| Role | Category | Value | 사용 컨트랙트 | 권한 |
|---|---|---|---|---|
DEFAULT_ADMIN_ROLE | Owner | 0x00 | Token, Vesting | 모든 역할 관리, 초기 설정 |
OWNER_PAUSER_ROLE | Owner | keccak256("OWNER_PAUSER_ROLE") | Token, Vesting | pauseByOwner / unpauseByOwner |
OWNER_UPGRADER_ROLE | Owner | keccak256("OWNER_UPGRADER_ROLE") | Token, Vesting | UUPS 업그레이드 실행 |
ADMIN_VESTING_MANAGER_ROLE | Admin | keccak256("ADMIN_VESTING_MANAGER_ROLE") | Vesting | 그룹 설정, TGE, 배분, 베스팅 전송, 그룹지갑 전송 |
ADMIN_BURNER_ROLE | Admin | keccak256("ADMIN_BURNER_ROLE") | Token | 조건부 토큰 소각 |
12.8 Data Types
VestingGroup (enum)
| Value | Name | Allocation |
|---|---|---|
| 0 | Foundation | 25% |
| 1 | Ecosystem | 20% |
| 2 | Marketing | 15% |
| 3 | Liquidity | 15% |
| 4 | TeamAdvisor | 10% |
| 5 | Partnership | 5% |
| 6 | VC | 10% |
StartTimeMode (enum)
| Value | Name | Description |
|---|---|---|
| 0 | TGE | TGE 타임스탬프 기준으로 베스팅 시작 |
| 1 | TransferTime | vestingTransferByAdmin 시점 기준으로 베스팅 시작 |
GroupConfig (struct)
| Field | Type | Description |
|---|---|---|
groupWallet | address | 그룹 대표 지갑 주소 |
totalAllocation | uint256 | 총 배분량 (wei) |
initialUnlock | uint256 | TGE 즉시 해제량 (wei) |
cliffDuration | uint256 | 클리프 기간 (초) |
vestingDuration | uint256 | 베스팅 기간 (초) |
startTimeMode | StartTimeMode | 베스팅 시작 기준 (TGE/TransferTime) |
isConfigured | bool | 설정 완료 여부 |
WalletVesting (struct)
| Field | Type | Description |
|---|---|---|
group | VestingGroup | 소속 그룹 |
totalAmount | uint256 | 총 베스팅 수량 (wei) |
initialUnlock | uint256 | 즉시 해제량 (wei) |
startTime | uint256 | 베스팅 시작 시점 (unix) |
cliffDuration | uint256 | 클리프 기간 (초) |
vestingDuration | uint256 | 베스팅 기간 (초) |