Two Ways to Use Oumla: This guide uses the TypeScript SDK. You can also accomplish the same tasks using direct REST API calls - see the API Reference for endpoint details.
Overview
The contract deployment workflow involves:- Create or Select Template - Use an existing template or create a new one
- Get Constructor Info - Understand required constructor parameters
- Deploy Contract - Deploy with your parameters
- Check Status - Monitor the async deployment workflow
- Interact with Contract - Call functions on the deployed contract
Prerequisites
Before starting, ensure you have:- An initialized SDK client
- A profile created
- An address generated (for contract deployment)
- Your client share (for signing operations)
Step 1: Get Available Templates
List available contract templates:Step 2: Get Template Details
Retrieve details for a specific template:Step 3: Get Constructor Information
Before deploying, understand what constructor parameters are required:Understanding Constructor Parameters
Constructor parameters are sent as an array of objects, where each object containsname, type, and value:
Step 4: Get Function Information
Understand available functions on the contract:Step 5: Deploy Contract
Deploy the contract with your parameters:Step 6: Check Deployment Status
Deployment is async. Check workflow status:Workflow Status Values
- RUNNING: Deployment in progress
- COMPLETED: Deployment successful
- FAILED: Deployment failed (check error details)
- CANCELLED: Deployment was cancelled
Step 7: Get Deployed Contract Details
Once deployment completes, retrieve contract details:Step 8: Interact with Contract
After deployment, you can interact with the contract:Read Functions
Write Functions
Complete Example
Here’s a complete example:Managing Contract ABIs
Fetch ABI from Contract Address
Add Custom ABI
Common Issues
Deployment Fails
Causes:- Invalid constructor parameters
- Insufficient gas balance
- Network connectivity issues
- Verify constructor parameters match template requirements
- Ensure address has sufficient balance for gas
- Check network status and retry
Constructor Parameter Errors
Causes:- Wrong parameter types
- Missing required parameters
- Parameter order mismatch
- Review constructor info carefully
- Ensure types match (string, uint256, address, etc.)
- Provide all required parameters
Function Call Fails
Causes:- Function doesn’t exist
- Wrong parameter types
- Insufficient gas
- Verify function exists in contract ABI
- Check parameter types match function signature
- Ensure sufficient gas balance
Best Practices
- Always check constructor info before deploying
- Validate parameters before deployment
- Monitor workflow status until completion
- Store deployment IDs for future reference
- Handle errors gracefully - deployments can fail
- Test on testnet before mainnet deployment
- Verify contract address after deployment
Next Steps
- Learn about Tokenization Workflow
- Explore Withdrawal Workflow
- Review Error Reference for troubleshooting