<p>You need to include these lines at the end:</p>
<pre><code>Simulator.logString @(Builtin TestContracts) &quot;Balances at the end of the simulation&quot;
b &lt;- Simulator.currentBalances
Simulator.logBalances @(Builtin TestContracts) b
</code></pre>

CC BY-SA 4.0
2021-10-26T10:10:23.650Z
Thanks a lot. It works!
agocorona
CC BY-SA 4.0
2021-10-30T01:26:35.377Z
@agocorona Glad to help!
georgeos
CC BY-SA 4.0
2021-10-25T15:54:30.133Z
2021-10-25T15:54:30.133Z
georgeos
<p>I'm using the GuessGame:</p>
<p><a href="https://github.com/input-output-hk/plutus/blob/a36af17fd38db591865679916c819079ad51fda2/plutus-playground-server/usecases/Game.hs" rel="nofollow noreferrer">https://github.com/input-output-hk/plutus/blob/a36af17fd38db591865679916c819079ad51fda2/plutus-playground-server/usecases/Game.hs</a></p>
<p>under the simulator, with this code</p>
<pre><code>main = Simulator.runSimulationWith handlers $ do

     cid &lt;- Simulator.activateContract (Wallet 1) GuessGame

     waitNSlots 3
     callEndpointOnInstance cid &quot;lock&quot; LockParams{secretWord=&quot;world&quot;, amount= Ada.adaValueOf 200}

     waitNSlots 3
     callEndpointOnInstance cid &quot;guess&quot; GuessParams{guessWord=&quot;world&quot;}
  
  where
  handlers :: SimulatorEffectHandlers (Builtin TestContracts)
  handlers =
    Simulator.mkSimulatorHandlers def def
    $ interpret (contractHandler (Builtin.handleBuiltin @TestContracts))
</code></pre>
<p>The traces included in the GuessGame code, indicates that the transaction has been done, but how I can display the final balances of the the simulated accounts?</p>

CC BY-SA 4.0
2021-10-25T11:50:06.193Z
Does this answer your question? [How to get list of wallets generated by PAB](https://cardano.stackexchange.com/questions/4221/how-to-get-list-of-wallets-generated-by-pab)
Aoaddeola
<plutus><wallet><pab><simulator>
How to get the final balances using the PAB+ the simulator?
# How to get the final balances using the PAB+ the simulator?

(Asked by: username_0 on 2021-10-25)

I'm using the GuessGame:
https://github.com/input-output-hk/plutus/blob/a36af17fd38db591865679916c819079ad51fda2/plutus-playground-server/usecases/Game.hs
under the simulator, with this code
main = Simulator.runSimulationWith handlers $ do

     cid <- Simulator.activateContract (Wallet 1) GuessGame

     waitNSlots 3
     callEndpointOnInstance cid "lock" LockParams{secretWord="world", amount= Ada.adaValueOf 200}

     waitNSlots 3
     callEndpointOnInstance cid "guess" GuessParams{guessWord="world"}
  
  where
  handlers :: SimulatorEffectHandlers (Builtin TestContracts)
  handlers =
    Simulator.mkSimulatorHandlers def def
    $ interpret (contractHandler (Builtin.handleBuiltin @TestContracts))

The traces included in the GuessGame code, indicates that the transaction has been done, but how I can display the final balances of the the simulated accounts?

**Tags:** plutus, wallet, pab, simulator
> **Comments:**
> **username_1**: Does this answer your question? [How to get list of wallets generated by PAB](https://cardano.stackexchange.com/questions/4221/how-to-get-list-of-wallets-generated-by-pab)  

---

## 1 answers

### Answer by username_2 on 2021-10-25. Score: 1

You need to include these lines at the end:
Simulator.logString @(Builtin TestContracts) "Balances at the end of the simulation"
b <- Simulator.currentBalances
Simulator.logBalances @(Builtin TestContracts) b

> **Comments:**
> **username_0**: Thanks a lot. It works!  
> **username_2**: @agocorona Glad to help!  

---

