Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

132
Vistas
Error: Type contract pSDATokenSale is not implicitly convertible to expected type contract pSDA

Type contract pSDATokenSale is not implicitly convertible to expected type contract pSDA.

I am getting the error above ^^ at the line with tokenContract = _tokenContract;. Any suggestions as to why this is happening and how to fix it?

pragma solidity ^0.8.12;

import "./pSDAToken.sol";


contract pSDATokenSale {
    address admin;
    pSDA public tokenContract;
    uint256 public tokenPrice;
    uint256 public tokensSold;

    event Sell(address _buyer, uint256 _amount);

    function pSDAToken(pSDATokenSale _tokenContract, uint256 _tokenPrice)
        public
    {
        admin = msg.sender;
        tokenContract = _tokenContract;
        tokenPrice = _tokenPrice;
    }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

ehy you wrote wrong the type of _tokenContract inside the function pSDAToken()

you wrote _tokenContract with type pSDATokenSale, and want to save it inside tokenContract that is pSDA type

this is the correct code:

pragma solidity ^0.8.12;

import "./pSDAToken.sol";


contract pSDATokenSale {
    address admin;
    pSDA public tokenContract;
    uint256 public tokenPrice;
    uint256 public tokensSold;

    event Sell(address _buyer, uint256 _amount);

    function pSDAToken(pSDA _tokenContract, uint256 _tokenPrice)
        public
    {
        admin = msg.sender;
        tokenContract = _tokenContract;
        tokenPrice = _tokenPrice;
    }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda