Skip to content

A smart contract to mint and check ownership of 1000 fans' tokens.

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE
Notifications You must be signed in to change notification settings

partagexyz/1000fans

Repository files navigation

1000 Fans Token Minter Contract

A smart contract to mint and check ownership of 1000 fans tokens. Token ID is generated automatically from fan000 to fan999. Max one token per account. Min one year before transfering the token to another account.

It is made to serve the backend of the fans-club app.

How to Build Locally?

Install cargo-near and run:

cargo near build

How to Test Locally?

cargo test

How to Deploy?

To deploy manually, install cargo-near and run:

# Create a new account
cargo near create-dev-account

# Deploy the contract on it
cargo near deploy <account-id>

# Initialize the contract
near call <account-id> new_default_meta '{"owner_id": "<account-id>"}' --accountId <account-id>

Basic methods

# View metadata
near view <account-id> nft_metadata

# Mint a NFT
near call <account-id> nft_mint '{"token_id": "0", "receiver_id": "<account-id>", "token_metadata": { "title": "Olympus Mons", "description": "Tallest mountain in charted solar system", "media": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Olympus_Mons_alt.jpg/1024px-Olympus_Mons_alt.jpg", "copies": 1}}' --accountId <account-id> --deposit 0.1

# View tokens for owner
near view <account-id> nft_tokens_for_owner '{"account_id": "<owner_id>"}'

# Transfer a NFT
near call <account-id> nft_transfer '{"token_id": "0", "receiver_id": "<receiver-id>", "memo": "transfer ownership"}' --accountId <account-id> --depositYocto 1

Useful Links

About

A smart contract to mint and check ownership of 1000 fans' tokens.

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages