Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
¿Cómo puedo interactuar con las funciones de pago en la interfaz?

Este es mi código, tengo un problema al llamar a la función desde la interfaz, ¿cómo puedo hacer una función en JS que pueda interactuar con mi función en smartcontrat?

 function placeBet(uint8 matchID, string memory bettingType, uint8 oddForWinning) override external payable MBet { require(keccak256(abi.encodePacked(bettingType)) == keccak256(abi.encodePacked("Tie")) || keccak256(abi.encodePacked(bettingType)) == keccak256(abi.encodePacked("Team A")) || keccak256(abi.encodePacked(bettingType)) == keccak256(abi.encodePacked("Team B")), "Betting type must be 'Team A' or 'Team B' or 'Tie'"); bets[msg.sender] = Bet(matchID, bettingType, oddForWinning, msg.value); players.push(msg.sender); string memory b = "Bet received!"; emit UpdatedBet(msg.sender ,b); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La forma correcta de interactuar con un contrato inteligente es a través de una API. Luego puede exponer las funciones del contrato inteligente a través de los puntos finales de la API (GET/PUT/POST, etc.).

Las herramientas adecuadas para ayudarlo a lograrlo son: Web3.js , Trufflesuite y Ethairballoons .

Luego, desde la parte frontal de su aplicación, puede llamar fácilmente a los servicios de API a través de los cuales expone la funcionalidad del contrato inteligente.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!