# SponsorFee
SponsorFee
is a structure that sets up sponsorship. For information about sponsorship, see the Sponsored Fee article. The sponsorship setup is performed only if the structure is included in the resulting expression of the callable function. See details in the Callable Function article.
The sponsorship setup is only available if the asset is issued by a dApp account (by the same script invocation as well) and is not a smart asset.
# Constructor
SponsorFee(assetId: ByteVector, minSponsoredAssetFee: Int|Unit)
# Fields
# | Name | Data type | Description |
---|---|---|---|
1 | assetId | ByteVector | Asset ID |
2 | minSponsoredAssetFee | Int|Unit | Amount of sponsored asset that is equivalent to 0.001 WAVES: an integer value specified in the atomic units of sponsored asset.unit — disable the sponsorship |
# Example
{-# STDLIB_VERSION 8 #-}
{-# CONTENT_TYPE DAPP #-}
{-# SCRIPT_TYPE ACCOUNT #-}
@Callable(i)
func issueAndSponsor() = {
let issue = Issue("Spring", "", 100000, 2, true, unit, 0)
let id = calculateAssetId(issue)
(
[
issue,
SponsorFee(id, 300)
],
unit
)
}
The issueAndSponsor
callable function issues an asset and enables sponsorship. The minimum fee in sponsored asset is 3 Spring.
Limitations on the total number of script actions are given in the Limitations article.