Skip to main content

ENJ Infusion

Introduction to ENJ Infusion

ENJ Infusion is an innovative feature of the Enjin Blockchain that allows users to lock Enjin Coin (ENJ) into tokens they create, whether they are NFT

s or Multi-Unit Tokens. This process effectively embeds ENJ into digital assets, providing them with inherent, tangible value. The infused ENJ can only be retrieved when the token is burned, a process known as "melting," ensuring that the token retains its value until it is destroyed.

Why ENJ Infusion is Needed

ENJ Infusion adds a new layer of value and security to digital assets on the Enjin Blockchain. By tying tokens to a specific amount of ENJ, creators can guarantee a base value for their assets, which can:

  • Enhance user confidence and trust in the token's worth.
  • Provide a tangible backing that can incentivize acquiring the token.
  • Create a more stable and secure environment for trading and utilizing NFTs and Multi-Unit Tokens.

Use Cases and Scenarios

ENJ Infusion can be utilized in various applications and games to enhance user experience and provide additional value:

  1. Gaming Rewards: Game developers can infuse ENJ into in-game items, ensuring players that their rewards have real-world value. For example, a rare sword in an RPG game could have 5 ENJ infused into it, making it not just valuable within the game but also outside of it.
  2. Digital Collectibles: Creators of digital art and collectibles can infuse ENJ into their NFTs, providing buyers with a guaranteed minimum value. This can make digital art more appealing to collectors, knowing that their collectible is backed by ENJ.
  3. Loyalty Programs: Businesses can create loyalty tokens with infused ENJ, giving customers a tangible value for their loyalty points. For instance, a company could issue tokens with 0.1 ENJ each, which customers can collect and later melt for ENJ.
  4. Crowdfunding and Fundraising: Projects can issue tokens with infused ENJ to backers, ensuring that their contributions hold value. This can increase trust and participation in crowdfunding campaigns.
  5. In-Game Incentives: Game developers can incentivize players to spend more time in their games by infusing additional ENJ into their items for performing certain tasks or achieving milestones.

By integrating ENJ Infusion, creators and developers can provide enhanced value and security for their digital assets, fostering a more robust and trustworthy ecosystem on the Enjin Blockchain.


Creating a Token with Infused ENJ

To create a token with Infused ENJ, follow the Creating Tokens guide and set the Infuse ENJ amount on the token creation form.

When creating the token through the API, set the infusion field on the createToken action of CreateTransaction:

mutation {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
createToken: {
recipient: "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f"
collectionId: 3298
tokenId: 1
initialSupply: 1
listingForbidden: false
infusion: 5000000000000000000 # 5 ENJ in base units
anyoneCanInfuse: false
}
}
) { uuid action state }
}
Calculating the infusion amount

The Platform accepts infusion values in the base unit (integers), not decimal ENJ amounts. To calculate the correct input, multiply your desired ENJ amount by 10^18 (1 quintillion).

  • Formula: Desired ENJ infusion * 1,000,000,000,000,000,000
  • Example: To infuse a token with 5 ENJ, input 5000000000000000000.

Anyone Can Infuse

By default, ENJ infusion is restricted to the collection owner. Setting anyoneCanInfuse: true lets any account add ENJ infusion to the token.

This can be set at token creation via the createToken action above, or toggled on an existing token with the mutateToken action:

mutation {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mutateToken: {
collectionId: 3298
tokenId: 1
anyoneCanInfuse: true
}
}
) { uuid action state }
}

Infusing ENJ to an existing token

To add ENJ infusion to a token that already exists, use the infuseToken action on CreateTransaction:

Calculating the infusion amount

The Platform accepts infusion values in the base unit (integers), not decimal ENJ amounts. To calculate the correct input, multiply your desired ENJ amount by 10^18 (1 quintillion).

  • Formula: Desired ENJ infusion * 1,000,000,000,000,000,000
  • Example: To infuse a token with 5 ENJ, input 5000000000000000000.
SDKs are not yet available

The C# and C++ SDK examples below are out of date and will not work against the current Enjin Platform API. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.

mutation InfuseToken {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
infuseToken: {
collectionId: 3298
tokenId: 1
amount: 5000000000000000000 # 5 ENJ in base units
}
}
) {
uuid
action
state
}
}

You can only infuse ENJ into an existing token if you are the collection owner, or if the token's anyoneCanInfuse state is set to true.

Batched infusions

To infuse ENJ across multiple tokens in a single on-chain transaction, use the infuseTokens (plural) discriminator action. See the Tokens mutations reference for its input shape.

Once an infusion transaction reaches FINALIZED, a MultiTokens.Infused event is emitted with the collection ID, token ID, account, and amount infused. See Working with Events for how to read it.