0
pragma solidity ^0.4.0;
contract SignatureStatus
{
    string documentIDhash;
    struct Signature {
        string documentID; //ID of the document
        string studyID; // ID of the study the document is associated with
        string timeStamp; // Timestamp of the signature
        bool consented; //  boolean of the consent status
    }


//sets the consent status of the contract
function consentBuild(documentIDhash,studyIDhash,timeStamphash,consentedhash) public returns (Signature)
{
string documentID = documentIDhash;
string studyID = studyIDhash;
string timeStamp = timeStamphash;
bool consented = consentedhash;


 }
    //checks the status of the contract
    function Status() returns (bool status) 
    {
    //bool consented = true;    
    if (consented == true) {status = true;} else {status = false;}
    }

This is my current contract, I'm trying to create a public function that receives a tx call from web3 js and stores the parameters in a struc. I'm getting this error however whenever I try to name my parameters in the function. I've tried defining the parameters beforehand and that isn't working either. What exactly am I not seeing/missing to simply set my function parameter names?

browser/Untitled.sol:15:27: TypeError: Name has to refer to a struct, enum or contract.
function consentBuild(documentIDhash,studyIDhash,timeStamphash,consentedhash) public returns (Signature)
                      ^------------^

1 Answer 1

1

In solidity when you declare a function you have to put the type of each parameter before the parameter. Something like this should work

function consentBuild(
    string documentIDhash, 
    string studyIDhash, 
    string timeStamphash, 
    bool consentedhash) public returns (Signature) {
// Rest of you function ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.