nikhildsahu / E-Certify

Blockchain Based Certificate Validation
MIT License
103 stars 62 forks source link

pragma version error #24

Open ashhadali10 opened 2 years ago

ashhadali10 commented 2 years ago

please change var and other method in code i use 0.5.16 truffle version and it give error when i compile simplestorage.sol contract. function createNewMultiSigbyUser(address instituteaddress) public {

   // var wa = wallets[msg.sender];
   // wa.inst=instituteaddress;
   // wa.stud=msg.sender;

}

function uploadAadhar(string memory a) public{

// var wa=wallets[msg.sender];

change in both function

Tabinda788 commented 2 years ago

@ashhadali10 Did you find any alternative?

shubhamrk2 commented 2 years ago

@nikhildsahu please help in above problem, for the var wa = wallets[msg.sender];, it says, expected primary expression. i am not able to resolve it, please help

shubhamrk2 commented 2 years ago

@nikhildsahu please help in above problem, for the var wa = wallets[msg.sender];, it says, expected primary expression. i am not able to resolve it, please help

instead of var wa = wallets[msg.sender] use Multisig storage wa = wallets[msg.sender]

Stranger-18 commented 1 year ago

function createNewMultiSigbyUser(address instituteaddress) public {

    Multisig storage wa = wallets[msg.sender];
    wa.inst=instituteaddress;
    wa.stud=msg.sender;

}

function uploadAadhar(string a) {

 var wa=wallets[msg.sender]; //im getting error right here someone help me

} }

abhijeetnishal commented 1 year ago

Hey @ashhadali10 , @Tabinda788 and @Stranger-18, refer this code it's working:

pragma solidity >=0.4.24;

contract Ballot {
   struct Documents {
     string aadhar;
}

struct MultiSig
{ 
    address inst;
    address stud;
    Documents documents;    
}
mapping(address=>MultiSig) public wallets ;

function createNewMultiSigbyUser(address instituteaddress) public {

        MultiSig storage wa = wallets[msg.sender];
        wa.inst=instituteaddress;
        wa.stud=msg.sender;
}

function uploadAadhar(string memory a) public{    
    MultiSig storage wa=wallets[msg.sender];    
}
}

@nikhildsahu now you can close this issue.

Avaitor777 commented 7 months ago

Hey @ashhadali10 , @Tabinda788 and @Stranger-18, refer this code it's working:

pragma solidity >=0.4.24;

contract Ballot {
   struct Documents {
     string aadhar;
}

struct MultiSig
{ 
    address inst;
    address stud;
    Documents documents;    
}
mapping(address=>MultiSig) public wallets ;

function createNewMultiSigbyUser(address instituteaddress) public {

        MultiSig storage wa = wallets[msg.sender];
        wa.inst=instituteaddress;
        wa.stud=msg.sender;
}

function uploadAadhar(string memory a) public{    
    MultiSig storage wa=wallets[msg.sender];    
}
}

@nikhildsahu now you can close this issue.

there is still issue in the migration.sol file. the same version problem. do you have a fix for that as well?