# Application call

We have set up a really simple **stateful smart contract** to test the application calls. This smart contract is expecting an integer as a parameter. \
It then stores the **sum of values** and the **number of values** as global states within the application and the **last value** sent as a local state in the user account.&#x20;

![Overview of the Smart Contract's behavior](https://3444584021-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MY5cgxyYAI0pHdVffOt%2F-Mcp0qIsOgXHOHKZkoLs%2F-Mcp5vXJE8NJDDlo800f%2FSimple_Storage.png?alt=media\&token=4295d200-144b-4dfc-9de5-bbdeee54a1bc)

{% hint style="info" %}
The smart contract source can be found [here](https://github.com/vertices-network/SimpleStorage/tree/main/SimpleStorage_algoDEA/src).
{% endhint %}

Once you've put some money into your account, you can run the Unix example program with the `-a` flag:

```
$ ./examples/unix/unix_example -a
🟢 [examples/unix/main.c:245] 😎 Vertices SDK running on Unix-based OS
🟢 [examples/unix/main.c:140] 🔑 Loading private key from: /Users/cyril/Documents/work/vertices/c-vertices-sdk/examples/unix/config/private_key.bin
🟢 [examples/unix/main.c:201] 💳 Alice's account E3PGTXKDOODVQ3E2ZB5PMJF2W3YOKIPUPLFDTESSP6562QE4GTLAKO4VXY
🟢 [examples/unix/main.c:278] 🏎 Running on testnet-v1.0 v.2.6.0
🟢 [src/account.c:42] 👛 Added account to wallet: #0
🟢 [src/account.c:42] 👛 Added account to wallet: #1
🟢 [examples/unix/main.c:293] 🤑 2.907842 Algos on Alice's account (E3PGTXKDOODVQ3E2ZB5PMJF2W3YOKIPUPLFDTESSP6562QE4GTLAKO4VXY)
🟢 [src/algorand/algorand_transaction.c:435] 🧾 Transaction executed, ID: WEXZJNY4UIVTZLYP2DXMZZTA5FMEEOLCQCVM6J66DZDCAW6YJWZQ
🟢 [src/account.c:104] 👛 Deleted account from wallet: #0
🟢 [src/account.c:104] 👛 Deleted account from wallet: #1
```

Now you can check the transaction status on [AlgoExplorer for Testnet](https://testnet.algoexplorer.io/), using the transaction ID printed `WEXZJNY4UIVTZLYP2DXMZZTA5FMEEOLCQCVM6J66DZDCAW6YJWZQ`.

Here is the status of the transaction:

![Application call transaction](https://3444584021-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MY5cgxyYAI0pHdVffOt%2F-Mbv18xMDMukIzYDl97S%2F-Mbv6Lj_WlSmft7Ekj_l%2Fimage.png?alt=media\&token=e2fef225-357b-4821-904d-9c8c84793576)

## Opt-In

If the account calling the smart contract never opted in the application, it will be **automatically** done.
