README.md
contract
    Cargo.toml
    README.md
    build.sh
    compile.js
    src
        approval.rs
        enumeration.rs
        events.rs
        internal.rs
        lib.rs
        metadata.rs
        mint.rs
        nft_core.rs
        royalty.rs
    target
        .rustc_info.json
        debug
            .fingerprint
                Inflector-4abb4462752984fb
                    lib-inflector.json
                autocfg-491f31ad758e1582
                    lib-autocfg.json
                borsh-derive-982fdfb48f69be92
                    lib-borsh-derive.json
                borsh-derive-internal-d50c46e06158b7c9
                    lib-borsh-derive-internal.json
                borsh-schema-derive-internal-884c287726cd4214
                    lib-borsh-schema-derive-internal.json
                byteorder-4678558b19904739
                    build-script-build-script-build.json
                convert_case-6422071f72e7eeb3
                    lib-convert_case.json
                derive_more-4527320901fb28de
                    lib-derive_more.json
                generic-array-c6f78d1a2dcbb951
                    build-script-build-script-build.json
                hashbrown-0ebaa7762b17f35a
                    build-script-build-script-build.json
                hashbrown-625fe97f72ab7efd
                    run-build-script-build-script-build.json
                hashbrown-97def125353ac13b
                    lib-hashbrown.json
                indexmap-4381a46e87fd75a0
                    build-script-build-script-build.json
                indexmap-87b1d90a3f722fe4
                    run-build-script-build-script-build.json
                indexmap-d7eec4f9d0810f6e
                    lib-indexmap.json
                itoa-18955514e94ee3df
                    lib-itoa.json
                memchr-d172e178d0380546
                    build-script-build-script-build.json
                near-rpc-error-core-ddca5d56afa3e3a3
                    lib-near-rpc-error-core.json
                near-rpc-error-macro-cb50414efa6bf5ea
                    lib-near-rpc-error-macro.json
                near-sdk-core-7ff3e94a18e2d77b
                    lib-near-sdk-core.json
                near-sdk-macros-9c5676e0a1778150
                    lib-near-sdk-macros.json
                num-bigint-087b98528bb17d3a
                    build-script-build-script-build.json
                num-integer-66202b6950780756
                    build-script-build-script-build.json
                num-rational-60a16f5bd5f3f024
                    build-script-build-script-build.json
                num-traits-70c95ea006e32a74
                    build-script-build-script-build.json
                proc-macro-crate-98b41315df30d3b7
                    lib-proc-macro-crate.json
                proc-macro2-2c6a23d60ccd7f4e
                    run-build-script-build-script-build.json
                proc-macro2-8b5af9d397ead18a
                    build-script-build-script-build.json
                proc-macro2-8bf22a28dd603d8c
                    lib-proc-macro2.json
                quote-5bdc800257202187
                    lib-quote.json
                ryu-6e495802e0dca2f8
                    lib-ryu.json
                ryu-925eb7fa97cd33ae
                    run-build-script-build-script-build.json
                ryu-dbc3a66ea4f76593
                    build-script-build-script-build.json
                serde-99b53df3332da024
                    run-build-script-build-script-build.json
                serde-b503d75818c50ef0
                    lib-serde.json
                serde-cc59da143fa15358
                    build-script-build-script-build.json
                serde_derive-1bb857dc8f29ae99
                    run-build-script-build-script-build.json
                serde_derive-6e9c85125d7a2ed1
                    lib-serde_derive.json
                serde_derive-f3ded73a7e2b9793
                    build-script-build-script-build.json
                serde_json-b70eff300b5a4957
                    build-script-build-script-build.json
                serde_json-d551c9d593571616
                    lib-serde_json.json
                serde_json-eea198169688ab24
                    run-build-script-build-script-build.json
                syn-4d72f68efd5c7071
                    run-build-script-build-script-build.json
                syn-d2f993746dc4eea5
                    lib-syn.json
                syn-ebf209806d57e738
                    build-script-build-script-build.json
                toml-6ccdf7e83a48abed
                    lib-toml.json
                typenum-82b9447c219d6833
                    build-script-build-script-main.json
                unicode-xid-fb6d37763bf8ceac
                    lib-unicode-xid.json
                version_check-2836013898ac669a
                    lib-version_check.json
                wee_alloc-56d24b26c3f4ff71
                    build-script-build-script-build.json
        wasm32-unknown-unknown
            debug
                .fingerprint
                    ahash-8a394d8d9685b366
                        lib-ahash.json
                    aho-corasick-2c979cf76cafdb66
                        lib-aho_corasick.json
                    base64-16948a8d617392fc
                        lib-base64.json
                    block-buffer-5f6e06afa074b171
                        lib-block-buffer.json
                    block-buffer-d1541a82d6a5a1e1
                        lib-block-buffer.json
                    block-padding-0dbbd77a1c7db503
                        lib-block-padding.json
                    borsh-0f27ab8d5ef6aaf4
                        lib-borsh.json
                    bs58-a6029119cf8e19b6
                        lib-bs58.json
                    byte-tools-c561556a14cd01a2
                        lib-byte-tools.json
                    byteorder-95eb5b5b00f3f9ce
                        lib-byteorder.json
                    byteorder-9e830d1983e96d91
                        run-build-script-build-script-build.json
                    cfg-if-10b30cdd8ee72c3a
                        lib-cfg-if.json
                    cfg-if-3273d8d291d4694c
                        lib-cfg-if.json
                    digest-45d6a0aaffeb1b5e
                        lib-digest.json
                    digest-f2348cdc1e354c37
                        lib-digest.json
                    generic-array-73b59990da7689d7
                        lib-generic_array.json
                    generic-array-c408dacbc967f500
                        lib-generic_array.json
                    generic-array-ed444c6f70013b50
                        run-build-script-build-script-build.json
                    greeter-98ace302c5fafa12
                        lib-greeter.json
                    hashbrown-45893a3de91ef8c3
                        run-build-script-build-script-build.json
                    hashbrown-6f5e7718c2ecb998
                        lib-hashbrown.json
                    hashbrown-bffcb3fdbed68aa0
                        lib-hashbrown.json
                    hex-2141af1744c0e16c
                        lib-hex.json
                    indexmap-933933baa5304885
                        run-build-script-build-script-build.json
                    indexmap-eef5baf882b129c0
                        lib-indexmap.json
                    itoa-40550c993f54d444
                        lib-itoa.json
                    keccak-00d467683040643f
                        lib-keccak.json
                    lazy_static-a4c2e1c5c77171c4
                        lib-lazy_static.json
                    memchr-91b522f39629515c
                        run-build-script-build-script-build.json
                    memchr-b6bccb00cce1faf7
                        lib-memchr.json
                    memory_units-eca18f7170267cc6
                        lib-memory_units.json
                    near-primitives-core-15b5c3ca2f991866
                        lib-near-primitives-core.json
                    near-runtime-utils-e6e7a4aec43c0dd1
                        lib-near-runtime-utils.json
                    near-sdk-945157d7caccdafa
                        lib-near-sdk.json
                    near-vm-errors-067f7f682ec0af31
                        lib-near-vm-errors.json
                    near-vm-logic-9a86d6a06431d7e5
                        lib-near-vm-logic.json
                    num-bigint-109c0ba3932b259b
                        lib-num-bigint.json
                    num-bigint-75e4cf1ea1a77d07
                        run-build-script-build-script-build.json
                    num-integer-9efe661c0e66a9ae
                        lib-num-integer.json
                    num-integer-d35e1e83d940e1d3
                        run-build-script-build-script-build.json
                    num-rational-54aef6de280a8e8a
                        run-build-script-build-script-build.json
                    num-rational-8c7d13544dfc363c
                        lib-num-rational.json
                    num-traits-60a7fce699e5dd4e
                        run-build-script-build-script-build.json
                    num-traits-b48a6ae4330a8a0f
                        lib-num-traits.json
                    opaque-debug-40e71e3d1cd3d500
                        lib-opaque-debug.json
                    opaque-debug-5f776447d7d37c32
                        lib-opaque-debug.json
                    regex-41b75f0e91269155
                        lib-regex.json
                    regex-syntax-ca89d0552bd21e03
                        lib-regex-syntax.json
                    ryu-041695aba4fdaa0d
                        run-build-script-build-script-build.json
                    ryu-1e98f7b84b8c8254
                        lib-ryu.json
                    serde-6a3c2e872d3b8eb2
                        run-build-script-build-script-build.json
                    serde-dd6df87d196a5a08
                        lib-serde.json
                    serde_json-1dbc49333af7298e
                        lib-serde_json.json
                    serde_json-e9a34276aad67d26
                        run-build-script-build-script-build.json
                    sha2-bb7724a88e8ebccd
                        lib-sha2.json
                    sha3-8ad035aa5ed4c51e
                        lib-sha3.json
                    typenum-332c243a6b371734
                        lib-typenum.json
                    typenum-e850512b0eed675b
                        run-build-script-build-script-main.json
                    wee_alloc-0e4c95ab84521c02
                        lib-wee_alloc.json
                    wee_alloc-da109d75bf09910e
                        run-build-script-build-script-build.json
                build
                    num-bigint-75e4cf1ea1a77d07
                        out
                            radix_bases.rs
                    typenum-e850512b0eed675b
                        out
                            consts.rs
                            op.rs
                            tests.rs
                    wee_alloc-da109d75bf09910e
                        out
                            wee_alloc_static_array_backend_size_bytes.txt
            release
                .fingerprint
                    ahash-bfd007b3211d12f8
                        lib-ahash.json
                    base64-2ee67bdf7e9e28bf
                        lib-base64.json
                    borsh-cce0d7d6e391151f
                        lib-borsh.json
                    bs58-e9d2b088a1b3aa68
                        lib-bs58.json
                    cfg-if-d186281152208ab6
                        lib-cfg-if.json
                    contract-b9b080fd8c9c503c
                        lib-contract.json
                    hashbrown-d532716c4d97ebd3
                        lib-hashbrown.json
                    itoa-9064f01d43981d55
                        lib-itoa.json
                    memory_units-640ff7701f83577f
                        lib-memory_units.json
                    near-sdk-6671d8a1266f9fc4
                        lib-near-sdk.json
                    near-sys-2eb9cd53cdb20e2b
                        lib-near-sys.json
                    ryu-3af457c0a69565df
                        lib-ryu.json
                    serde-552920a20459ba04
                        lib-serde.json
                    serde-c313852a29052fa4
                        run-build-script-build-script-build.json
                    serde_json-ad658a676b920724
                        run-build-script-build-script-build.json
                    serde_json-deeb30fce098ebcd
                        lib-serde_json.json
                    wee_alloc-20a6d95a53a658be
                        lib-wee_alloc.json
                    wee_alloc-22497db7cf616fe1
                        run-build-script-build-script-build.json
                build
                    wee_alloc-22497db7cf616fe1
                        out
                            wee_alloc_static_array_backend_size_bytes.txt
package.json
src
    App.js
    Components
        InfoBubble.js
        MintingTool.js
    __mocks__
        fileMock.js
    assets
        logo-black.svg
        logo-white.svg
        near_icon.svg
        near_logo_wht.svg
    config.js
    global.css
    index.html
    index.js
    jest.init.js
    main.test.js
    utils.js
    wallet
        login
            index.html

nft-mint-frontend Smart Contract
==================

A [smart contract] written in [Rust] for an app initialized with [create-near-app]

Quick Start
===========

Before you compile this code, you will need to install Rust with [correct target]

Exploring The Code
==================

1. The main smart contract code lives in `src/lib.rs`. You can compile it with
   the `./compile` script.
2. Tests: You can run smart contract tests with the `./test` script. This runs
   standard Rust tests using [cargo] with a `--nocapture` flag so that you
   can see any debug info you print to the console.

  [smart contract]: https://docs.near.org/docs/develop/contracts/overview
  [Rust]: https://www.rust-lang.org/
  [create-near-app]: https://github.com/near/create-near-app
  [correct target]: https://github.com/near/near-sdk-rs#pre-requisites
  [cargo]: https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
nft-mint-frontend
==================

This [React] app was initialized with [create-near-app]

Quick Start
===========

To run this project locally:

1. Prerequisites: Make sure you've installed [Node.js] ≥ 12
2. Install dependencies: `yarn install`
3. Run the local development server: `yarn dev` (see `package.json` for a
   full list of `scripts` you can run with `yarn`)

Now you'll have a local development environment backed by the NEAR TestNet!

Go ahead and play with the app and the code. As you make code changes, the app will automatically reload.

Exploring The Code
==================

1. The "backend" code lives in the `/contract` folder. See the README there for
   more info.
2. The frontend code lives in the `/src` folder. `/src/index.html` is a great
   place to start exploring. Note that it loads in `/src/index.js`, where you
   can learn how the frontend connects to the NEAR blockchain.
3. Tests: there are different kinds of tests for the frontend and the smart
   contract. See `contract/README` for info about how it's tested. The frontend
   code gets tested with [jest]. You can run both of these at once with `yarn
   run test`.

Deploy
======

Every smart contract in NEAR has its [own associated account][NEAR accounts]. When you run `yarn dev`, your smart contract gets deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how.

Step 0: Install near-cli (optional)
-------------------------------------

[near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local `node_modules` folder when you ran `yarn install`, but for best ergonomics you may want to install it globally:

    yarn install --global near-cli

Or, if you'd rather use the locally-installed version, you can prefix all `near` commands with `npx`

Ensure that it's installed with `near --version` (or `npx near --version`)

Step 1: Create an account for the contract
------------------------------------------

Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as `your-name.testnet`, you can deploy your contract to `nft-mint-frontend.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `nft-mint-frontend.your-name.testnet`:

1. Authorize NEAR CLI, following the commands it gives you:

      near login

2. Create a subaccount (replace `YOUR-NAME` below with your actual account name):

      near create-account nft-mint-frontend.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet

Step 2: set contract name in code
---------------------------------

Modify the line in `src/config.js` that sets the account name of the contract. Set it to the account id you used above.

    const CONTRACT_NAME = process.env.CONTRACT_NAME || 'nft-mint-frontend.YOUR-NAME.testnet'

Step 3: deploy!
---------------

One command:

    yarn deploy

As you can see in `package.json`, this does two things:

1. builds & deploys smart contract to NEAR TestNet
2. builds & deploys frontend code to GitHub using [gh-pages]. This will only work if the project already has a repository set up on GitHub. Feel free to modify the `deploy` script in `package.json` to deploy elsewhere.

Troubleshooting
===============

On Windows, if you're seeing an error containing `EPERM` it may be related to spaces in your path. Please see [this issue](https://github.com/zkat/npx/issues/209) for more details.

  [React]: https://reactjs.org/
  [create-near-app]: https://github.com/near/create-near-app
  [Node.js]: https://nodejs.org/en/download/package-manager/
  [jest]: https://jestjs.io/
  [NEAR accounts]: https://docs.near.org/docs/concepts/account
  [NEAR Wallet]: https://wallet.testnet.near.org/
  [near-cli]: https://github.com/near/near-cli
  [gh-pages]: https://github.com/tschaub/gh-pages
