목차

  1. 목차
  2. 상태
  3. 블록 시작
  4. 매개변수
  5. 이벤트

상태

매개변수

  • Params: mint/params -> legacy_amino(params)
protobuf
message Params {
  option (amino.name) = "client/x/mint/Params";

  // type of coin to mint
  string mint_denom = 1;
  // inflation amount per year
  string inflations_per_year = 2 [
    (cosmos_proto.scalar)  = "cosmos.Dec",
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable)   = false
  ];
  // expected blocks per year
  uint64 blocks_per_year = 3;
}

블록 시작

발행 매개변수는 각 블록의 시작에 계산되고 인플레이션이 지급됩니다.

인플레이션 금액 계산

인플레이션 금액은 “인플레이션 계산 함수”를 사용하여 계산됩니다. 이 함수는
함수에 NewAppModule 전달됩니다. 함수가 전달되지 않으면 SDK의 기본 인플레이션 함수가 사용됩니다 (DefaultInflationCalculationFn). 사용자 정의 인플레이션 계산 로직이 필요한 경우, InflationCalculationFn의 서명과 일치하는 함수를 정의하고 전달하여 이를 달성할 수 있습니다.

type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, bondedRatio math.LegacyDec) math.LegacyDec

매개변수

발행 모듈에는 다음과 같은 매개변수가 포함되어 있습니다:

타입예시
MintDenomstring”stake”
InflationsPerYearstring (dec)“20000000000000000”
BlocksPerYearstring (uint64)“10368000”
  • MintDenom는 사용되는 코인 분모입니다.
  • InflationsPerYear는 1e18 소수점으로 표현된 연간 목표 인플레이션입니다.
  • BlocksPerYear는 연간 목표 블록 수입니다.

이벤트

발행 모듈은 다음과 같은 이벤트를 발생시킵니다:

BeginBlocker

타입속성 키속성 값
mintamount”1000”