Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

139
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda