SNIP-21 Feedback

To @reuven @toml @assafmo - Hey guys I had a good read of the merged pr and it looks great.

Sorry if I have asked this before but do you guys have a fully functioning demo token on holodeck? I’m curious to see how things would look on a transaction viewer etc.

Hey there Steven!

We don’t have any deployed tokens yet, but we should be deploying a few example ones today.
If you need a token for experimentation though, we can deploy one for you to play around with, where you’ll have minting permissions and all that. Just tell us what’s your testnet address.

1 Like

Hey @reuven - my address is

secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr

Sounds great!

Here we go.
After compiling the current master of the reference implementation at commit b76b4b4, I uploaded the contract like this:

secretcli tx compute store contract.wasm.gz --source 'https://github.com/enigmampc/snip20-reference-impl' --from my-key -y --gas 3000000

transaction, code id: 29215

and instantiated it like this:

secretcli tx compute instantiate 29215 '{"name": "Testnet BTN Group Token", "symbol": "BTN", "decimals": 6, "admin": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr", "initial_balances": [{"address": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr", "amount": "1000000000000"}], "prng_seed": "'"$(base64 <<<'A super secret seed')"'", "config": {"public_total_supply": true, "enable_deposit": true, "enable_redeem": true, "enable_mint": true, "enable_burn": true}}' --label 'btn.group-test-1' --from my-key -y --gas 200000

transaction, address: secret1p6fur674dumdqz5r9rsxefjh7tcsvu2y4a5pue

formatted instantiation message:

{
  "name": "Testnet BTN Group Token",
  "symbol": "BTN",
  "decimals": 6,
  "admin": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
  "initial_balances": [
    {
      "address": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
      "amount": "1000000000000"
    }
  ],
  "prng_seed": "QSBzdXBlciBzZWNyZXQgc2VlZAo=",
  "config": {
    "public_total_supply": true,
    "enable_deposit": true,
    "enable_redeem": true,
    "enable_mint": true,
    "enable_burn": true
  }
}

Please note that you do not want the enable_deposit and enable_redeem settings set to true in production, but i enabled them for you here so you can experiment with how deposit/redeem would look like in the transaction history.

Your account got an initial balance of 1_000_000 BTN, which is set to have 6 decimals (like SCRT and SEFI). You can play around with those parameters yourself if you want to by running the instantiate command again with a changed message, which will create a new contract with the same code.

This token does not yet include the features from SNIP-23 as those are not merged yet and might change.

Enjoy!

1 Like

Hey guys,

I’ve loaded up a SNIP-21 demo token with a bunch of different transactions for people to have a look at the response etc.

https://btn.group/secret_network/smart_contract_interface

Config to get results:

  1. Environment: Staging / Testnet
  2. Contract address: secret1p6fur674dumdqz5r9rsxefjh7tcsvu2y4a5pue
  3. Function name: transaction_history
  4. params:
  • key: api_key_0IUwZLnAJFV2sl+psxnmoONzgaQnKMi2PuR8y2nuxxs=
  • address: secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr
  • page_size: 100

cc @reuven

Let me know if anyone wants me to make them a minter etc.
Will work this into our transactions page and let the community know soon after.

2 Likes

When i use those parameters i get
query contract failed: encrypted: {"parse_err":{"msg":"missing field `address`","target":"snip20_reference_impl::msg::QueryMsg"}} (HTTP 500)

Not sure if I am missing something

@mohammedpatla

Ah makes sense now, page_size is a number.

Works good gets me a response.

  "transaction_history": {
    "txs": [
      {
        "id": 7,
        "action": {
          "burn": {
            "burner": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "owner": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "1"
        },
        "memo": "burn from test",
        "block_time": 1622172304,
        "block_height": 3045556
      },
      {
        "id": 6,
        "action": {
          "mint": {
            "minter": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "recipient": "secret1raga8u0ap8cqqrtu36jyttm4l27xv4cs5e4hk3"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "1"
        },
        "memo": "mint test",
        "block_time": 1622171839,
        "block_height": 3045477
      },
      {
        "id": 5,
        "action": {
          "burn": {
            "burner": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "owner": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "666"
        },
        "block_time": 1622170393,
        "block_height": 3045249
      },
      {
        "id": 4,
        "action": {
          "burn": {
            "burner": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "owner": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "666"
        },
        "block_time": 1622170307,
        "block_height": 3045237
      },
      {
        "id": 3,
        "action": {
          "transfer": {
            "from": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "sender": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "recipient": "secret1raga8u0ap8cqqrtu36jyttm4l27xv4cs5e4hk3"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "777000000"
        },
        "block_time": 1622170055,
        "block_height": 3045198
      },
      {
        "id": 2,
        "action": {
          "transfer": {
            "from": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "sender": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "recipient": "secret1raga8u0ap8cqqrtu36jyttm4l27xv4cs5e4hk3"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "333000000"
        },
        "block_time": 1622170000,
        "block_height": 3045188
      },
      {
        "id": 1,
        "action": {
          "mint": {
            "minter": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr",
            "recipient": "secret1zm55tcme6epjl4jt30v05gh9xetyp9e3vvv6nr"
          }
        },
        "coins": {
          "denom": "BTN",
          "amount": "1000000000000"
        },
        "memo": "Initial Balance",
        "block_time": 1622032805,
        "block_height": 3022626
      }
    ],
    "total": 7
  }
}

I gotta say, I really like it. We will have to get keplr wallet to make some updates for that memo, but generally pretty awesome.

1 Like