Skip to content

練習 #616

@gesso310

Description

@gesso310

module mygame::nft_character {

use sui::object::{Self, UID};
use sui::transfer;

/// キャラNFTの定義
struct CharacterNFT has key, store {
    id: UID,
    name: string::String,
    power: u64,
}

/// NFTを作る関数
public entry fun mint(name: string::String, power: u64, ctx: &mut TxContext) {
    let nft = CharacterNFT {
        id: object::new(ctx),
        name,
        power,
    };
    transfer::transfer(nft, tx_context::sender(ctx));
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions