Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ERC-1155 Token Transfers #11

Open
11 tasks
Josue19-08 opened this issue Feb 10, 2025 · 0 comments
Open
11 tasks

Implement ERC-1155 Token Transfers #11

Josue19-08 opened this issue Feb 10, 2025 · 0 comments

Comments

@Josue19-08
Copy link
Contributor

📌 Issue: Implement ERC-1155 Token Transfers

🔹 Description

Enable the API to execute NFT and fungible token transfers between accounts on StarkNet Testnet using the safeTransferFrom method from the ERC-1155 contract. This will allow users to send assets securely.


📂 Project Structure

  • Service: src/modules/blockchain/services/starknet.service.ts
  • Controller: src/modules/blockchain/controllers/blockchain.controller.ts
  • DTOs: src/modules/blockchain/dtos/transfer.dto.ts

🛠️ Tasks

  • Implement transferToken(from, to, tokenId, amount) using the safeTransferFrom function from the contract.
  • Validate input parameters (wallet addresses, token ID, amount).
  • Implement error handling for:
    • Insufficient token balance.
    • Invalid recipient address.
    • Transaction failures on the blockchain.
  • Implement logging for debugging failed transactions.
  • Write unit tests to validate:
    • Successful token transfer between accounts.
    • Handling invalid addresses or token IDs.
    • Checking blockchain confirmation for transactions.

✅ Acceptance Criteria

  • Tokens should be transferable between accounts.
  • API should return a transaction hash upon successful transfer.
  • Transactions should be visible on StarkScan after execution.
  • Unit tests must pass before merging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants