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

137
Views
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
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!