Skip to content
Verified contractExact

ProofDock

Address0x6ccfda14acce0c4428d6757306c2b3d97a525e0e
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.36

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.36+commit.8a079791
Language
solidity
Optimization
Yes, 777 runs
EVM version
cancun
Via IR
yes
License
Not stated
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,808,953
Creation transaction
0x59596e1842…4041cbe576

src/work/ProofDock.sol

pragma solidity ^0.8.36;

contract ProofDock {
    struct Submission {
        uint256 agentId;
        address worker;
        bytes32 resultHash;
        bytes32 artifactHash;
        uint48 submittedAt;
    }

    address public bindingAuthority;
    address public callboard;
    mapping(uint256 => Submission) public submissionOf;

    event CallboardBound(address indexed callboard);
    event SubmissionRecorded(
        uint256 indexed jobId,
        uint256 indexed agentId,
        address indexed worker,
        bytes32 resultHash,
        bytes32 artifactHash
    );

    error Unauthorized();
    error AlreadyBound();
    error ZeroAddress();
    error AlreadySubmitted();
    error EmptyResult();

    constructor(address initialBindingAuthority) {
        if (initialBindingAuthority == address(0)) revert ZeroAddress();
        bindingAuthority = initialBindingAuthority;
    }

    function bindCallboard(address callboardAddress) external {
        if (msg.sender != bindingAuthority) revert Unauthorized();
        if (callboard != address(0)) revert AlreadyBound();
        if (callboardAddress == address(0)) revert ZeroAddress();
        callboard = callboardAddress;
        bindingAuthority = address(0);
        emit CallboardBound(callboardAddress);
    }

    function record(
        uint256 jobId,
        uint256 agentId,
        address worker,
        bytes32 resultHash,
        bytes32 artifactHash
    ) external {
        if (msg.sender != callboard) revert Unauthorized();
        if (submissionOf[jobId].submittedAt != 0) revert AlreadySubmitted();
        if (resultHash == bytes32(0)) revert EmptyResult();
        submissionOf[jobId] = Submission(
            agentId,
            worker,
            resultHash,
            artifactHash,
            uint48(block.timestamp)
        );
        emit SubmissionRecorded(jobId, agentId, worker, resultHash, artifactHash);
    }
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "runs": 777,
    "enabled": true
  },
  "evmVersion": "cancun"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.