> For the complete documentation index, see [llms.txt](https://move-developers-dao.gitbook.io/aptos-move-by-example/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://move-developers-dao.gitbook.io/aptos-move-by-example/applications/football-card.md).

# Football Card

**Contract logic:**

* Create a  `newStar` function first and then `mint` to your address.
* Owner can call `get`, `setPrice` and `transfer` to other address too.
* You can call `card_exists` to check your card is actually exist to your address or not.
* Here the some `test_football` test for better understandng.

<pre class="language-rust"><code class="lang-rust"><strong>  module card_addrx::Football_card{
</strong>        use std::signer;
        use std::debug;
        //error code
        const STAR_AlREADY_EXISTS:u64 = 100;
        const STAR_NOT_EXISTS:u64 = 101;
        //struct info
        struct FootBallStar has key,drop{
            name: vector&#x3C;u8>,
            country: vector&#x3C;u8>,
            postion: u8,
            value: u64,
        }

    public fun newStar(
            name: vector&#x3C;u8>,
            country: vector&#x3C;u8>,
            postion: u8
        ):FootBallStar{
            FootBallStar{
                name,
                country,
                postion,
                value:0
            }
    }

    public fun mint(to: &#x26;signer,star: FootBallStar){
            let acc_addr = signer::address_of(to);
            assert!(!card_exists(acc_addr),STAR_AlREADY_EXISTS);
            move_to&#x3C;FootBallStar>(to,star)
    }

    public fun get(owner: &#x26;signer):(vector&#x3C;u8>,u64) acquires FootBallStar{
            let acc_addr = signer::address_of(owner);
            let star = borrow_global_mut&#x3C;FootBallStar>(acc_addr);
            (star.name,star.value)
    }

    public fun card_exists(acc: address):bool{
            exists&#x3C;FootBallStar>(acc)
    }

    public fun setPrice(owner: &#x26;signer,price: u64) acquires FootBallStar{
            let acc_addr = signer::address_of(owner);
            assert!(card_exists(acc_addr),STAR_NOT_EXISTS);
            let star = borrow_global_mut&#x3C;FootBallStar>(acc_addr);
            star.value = price
    }

    public fun transfer(owner: &#x26;signer,to: &#x26;signer) acquires FootBallStar{
            let acc_addr = signer::address_of(owner);
            assert!(card_exists(acc_addr),STAR_NOT_EXISTS);
            let star = move_from&#x3C;FootBallStar>(acc_addr);
            let acc_addr2 = signer::address_of(to);
            move_to&#x3C;FootBallStar>(to,star);
            assert!(card_exists(acc_addr2),100);
        }

        #[test(owner=@0x123,to=@0x768)]
        fun test_football(owner: signer,to: signer)acquires FootBallStar{

            //FOOTBALL_CARD
            let star = newStar(b"Sunil Chhetri",b"India",2);
            mint(&#x26;owner,star);
            let (name,value) = get(&#x26;owner);
            debug::print(&#x26;name);
            debug::print(&#x26;value);
            setPrice(&#x26;owner,100);
            transfer(&#x26;owner,&#x26;to); 
            let (name,value) = get(&#x26;to);
            debug::print(&#x26;name);
            debug::print(&#x26;value);
        }
<strong>}
</strong></code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://move-developers-dao.gitbook.io/aptos-move-by-example/applications/football-card.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
