Documentation Index
Fetch the complete documentation index at: https://docs.stablenet.network/llms.txt
Use this file to discover all available pages before exploring further.
StableNet 테스트넷에서 WKRC를 전송하고 Explorer에서 확인하세요.
시작 전 준비
- StableNet 테스트넷을 지갑에 추가하세요 (StableNet 연결하기)
- Faucet에서 테스트넷 WKRC를 받아두세요
- Node.js ≥ 18 (ethers.js / viem) 또는 Foundry (cast)를 설치하세요
ethers.js로 전송하기
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider(
"https://api.test.stablenet.network"
);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
const tx = await wallet.sendTransaction({
to: "0x수신자_주소",
value: ethers.parseEther("0.01"), // 0.01 WKRC
maxPriorityFeePerGas: ethers.parseUnits("27600", "gwei"), // 최소 팁
});
console.log("tx hash:", tx.hash);
const receipt = await tx.wait();
console.log("포함된 블록:", receipt?.blockNumber);
Private key를 코드에 직접 넣지 마세요. 환경 변수나 키스토어를 사용하세요.
viem으로 전송하기
import { createWalletClient, createPublicClient, http, parseEther, parseGwei, defineChain } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const stablenet = defineChain({
id: 8283,
name: "StableNet Testnet",
nativeCurrency: { name: "WKRC", symbol: "WKRC", decimals: 18 },
rpcUrls: { default: { http: ["https://api.test.stablenet.network"] } },
blockExplorers: {
default: { name: "Explorer", url: "https://explorer.stablenet.network" },
},
});
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = createWalletClient({ account, chain: stablenet, transport: http() });
const publicClient = createPublicClient({ chain: stablenet, transport: http() });
const hash = await client.sendTransaction({
to: "0x수신자_주소",
value: parseEther("0.01"),
maxPriorityFeePerGas: parseGwei("27600"),
});
const receipt = await publicClient.waitForTransactionReceipt({ hash });
console.log("포함된 블록:", receipt.blockNumber);
Foundry cast로 전송하기
cast send 0x수신자_주소 \
--value 0.01ether \
--priority-gas-price 27600gwei \
--rpc-url https://api.test.stablenet.network \
--private-key $PRIVATE_KEY
blockHash 0xabc...
blockNumber 78547
transactionHash 0xdef...
status 1 (success)
Explorer에서 확인하기
explorer.stablenet.network에서 트랜잭션 해시를 검색해 결과를 확인하세요:
- Status: Success
- From: 내 지갑 주소
- To: 수신자 주소
- Value: 전송한 WKRC 양
StableNet은 1초 확정 보장(Deterministic Finality)을 제공합니다. 블록에 포함되는 순간 트랜잭션이 확정되므로 추가 컨펌을 기다릴 필요가 없습니다.
가스 팁 최소 요건
StableNet은 maxPriorityFeePerGas 최솟값 27,600 Gwei가 필요합니다. 이보다 낮으면 트랜잭션이 거부됩니다. 위 예시는 모두 이 값을 포함하고 있습니다.
다음 단계
컨트랙트 배포하기
Foundry로 Solidity 컨트랙트를 배포하세요.
수수료 위임
앱이 사용자 대신 가스비를 대납하도록 설정하세요.