base/DevMintPolicy.hpp¶
Compile-time designated-net policy for burn-less dev mints (D-03). More...
Namespaces¶
| Name |
|---|
| sgns |
Functions¶
| Name | |
|---|---|
| bool | DevMintBurnlessPermitted() True iff THIS process's own net may certify burn-less dev mints. |
Attributes¶
| Name | |
|---|---|
| constexpr std::array< uint16_t, 2 > | kDevMintPermittedNets |
Detailed Description¶
Compile-time designated-net policy for burn-less dev mints (D-03).
Date: 2026-10-21
One home for the dev-mint net rule, beside the net-id constants (sgns_version.hpp) it is built from. Contract: burn-less mints may certify through FULL consensus (proposal, quorum, certificate) ONLY on the designated nets — staging and local dev; every validator on every other net refuses them regardless of what the proposer declares. The designated set is compile-time by design: configuration can never widen it, and only a code change (this file) can add an allowance. The predicate reads ONLY version::GetNetworkID() — the validator's own process-global net identity, never a transaction or proposal field (proposer claims are attacker-chosen).
Functions Documentation¶
function DevMintBurnlessPermitted¶
True iff THIS process's own net may certify burn-less dev mints.
Return: Membership of version::GetNetworkID() in kDevMintPermittedNets.
Attributes Documentation¶
variable kDevMintPermittedNets¶
constexpr std::array< uint16_t, 2 > kDevMintPermittedNets { version::STAGING_NET_ID, version::DEV_NET_ID };
Nets where burn-less dev mints may certify through full consensus (D-03). Built from the named net-id constants — the only net literals.
Source code¶
#ifndef SGNS_DEV_MINT_POLICY_HPP
#define SGNS_DEV_MINT_POLICY_HPP
#include <algorithm>
#include <array>
#include <cstdint>
#include "base/sgns_version.hpp"
namespace sgns
{
inline constexpr std::array<uint16_t, 2> kDevMintPermittedNets{ version::STAGING_NET_ID, version::DEV_NET_ID };
inline bool DevMintBurnlessPermitted()
{
const auto net = version::GetNetworkID();
return std::find( kDevMintPermittedNets.begin(), kDevMintPermittedNets.end(), net ) !=
kDevMintPermittedNets.end();
}
} // namespace sgns
#endif // SGNS_DEV_MINT_POLICY_HPP
Updated on 2026-10-22 at 19:28:23 +0000