public/subjects/blockchain/register
nprimo 4fa5c876a7 docs: run prettify and move h1 to h2 2023-06-09 09:17:48 +01:00
..
README.md docs: run prettify and move h1 to h2 2023-06-09 09:17:48 +01:00

README.md

Register

To conveniently check for a given string or document, you will create a register smart contract.

Instructions

Write a solidity smart contract Register that provides the following :

  • a function addDocument() that takes as parameter a hash (bytes32 in solidity)
  • a function getDate() that takes as parameter a hash and returns the corresponding unix timestamp of the document
contract Register {
  function getDate(bytes32 documentHash) public view returns (uint) {
  }
  function addDocument(bytes32 documentHash) public {
  }
}

Hint

You may use block.timestamp to retrieve the current block date and a mapping (see Notions).

Notions