Deploy, then call
Put the artifact on-chain, then read from it for free and write to it with a transaction.
Deploying needs a funded wallet, because it is a transaction:
animica contract deploy ./mycontract/contract.py \
--from me \
--args '{"owner": "anim1…"}' \
--wait
--wait blocks until the receipt confirms. Without it you get a transaction hash and have to check yourself — which is fine, but on Animica blocks average around two minutes, so --wait is usually what you want.
Constructor arguments are JSON, and addresses are bytes. An init(owner) that expects 32 bytes will not accept a bech32m string silently — it will accept it as *the literal characters of the string*, which is a different value entirely. Convert to the account digest form the ABI expects, or your contract initialises with an owner nobody controls. This has bitten real deployments.
Once deployed, there are two ways to reach it:
# READ — free, no transaction, answered by any node
animica contract call <address> get
# WRITE — a transaction, costs gas, changes state
animica contract send <address> inc --args '{"by": 1}' --from me --wait
call is for view functions. send signs and broadcasts. If you call something that writes, you get the value it *would* have returned and no state change — useful for testing, misleading if you think it did something.
After a write, read the receipt to see what happened — including your events:
animica contract receipt <tx-hash>
Remember from the events lesson: a reverted call produces no events. An empty log on a call you expected to succeed is a strong hint that it reverted.
Claim your 10 ANM
Finish this lesson and claim 10 ANM, once per address. Paid from the Animica treasury in batches — allow a few minutes.
Stuck? Ask
Answered by Animica's own free inference network. It is donated GPU capacity, so give it 20-30 seconds.