.gitpod.yml
README.md
babel.config.js
contract
    Cargo.toml
    README.md
    compile.js
    src
        lib.rs
    target
        .rustc_info.json
        debug
            .fingerprint
                Inflector-9e3c62115074b9cf
                    lib-inflector.json
                autocfg-cd255646c4ed3339
                    lib-autocfg.json
                borsh-derive-5ae16aa117c7f399
                    lib-borsh-derive.json
                borsh-derive-internal-d0a21fc13ecc1b98
                    lib-borsh-derive-internal.json
                borsh-schema-derive-internal-ab395ab8b11e5be3
                    lib-borsh-schema-derive-internal.json
                byteorder-f262064c186a8c75
                    build-script-build-script-build.json
                convert_case-95e284bc56c12eb5
                    lib-convert_case.json
                derive_more-69cde6e327ff0a85
                    lib-derive_more.json
                generic-array-092d57466d24febe
                    build-script-build-script-build.json
                hashbrown-23b6f330e2a36dbb
                    run-build-script-build-script-build.json
                hashbrown-cdcf863ec2cdd3e4
                    build-script-build-script-build.json
                hashbrown-d487e72206b07264
                    lib-hashbrown.json
                indexmap-1e685d288818a816
                    lib-indexmap.json
                indexmap-8c9f9453652d0887
                    run-build-script-build-script-build.json
                indexmap-c3ac49ead90ef7d0
                    build-script-build-script-build.json
                itoa-b06d4cff304254a3
                    lib-itoa.json
                memchr-035c4269a6233099
                    build-script-build-script-build.json
                near-rpc-error-core-b63ef2006bff2a54
                    lib-near-rpc-error-core.json
                near-rpc-error-macro-379a6a754086af95
                    lib-near-rpc-error-macro.json
                near-sdk-core-f46d7222a619c60b
                    lib-near-sdk-core.json
                near-sdk-macros-67a465e716adb526
                    lib-near-sdk-macros.json
                num-bigint-d69df36f763339d9
                    build-script-build-script-build.json
                num-integer-733a54d88eb397d7
                    build-script-build-script-build.json
                num-rational-ae7f1682837cfa6a
                    build-script-build-script-build.json
                num-traits-4b4399d154f5b10c
                    build-script-build-script-build.json
                proc-macro-crate-12334d71f27edc5f
                    lib-proc-macro-crate.json
                proc-macro2-3fad645d9b421e8e
                    run-build-script-build-script-build.json
                proc-macro2-5fcfb2a46c5df79c
                    build-script-build-script-build.json
                proc-macro2-c9e8a8bd316f311f
                    lib-proc-macro2.json
                quote-577c40b40ecd60bd
                    lib-quote.json
                ryu-218129458e3751da
                    run-build-script-build-script-build.json
                ryu-a617547c15767d1a
                    build-script-build-script-build.json
                ryu-b54e014f019506d7
                    lib-ryu.json
                serde-283b18786897374f
                    lib-serde.json
                serde-552ea552149e1a4d
                    build-script-build-script-build.json
                serde-b99429f97a9b8ecc
                    run-build-script-build-script-build.json
                serde_derive-4f31ad7a0e5ec105
                    build-script-build-script-build.json
                serde_derive-9dbff8f6028e8a2c
                    run-build-script-build-script-build.json
                serde_derive-ea52ca527bcbc75e
                    lib-serde_derive.json
                serde_json-bf5b0064d1b45776
                    run-build-script-build-script-build.json
                serde_json-c83f8bc67b0f9037
                    lib-serde_json.json
                serde_json-e9017e2e6ab453c7
                    build-script-build-script-build.json
                syn-0359a400ed92222f
                    build-script-build-script-build.json
                syn-60a21e1eff858db6
                    lib-syn.json
                syn-84879f3141fd595e
                    run-build-script-build-script-build.json
                toml-dc98d37f2aab96c5
                    lib-toml.json
                typenum-b487004bf7bc9a32
                    build-script-build-script-main.json
                unicode-xid-1ccf9a8622388d0a
                    lib-unicode-xid.json
                version_check-c02be86861b3fab0
                    lib-version_check.json
                wee_alloc-4c1d5fc69208e232
                    build-script-build-script-build.json
        wasm32-unknown-unknown
            debug
                .fingerprint
                    ahash-31500eed5b448aad
                        lib-ahash.json
                    aho-corasick-b89132b0381c749e
                        lib-aho_corasick.json
                    base64-646109cef868d84f
                        lib-base64.json
                    block-buffer-5f9d9d8b55f1d3b1
                        lib-block-buffer.json
                    block-buffer-bc99728b4d693dcc
                        lib-block-buffer.json
                    block-padding-13821e343f46f753
                        lib-block-padding.json
                    borsh-6fb510f42155d666
                        lib-borsh.json
                    bs58-7212f4faed67cdbf
                        lib-bs58.json
                    byte-tools-a6cd60c7ea46575a
                        lib-byte-tools.json
                    byteorder-425eab9cce122222
                        lib-byteorder.json
                    byteorder-b1278529b57a037f
                        run-build-script-build-script-build.json
                    cfg-if-53998aee5392ec20
                        lib-cfg-if.json
                    cfg-if-f1de31271fe8376a
                        lib-cfg-if.json
                    digest-02b66ce3a4c78c1c
                        lib-digest.json
                    digest-5bb936ed42c05efb
                        lib-digest.json
                    generic-array-30cd0a03156a9b87
                        lib-generic_array.json
                    generic-array-6802468a8a36c271
                        run-build-script-build-script-build.json
                    generic-array-845551d223c666ba
                        lib-generic_array.json
                    greeter-98ace302c5fafa12
                        lib-greeter.json
                    hashbrown-483ac2a52167ff2a
                        lib-hashbrown.json
                    hashbrown-51d3921aceef5ebb
                        run-build-script-build-script-build.json
                    hashbrown-9e21cf3d1d28819b
                        lib-hashbrown.json
                    hex-261cfc3fcecaa4ef
                        lib-hex.json
                    indexmap-33441b070f70d190
                        run-build-script-build-script-build.json
                    indexmap-549d81fd1b4aaa1a
                        lib-indexmap.json
                    itoa-4c06a779eef25af4
                        lib-itoa.json
                    keccak-b0c9ccd044944503
                        lib-keccak.json
                    lazy_static-b79bf709c5f09987
                        lib-lazy_static.json
                    memchr-8974d6d0eea4ab03
                        lib-memchr.json
                    memchr-f922bd3de584c24c
                        run-build-script-build-script-build.json
                    memory_units-3804df6a88cda429
                        lib-memory_units.json
                    near-primitives-core-22512a59771af8d0
                        lib-near-primitives-core.json
                    near-runtime-utils-3357838d53825c1b
                        lib-near-runtime-utils.json
                    near-sdk-b965d2f0da3bed34
                        lib-near-sdk.json
                    near-vm-errors-20e6f8caa2eb3f21
                        lib-near-vm-errors.json
                    near-vm-logic-afd430776e895057
                        lib-near-vm-logic.json
                    near_spring-eeac07575ddc6ba4
                        lib-near_spring.json
                    num-bigint-7e7d1d90c83f30cc
                        lib-num-bigint.json
                    num-bigint-a699a4a251dccc5e
                        run-build-script-build-script-build.json
                    num-integer-8d01ee791cd20c62
                        lib-num-integer.json
                    num-integer-e00df3a90a9271c0
                        run-build-script-build-script-build.json
                    num-rational-abf9bfbe7cbd8dd6
                        lib-num-rational.json
                    num-rational-e5b980680ebaaecb
                        run-build-script-build-script-build.json
                    num-traits-c1660e0226ce670c
                        run-build-script-build-script-build.json
                    num-traits-e0f409119940623e
                        lib-num-traits.json
                    opaque-debug-20397d3162c70a7a
                        lib-opaque-debug.json
                    opaque-debug-67e11037907b0a62
                        lib-opaque-debug.json
                    regex-e489d254d1e7e12d
                        lib-regex.json
                    regex-syntax-bcaa825332c5ba50
                        lib-regex-syntax.json
                    ryu-52a388757c15c1a6
                        run-build-script-build-script-build.json
                    ryu-a7a81e23b9bcb06b
                        lib-ryu.json
                    serde-6d59abfee35ae43b
                        run-build-script-build-script-build.json
                    serde-ebe94b1241f5047e
                        lib-serde.json
                    serde_json-1da7a0c73c632567
                        lib-serde_json.json
                    serde_json-c3b71e6248b2b8a1
                        run-build-script-build-script-build.json
                    sha2-bdebeba22d9faa70
                        lib-sha2.json
                    sha3-4cf15448deb657a1
                        lib-sha3.json
                    typenum-4976863587ad7c9e
                        run-build-script-build-script-main.json
                    typenum-eee99a2ed0f1494e
                        lib-typenum.json
                    wee_alloc-1aec1ccd611d0139
                        run-build-script-build-script-build.json
                    wee_alloc-6b415af9b59e77f3
                        lib-wee_alloc.json
                build
                    num-bigint-a699a4a251dccc5e
                        out
                            radix_bases.rs
                    typenum-4976863587ad7c9e
                        out
                            consts.rs
                            op.rs
                            tests.rs
                    wee_alloc-1aec1ccd611d0139
                        out
                            wee_alloc_static_array_backend_size_bytes.txt
package.json
src
    App.js
    __mocks__
        fileMock.js
    assets
        logo-black.svg
        logo-white.svg
        mallet--optimized.svg
        mole-out-of-hole-min.svg
        mole-out-of-hole.svg
    components
        games
            snake
                snake.js
            tetris
                tetris.css
                tetris.js
        other
            about.js
            buytokens.js
            header.css
            header.js
    config.js
    global.css
    index.html
    index.js
    jest.init.js
    main.test.js
    utils.js
    wallet
        login
            index.html

near-spring-social-good
==================

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 `near-spring-social-good.your-name.testnet`. Assuming you've already created an account on [NEAR Wallet], here's how to create `near-spring-social-good.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 near-spring-social-good.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 || 'near-spring-social-good.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
near-spring-social-good 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
