Executing Contracts
Thexyz program execute command calls contract methods that modify state (like a transaction).
Usage
Arguments
Basic Execution
Message Formats
Inline JSON
With Parameters
From File
Options
Examples
Transfer Tokens (CW20)
Send with Funds
Some contracts require funds with execution:Batch Operations
Dry Run
Simulate without broadcasting:Message Examples
Simple Action
With Parameters
Nested Structure
Multiple Actions (if supported)
Authorization
Execute methods may have authorization requirements:Public Methods
Anyone can call:Owner-Only Methods
Error Handling
The CLI provides user-friendly errors:Complex JSON
For complex messages, use a file:Scripting
Check Result
Retry on Failure
Troubleshooting
Invalid JSON
Invalid JSON
Validate your JSON:
Contract not found
Contract not found
Verify contract exists:
Out of gas
Out of gas
Increase gas buffer: