Film

Description:

Smart contract deployed on Ethereum.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;

contract Film  {
  struct Frame {
    bytes32 imageHash;   //SHA256 of the .jpg image
    string ipfsCID;	 //IPFS CID of this image
    uint256 blocknumber; //block number when it was captured
  }

  address constant deafbeef_addr = 0x7ccd2EE72a75F7e4776f598c1Be11A119fD8d191;
  address public attester;  
  bytes32 public startBlockhash;
  uint16 public numFrames = 0;
  string public attestation;
  
  address _owner;  
  bool public locked = false;
  mapping (uint16 => Frame) public frames;

  modifier onlyOwner() {
    require(msg.sender==_owner,"denied");
    _;
  }

  modifier notLocked() {
    require(locked == false);
    _;
  }

  constructor() {
    _owner = msg.sender;
  }

  // Let deafbeef.eth address attest they made this contract
  string constant m = "I photographed the animation frames recorded in this contract.";
  function attest() public {
    require(msg.sender == deafbeef_addr);
    attester = msg.sender;
    attestation = m;
  }
  
  function captureFrame(bytes32 imageHash, string memory ipfsCID) public onlyOwner notLocked {
    numFrames++;   // frame indexing starts at 1
    frames[numFrames].imageHash = imageHash;
    frames[numFrames].ipfsCID = ipfsCID;
    frames[numFrames].blocknumber = block.number;

    if (numFrames==2) startBlockhash = blockhash(frames[1].blocknumber); // save blockhash of 1st captured frame
  }
  
  function lock() public onlyOwner notLocked {
    locked = true;
  }
}

Tags:
addr:0x678afc09640b385c6a9289a61a105b57a10c332a|verified:true|block:23398461|tx:0xc1a6ae7a8517ba03e5813c6b1a8d133494aa1c6aab38f2b7cbb97f1884f0b127|first_check:1758301491

Submitted on: 2025-09-19 19:04:52

Comments

Log in to comment.

No comments yet.