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:0x60b31874f80a4c2241e3ba7ac42be46f9b193352|verified:true|block:23398470|tx:0x30ca903659c5ad9e7e2e0a54f2f1d362a43a286252639722504d776c90995610|first_check:1758302182

Submitted on: 2025-09-19 19:16:24

Comments

Log in to comment.

No comments yet.