Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

가스 가격 책정 참조

Stable을 위한 트랜잭션 구성, 가스 추정 및 툴링 구성.

트랜잭션 구성

Stable에서 트랜잭션을 구성할 때 maxPriorityFeePerGas0으로 설정하세요. 클라이언트는 가장 최근 블록에서 최신 기준 수수료를 가져와 maxFeePerGas를 계산할 때 안전 마진을 포함해야 합니다.

// ethers.js v6
const block = await provider.getBlock("latest");
const baseFee = block.baseFeePerGas;
 
const maxPriorityFeePerGas = 0n; // Stable에서는 항상 0
const maxFeePerGas = baseFee * 2n + maxPriorityFeePerGas; // 안전 마진으로 기준 수수료의 두 배
 
const tx = await wallet.sendTransaction({
  to: "0xRecipientAddress",
  value: parseEther("0.01"),
  maxFeePerGas,
  maxPriorityFeePerGas,
});
기본 USDT0 전송 확인됨. 기준 수수료 = 1 gwei일 때 수수료 ≈ 0.0000021 USDT0.

가스 추정

이더리움에서처럼 eth_estimateGaseth_gasPrice를 사용하세요. 주요 차이점은 eth_maxPriorityFeePerGas가 항상 0을 반환한다는 것입니다.

const gasPrice = await provider.send("eth_gasPrice", []);
const gasEstimate = await provider.estimateGas({
  to: contractAddress,
  data: callData,
});
 
const estimatedFeeInUSDT0 = gasPrice * gasEstimate;

툴링 구성

  • Hardhat / Foundry: 특별한 구성이 필요하지 않으며, 표준 EVM 설정이 작동합니다. 구성에서 우선순위 수수료를 명시적으로 설정하는 경우 0으로 설정하세요.
  • 월렛: 우선순위 팁 입력 필드를 숨기거나 비활성화하세요. 값을 표시하면 해당 값이 효과가 없으므로 사용자가 혼란스러워할 수 있습니다.
  • 모니터링: 수수료 분석 대시보드는 우선순위 수수료를 추적해서는 안 됩니다. 항상 0이 됩니다.

다음 권장 사항

  • 가스 가격 책정 개념: Stable이 단일 구성 요소 수수료 모델을 사용하는 이유를 이해하세요.
  • 이더리움 비교: 이더리움에서 포팅할 때 발생할 수 있는 모든 동작 차이점을 검토하세요.
  • JSON-RPC API: Stable이 노출하는 eth_* 메서드를 참조하세요.