Skip to main content

compute_token_unshield_with_shielded_fee_fee

Function compute_token_unshield_with_shielded_fee_fee 

Source
pub fn compute_token_unshield_with_shielded_fee_fee(
    token_actions: usize,
    fee_actions: usize,
    platform_version: &PlatformVersion,
) -> Result<Credits, ProtocolError>
Expand description

The fee of a TokenUnshieldWithShieldedFee: both bundles plus the recipient’s token balance item, priced as the insert it is for a recipient who has never held this token.

The recipient only has to be an existing identity, not an existing holder, so the balance item usually does not exist yet and the write creates it. The component is the insert’s cost for every recipient alike: credit_amount is public and must equal this fee exactly, so a fee that distinguished the two cases would publish whether the recipient is holding this token for the first time. See SHIELDED_TOKEN_BALANCE_INSERT_STORAGE_BYTES.