From 47847ac3c683225a9ee0c72d8db0835faf989363 Mon Sep 17 00:00:00 2001 From: BenAzlay Date: Tue, 11 Mar 2025 17:43:57 +0200 Subject: [PATCH] Fix: Token mint handler env removed --- src/guides/aos/token.md | 6 +++--- src/ja/guides/aos/token.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/guides/aos/token.md b/src/guides/aos/token.md index 8e6b1f6..6f80daa 100644 --- a/src/guides/aos/token.md +++ b/src/guides/aos/token.md @@ -218,13 +218,13 @@ The line `if not msg.Tags.Cast then` Means were not producing any messages to pu Finally, we will add a Handler to allow the minting of new tokens. ```lua -Handlers.add('Mint', Handlers.utils.hasMatchingTag('Action', 'Mint'), function(msg, env) +Handlers.add('Mint', Handlers.utils.hasMatchingTag('Action', 'Mint'), function(msg) assert(type(msg.Tags.Quantity) == 'string', 'Quantity is required!') - if msg.From == env.Process.Id then + if msg.From == ao.id then -- Add tokens to the token pool, according to Quantity local qty = tonumber(msg.Tags.Quantity) - Balances[env.Process.Id] = Balances[env.Process.Id] + qty + Balances[ao.id] = Balances[ao.id] + qty else ao.send({ Target = msg.Tags.From, diff --git a/src/ja/guides/aos/token.md b/src/ja/guides/aos/token.md index 5aef86c..93e3eb2 100644 --- a/src/ja/guides/aos/token.md +++ b/src/ja/guides/aos/token.md @@ -305,13 +305,13 @@ ao.send({ Finally, we will add a Handler to allow the minting of new tokens. --> ```lua -Handlers.add('mint', Handlers.utils.hasMatchingTag('Action', 'Mint'), function(msg, env) +Handlers.add('mint', Handlers.utils.hasMatchingTag('Action', 'Mint'), function(msg) assert(type(msg.Tags.Quantity) == 'string', 'Quantity is required!') - if msg.From == env.Process.Id then + if msg.From == ao.id then -- Add tokens to the token pool, according to Quantity local qty = tonumber(msg.Tags.Quantity) - Balances[env.Process.Id] = Balances[env.Process.Id] + qty + Balances[ao.id] = Balances[ao.id] + qty else ao.send({ Target = msg.Tags.From,