Skip to content

[Feature]: Contract Deployment API Route #33

@SudiptaPaul-31

Description

@SudiptaPaul-31

🔍 Problem Statement

📖 Description

Create a backend API endpoint to handle contract deployment via Soroban. This route will validate input, trigger contract deployment, and persist the deployed contract address in the database.

Endpoint

  • POST /api/contracts/deploy

Expected Behavior

  • Input Validation:
    • Validate request body fields (e.g., project ID, contract parameters).
    • Ensure wallet signature and authentication are verified.
  • Contract Deployment:
    • Trigger Soroban contract deployment using the provided parameters.
    • Handle deployment errors gracefully with clear error responses.
  • Persistence:
    • Store the deployed contract address in the database.
    • Link contract to the appropriate project and user.

🛠 Technical Notes

  • Use middleware for wallet signature verification and session handling.
  • Integrate with Soroban SDK for contract deployment.
  • Ensure database schema supports storing contract addresses (linked to projects and users).
  • Maintain secure error handling and logging.
  • Follow RESTful API design principles.

✅ Acceptance Criteria

  • POST /api/contracts/deploy accepts valid input and deploys a Soroban contract.
  • Invalid input or failed deployment returns proper error codes (400, 401, 500).
  • Deployed contract address is stored in the database and linked correctly.
  • Endpoint passes integration tests.
  • npm run lint and npm run build succeed.
  • No regression in authentication, wallet connection, or dashboard features.

📈 Expected Impact

High — Would significantly improve user experience

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions