Skip to content

Commit

Permalink
Update tamagotchi-shop/homework.md (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
SalMiah111 authored Jul 14, 2023
1 parent 4e5b386 commit 863d33b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions docs/15-tamagotchi-shop/homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ sidebar_position: 2
hide_table_of_contents: true
---

In this lesson, our Tamagotchi will be interacting with 2 other contracts: `tamagotchi-store` and `fungible-token`. Reference these contracts from your Tamagotchi `Cargo.toml` like this:
In this assignment, our Tamagotchi will be interacting with 2 other contracts: `tamagotchi-store` and `fungible-token`.

Reference these contracts from your Tamagotchi `Cargo.toml` as shown below:

```toml title="Cargo.toml"
# ...
Expand All @@ -19,7 +21,7 @@ store-io = { git = "https://github.com/gear-foundation/dapps-smart-contract-acad
# ...
```

Add a field to the Tamagotchi contract that stores the address of the fungible token. Accordingly, add the input message:
Add a field to the Tamagotchi contract the address of the fungible token. Accordingly, add the following input message to set the fungible token address:

```rust
#[derive(Encode, Decode, TypeInfo)]
Expand All @@ -31,9 +33,8 @@ pub enum TmgAction {
}
```

that will set the fungible token address.

Add the input message:
Add the input message to allow Tamagotchi to approve to transfer of its tokens (and accordingly the field `transaction_id` for communication with the fungible token contract):

```rust
#[derive(Encode, Decode, TypeInfo)]
Expand All @@ -49,7 +50,6 @@ pub enum TmgAction {
}
```

that will allow Tamagotchi to approve to transfer of its tokens (and accordingly the field `transaction_id` for communication with the fungible token contract).

To approve tokens you should send the fungible token the Approve message:

Expand Down Expand Up @@ -78,7 +78,7 @@ async fn approve_tokens(&mut self, account: &ActorId, amount: u128) {
}
```

Add the ability to your Tamagotchi contract to buy attributes. Add the input message:
Add the ability to your Tamagotchi contract to buy attributes using the input message below:

```rust
#[derive(Encode, Decode, TypeInfo)]
Expand Down Expand Up @@ -188,9 +188,7 @@ pub enum TmgEvent {
}
```

Please attach a link to the pull request (PR) in your repo with your Tamagotchi contract. Also, please paste your Tamagotchi program address.

Example:
Please attach a link to the pull request (PR) in your repo with your Tamagotchi contract. Also, please paste your Tamagotchi program address as shown in the example below:

- PR: <https://github.com/mynick/myname-gear-academy/pull/6>
- Program address: `0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d`

0 comments on commit 863d33b

Please sign in to comment.