# When to use UpdateApplication

**URL:** https://forum.algorand.co/t/when-to-use-updateapplication/2983
**Category:** General
**Created:** [April 10, 2021, 8:13pm UTC](https://forum.algorand.co/t/when-to-use-updateapplication/2983 "2021-04-10T20:13:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gidon](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gidon](https://forum.algorand.co/u/gidon)
#### Post date: [April 10, 2021, 8:13pm UTC](https://forum.algorand.co/t/when-to-use-updateapplication/2983/1 "2021-04-10T20:13:16Z")

</div>

As far as my understanding goes, transactions of type UpdateApplication is primarily for changing the actual TEAL of a smart contract.

However I have also seen UpdateApplication used for adding a new global state value [https://developer.algorand.org/articles/linking-algorand-stateful-and-stateless-smart-contracts/:](https://developer.algorand.org/articles/linking-algorand-stateful-and-stateless-smart-contracts/:)

```auto
// check if this is update ---
int UpdateApplication
txn OnCompletion
==
bz not_update
// the call should pass the escrow 
// address
txn NumAppArgs
int 1
==
bz failed
// store the address in global state
// this parameter should be addr:
byte "Escrow"
txna ApplicationArgs 0
app_global_put
int 1
return

```

Is there a particular reason for using UpdateApplication to store state, as opposed to just using the generic application call?

---

<div class="post-metadata">

### Author: ![JasonW](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@JasonW](https://forum.algorand.co/u/JasonW)
#### Post date: [April 11, 2021, 3:55am UTC](https://forum.algorand.co/t/when-to-use-updateapplication/2983/2 "2021-04-11T03:55:31Z")

</div>

In this particular scenario, it looks like you are linking an escrow(stateless) contract to a stateful contract. You may want that operation to only occur if the creator of the stateful contract is making the link. So an update operation is ok although it really does not matter as long as you know which account is making the change. Take a look at this article:

> **[Linking Algorand Stateful and Stateless Smart Contracts](https://developer.algorand.org/articles/linking-algorand-stateful-and-stateless-smart-contracts/)**
>
> This article discussing linking stateful and stateless smart contracts and why it makes sense in many applications.

Also note in Teal3 coming in a week or so you can now get the creator address from teal in a stateful contract: [Developer Office Hours | TEAL 3 Updates - YouTube](https://www.youtube.com/watch?v=A-vRSC2O77U)
