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

145
Vistas
hello everyone,why the states value are not incresed after the use of funtion i mean after using the funtion the mapping retrun the o state?

Hello Everyone I am Begginer and here some problem into the mapping datatype whenever i am using function the state value always return the 0 it willl not increment i mean always the states return 0 after the use of function....

pragma solidity ^0.8.1;

contract DigitalLocker{
    address public Owner;
    address public BankAgent;
    address public ThirdPartyRequestor;
    address public CurrentAuthorizedUser ;
    
    struct ForTheDocument{
        uint DocumentId;
        string DocumentName;
        DigitalLockerState States;
    }
    
    mapping(uint=>ForTheDocument)public ForTheDocuments;
    uint public DocumentCount;
    enum DigitalLockerState{Create,DocumentReview,AvailableToShare,SharingWithThirdParty,Terminated}
    constructor(uint _DocumentId,string memory _DocumentName,address _BankAgent){
        Owner=msg.sender;
        ForTheDocuments[DocumentCount].DocumentId=_DocumentId;
        ForTheDocuments[DocumentCount].DocumentName=_DocumentName;
        BankAgent=_BankAgent;
        ForTheDocuments[DocumentCount].States=DigitalLockerState.Create;
        DocumentCount++;
        
        
    }
    
    function BeginReviewProcess(uint _DocumentIdForProcess)public{
        if(BankAgent!=msg.sender){
            revert("This is not a BankAgent Account");
        }
        BankAgent=msg.sender;
        ForTheDocuments[DocumentCount].DocumentId=_DocumentIdForProcess;
        ForTheDocuments[DocumentCount].States=DigitalLockerState.DocumentReview;
    }
    function UploadDocument(uint _DocumentIdForUpload)public{
        if(BankAgent!=msg.sender){
            revert("This is not a Bank agent account and you are not Capable to upload the Document");
        }
        ForTheDocuments[DocumentCount].DocumentId=_DocumentIdForUpload;
        BankAgent=msg.sender;
        ForTheDocuments[DocumentCount].States=DigitalLockerState.AvailableToShare;
    }
}
about 4 years ago · Juan Pablo Isaza
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