0

I am trying to deploy the following contract in Remix IDE and I get the error message in the title:

pragma solidity ^0.4.22;

contract University {
    address public owner;
    address public student;
    address firstName;
    address lastName;
    bytes32 Studies;
    uint age;
    uint DateOfBirth;
    bytes32 public caCertificate;
    bytes32 ipfs_hash;
    constructor() public {
        owner = msg.sender;
    }
    modifier onlyOwner()  {
        if (msg.sender == owner) _;
    }
    modifier onlyOwnerOrStudent() {
        if (msg.sender == owner || msg.sender == student) _;
    }
    function setstudent () public;

    function getStudent () public;

    event student(
        bytes32 firstNameName,
        bytes32 lastName,
        bytes32 Studies,
        uint age,
        uint DateOfBirth,
        bytes32 ipfs_hash
        );

    function checkStudentExists() public constant returns (bool) {
        if (student == firstName && student == lastName) return true;
    }

    function setIPFSHash(bytes32 _ipfs_hash) public onlyOwnerOrStudent {
        ipfs_hash = _ipfs_hash;
    }
}

Can someone help me please?

Thank you

1 Answer 1

0

simply change

function setstudent () public;

function getStudent () public;

to

function setstudent () public {}

function getStudent () public {}

using function setstudent () public;form makes your contract an abstract contract (can't be deployed).

you can either create a separated abstract class and inherit it or implement the function bodies within your contract.

1
  • Thank you, it worked though I had to add 'pure' in the body as well.
    – bitcom
    Commented Jul 22, 2018 at 16:09

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.