3

I go through this repo https://github.com/unicoeos/eosio.nft and set contract and provide permission successfully on my local nodeos.

I successfully created a token CCN but I am not able to push the action issue. issue action is like :

void nft::issue( account_name to,
                     asset quantity,
                     vector<string> uris,
                     string name,
                     string memo)
    {

    eosio_assert( is_account( to ), "to account does not exist");

        // e,g, Get EOS from 3 EOS
        symbol_type symbol = quantity.symbol;
        eosio_assert( symbol.is_valid(), "invalid symbol name" );
        eosio_assert( symbol.precision() == 0, "quantity must be a whole number" );
        eosio_assert( memo.size() <= 256, "memo has more than 256 bytes" );

    eosio_assert( name.size() <= 32, "name has more than 32 bytes" );
    eosio_assert( name.size() > 0, "name is empty" );

        // Ensure currency has been created
        auto symbol_name = symbol.name();
        currency_index currency_table( _self, symbol_name );
        auto existing_currency = currency_table.find( symbol_name );
        eosio_assert( existing_currency != currency_table.end(), "token with symbol does not exist, create token before issue" );
        const auto& st = *existing_currency;

        // Ensure have issuer authorization and valid quantity
        require_auth( st.issuer );
        eosio_assert( quantity.is_valid(), "invalid quantity" );
        eosio_assert( quantity.amount > 0, "must issue positive quantity of NFTs" );
        eosio_assert( symbol == st.supply.symbol, "symbol precision mismatch" );

        // Increase supply
    add_supply( quantity );

        // Check that number of tokens matches uri size
        eosio_assert( quantity.amount == uris.size(), "mismatch between number of tokens and uris provided" );

        // Mint nfts
        for(auto const& uri: uris) {
            mint( to, st.issuer, asset{1, symbol}, uri, name);
        }

        // Add balance to account
        add_balance( to, quantity, st.issuer );
    }

My question is what is uris here? Is this is a vector of all tokens that i have created?

1

You have to pass some unique string for every token. For an example if you want to issue 2 token then you need to run this command

cleos push action ac_name issue '["ac_name2","2 CCN",["firsttoken","secondtoken"],"This is MEMO"]' -p ac_name

Try this.

2
  • Yes this is true, but what is the significance of this, because uri and id both are store in the table. – Nirdesh Kumar Choudhary Sep 19 '18 at 12:19
  • May be if you use it in game development likely to develop different avtars(or unique assets) you can set own uri of that purpose. – Mr.Y Sep 19 '18 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.