Smart Contract Validation

Local Solidity source and ABI fingerprints with the deployment manifest, and links to PolygonScan for official source-code verification.

Contract

Name
ZarinaProvenanceAnchor
Network
Polygon Mainnet / Chain 137
Deployer
0x84d92dbd766c5ab31cf4d5198b9be1d44a9ac77e

Local fingerprints

Source SHA-256
ddcd736405bf1150fbb9fb4f949a913091e5ebc063341798713fca7a59839cad Match
ABI SHA-256
8895e9ade1b49b3d4278c0e7640c813aaa9b7200383def08a1cf38f87f704e83 Match
Constructor args
None
Solidity pragma
^0.8.20

This is a local integrity check. Use https://polygonscan.com/login?ref=verifyContract for mainnet validation.

Official PolygonScan verification checklist

  • Open Verify & Publish Check through a contract via the network.
  • Use Solidity Single File and paste and check if the Solidity file is same.
  • After success, PolygonScan should show Contract Source Code Verified on the Code tab.
  • Once you are sure that the contract source code has been verified, also check the Deployer and Deploy tx addresses.

ZarinaProvenanceAnchor.sol

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

/// @title Zarina Hendrix Provenance Anchor
/// @notice Anchors tamper-evident artwork ownership records to Polygon.
contract ZarinaProvenanceAnchor {
    address public owner;
    mapping(address => bool) public authorized;
    mapping(bytes32 => bool) public anchored;

    event AuthorizationChanged(address indexed account, bool authorized);
    event OwnershipAnchored(
        uint256 indexed artworkId,
        bytes32 indexed recordHash,
        bytes32 indexed ownerHash,
        bytes32 certificateHash,
        string metadataURI,
        address publisher,
        uint256 timestamp
    );

    modifier onlyOwner() {
        require(msg.sender == owner, "NOT_OWNER");
        _;
    }

    modifier onlyAuthorized() {
        require(msg.sender == owner || authorized[msg.sender], "NOT_AUTHORIZED");
        _;
    }

    constructor() {
        owner = msg.sender;
        authorized[msg.sender] = true;
        emit AuthorizationChanged(msg.sender, true);
    }

    function setAuthorized(address account, bool value) external onlyOwner {
        authorized[account] = value;
        emit AuthorizationChanged(account, value);
    }

    function anchor(
        uint256 artworkId,
        bytes32 recordHash,
        bytes32 ownerHash,
        bytes32 certificateHash,
        string calldata metadataURI
    ) external onlyAuthorized {
        require(recordHash != bytes32(0), "EMPTY_RECORD_HASH");
        require(!anchored[recordHash], "ALREADY_ANCHORED");
        anchored[recordHash] = true;
        emit OwnershipAnchored(artworkId, recordHash, ownerHash, certificateHash, metadataURI, msg.sender, block.timestamp);
    }
}