aergoio / ARC1

aergo standard token contract extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to create token with maxSupply option in alphaNet

hayarobi opened this issue · comments

I tried to deploy a new token calling factory contract of AlphaNet written in README file - AmhfonWtSJQ2j1A963zjMdtMKr94RKyUpgAoYVff3Db4gjNgTwy1 - , but the result was failure.
I set the mintable option true.

The tx hash of failed new_token call to factory is [7VN4kSQtiiuAdFRXzXdrYY8J3HtRA2pytYjx3mShrCtY](https://alpha.aergoscan.io/transaction/7VN4kSQtiiuAdFRXzXdrYY8J3HtRA2pytYjx3mShrCtY)

the payload was below;

{
  "Name": "new_token",
  "Args": [
    "SG alpha token1",
    "SGALP1",
    18,
    "1000000000000000000000000",
    {
      "mintable": true,
      "max_supply": "500000000000000000000000000",
      "burnable": true,
      "pausable": false,
      "blacklist": true,
      "all_approval": false,
      "limited_approval": true
    },
    ""
  ]
}

, and the error message was [Contract.LuaDeployContract] call err:[string "0caa0412994636bdfc61529e063ca9de1864f534a93a123241ba99d86f37d61d77"]:0: attempt to call global '_setMaxSupply' (a nil value).

Hello Hayarobi,

The factory contract is outdated on the alpha network. I will make some new changes to the code and then deploy it again, after tests.

In the meanwhile you can use the factory in the testnet: AmgXrg6JC7NT4URYhop1G4QaQme9WtdV7CX6dvawJekEk52bBBZw


Notice that when creating tokens via the factory the initial_supply and max_supply should not contain the decimals!

Example: when starting with 1000 tokens the initial supply must be "1000"

The factory will add the zeros accordingly, as seen here

The new contract was deployed. You can check the address here

Please inform if you have any problem

Hello, kroggen,

Thanks for the fast response.

Notice that when creating tokens via the factory the initial_supply and max_supply should not contain the decimals!

Example: when starting with 1000 tokens the initial supply must be "1000"

The factory will add the zeros accordingly, as seen here

I often confused with the unit and decimals a lot.