Next verify the currency contract has the proper initial balance:
```bash
./eosioc get table currency currency account
{
"rows": [{
"account": "account",
"balance": 1000000000
"currency": 1381319428,
"balance": 10000000
}
],
"more": false
...
...
@@ -332,20 +338,18 @@ Next verify the currency contract has the proper initial balance:
Anyone can send any message to any contract at any time, but the contracts may reject messages which are not given necessary permission. Messages are not sent "from" anyone, they are sent "with permission of" one or more accounts and permission levels. The following commands show a "transfer" message being sent to the "currency" contract.
The content of the message is `'{"from":"currency","to":"inita","quantity":50}'`. In this case we are asking the currency contract to transfer funds from itself to someone else. This requires the permission of the currency contract.
The content of the message is `'{"from":"currency","to":"inita","quantity":"20.0000 CUR","memo":"any string"}'`. In this case we are asking the currency contract to transfer funds from itself to someone else. This requires the permission of the currency contract.
```bash
./eosioc push actions currency transfer '{"from":"currency","to":"inita","amount":50}'--scope currency,inita--permission currency@active
./eosioc push action currency transfer '{"from":"currency","to":"inita","quantity":"20.0000 CUR","memo":"my first transfer"}'--permission currency@active
```
Below is a generalization that shows the `currency` account is only referenced once, to specify which contract to deliver the `transfer` message to.
```bash
./eosioc push actions currency transfer '{"from":"${usera}","to":"${userb}","amount":50}'--scope${usera},${userb}--permission${usera}@active
./eosioc push action currency transfer '{"from":"${usera}","to":"${userb}","quantity":"20.0000 CUR","memo":""}'--permission${usera}@active
```
We specify the `--scope ...` argument to give the currency contract read/write permission to those users so it can modify their balances. In a future release scope will be determined automatically.
As confirmation of a successfully submitted transaction, you will receive JSON output that includes a `transaction_id` field.
<aname="readingcontract"></a>
...
...
@@ -357,8 +361,8 @@ So now check the state of both of the accounts involved in the previous transact
./eosioc get table inita currency account
{
"rows": [{
"account": "account",
"balance": 50
"currency": 1381319428,
"balance": 200000
}
],
"more": false
...
...
@@ -366,15 +370,15 @@ So now check the state of both of the accounts involved in the previous transact
./eosioc get table currency currency account
{
"rows": [{
"account": "account",
"balance": 999999950
"currency": 1381319428,
"balance": 9800000
}
],
"more": false
}
```
As expected, the receiving account **inita** now has a balance of **50** tokens, and the sending account now has **50** less tokens than its initial supply.
As expected, the receiving account **inita** now has a balance of **20** tokens, and the sending account now has **20** less tokens than its initial supply.