Signature
Description
Creates a B-20 token of the givenvariant at the deterministic address derived
from (variant, msg.sender, salt), then dispatches each entry in initCalls on
the new token. Emits B20Created.
Dev: Reverts with NonPayable when ETH is attached to the call.
Dev: Reverts with IActivationRegistry.FeatureNotActivated when the variant feature is not activated.
Dev: Reverts with InvalidVariant when variant is outside the B20Variant range.
Dev: Reverts with UnsupportedVersion when the leading version byte in params is unrecognized for variant.
Dev: Reverts with MissingRequiredField when a required string field is empty (e.g. stablecoin currency).
Dev: Reverts with InvalidCurrency when a stablecoin currency is non-empty but contains a non-A-Z byte.
Dev: Reverts with InvalidDecimals when an asset decimals is outside [B20Constants.MIN_ASSET_DECIMALS, B20Constants.MAX_ASSET_DECIMALS].
Dev: Reverts with TokenAlreadyExists when a token already exists at the derived address.
Dev: Reverts with InitCallFailed (or the bubbled inner reason) when any entry in initCalls reverts.
Dev: Each initCall executes on the new token within the creation (bootstrap) window, during which
factory-originated calls bypass the token’s role gates and its transfer-side policy gates
(TRANSFER_SENDER_POLICY, TRANSFER_RECEIVER_POLICY, TRANSFER_EXECUTOR_POLICY) — so admin-gated
setup (e.g. grantRole, updatePolicy, updateSupplyCap) and bootstrap transfers succeed without
the factory holding any role. The bypass is deliberately NOT total:
MINT_RECEIVER_POLICYis ALWAYS enforced, including for factory-originated mints, so new supply is never issued to a policy-denied recipient even at creation. AninitCallsbundle that sets a restrictiveMINT_RECEIVER_POLICYand then mints to a non-authorized account revertsPolicyForbids(MINT_RECEIVER_POLICY, ...)(bubbled out ofcreateB20).- Pause is never bypassed. It defaults to nothing-paused at creation, so a start-paused
configuration must sequence its
pause(...)call last among theinitCalls. - Token invariants (supply-cap math, balance accounting) are never bypassed.
The window closes when
createB20returns; the factory retains no persisted access. Param: variant Which variant structparamsdecodes as. Param: salt Caller-chosen salt for deterministic address derivation. Param: params ABI-encoded variant-specific creation struct, leading with the version byte. Param: initCalls Bootstrap calls invoked on the new token after identity is sealed. Return: token The address of the newly created token.