Skip to content

Instantly share code, notes, and snippets.

@hbarcelos
Last active October 4, 2021 18:48
Show Gist options
  • Save hbarcelos/5239ddb533be18ab2e93d14072535672 to your computer and use it in GitHub Desktop.
Save hbarcelos/5239ddb533be18ab2e93d14072535672 to your computer and use it in GitHub Desktop.
LightCurate Brainstorming

Current:

struct Item {
  Status status; // The current status of the item.
  Request[] requests; // List of status change requests made for the item in the form requests[requestID].
}

struct Request {
   bool disputed; // True if a dispute was raised.
   bool resolved; // True if the request was executed and/or any raised disputes were resolved.
   Party ruling; // The final ruling given, if any.
   uint72 submissionTime; // Time when the request was made. Used to track when the challenge period ends.
   IArbitrator arbitrator; // The arbitrator trusted to solve disputes for this request.
   uint128 disputeID; // ID of the dispute, if any.
   uint128 metaEvidenceID; // The meta evidence to be used in a dispute for this case.
   address payable[3] parties; // Address of requester and challenger, if any, in the form parties[party].
   Round[] rounds; // Tracks each round of a dispute in the form rounds[roundID].
   bytes arbitratorExtraData; // The extra data for the trusted arbitrator of this request.
}

Updated:

struct Item {
  Status status; // The current status of the item.
  Request[] requests; // List of status change requests made for the item in the form requests[requestID].
}

struct Request {
   uint96 submissionTime; // Time when the request was made. Used to track when the challenge period ends.
   address payable[3] parties; // Address of requester and challenger, if any, in the form parties[party].
}

enum DisputeStatus { None, AwaitingRuling, Resolved }

struct DisputeData {
  DisputeStatus status;
  Party ruling; // The final ruling given, if any.
  uint240 disputeID; // ID of the dispute, if any.
  Round[] rounds; // Tracks each round of a dispute in the form rounds[roundID].
}

mapping(bytes32 => mapping(uint256 => DipusteData)) requestDisputeData; // requestDisputeData[itemID][requestIndex]

struct ParamsChange {
  uint96 timestamp;
  address arbitrator;
  bytes arbitratorExtraData;
  string metaEvidence;
}

ParamsChange[] public paramsChanges;

function updateParams(address _arbitrator, bytes _arbitratorExtraData, string _metaEvidence) external onlyGovernor {
  paramsChanges.push(ParamsChange({
    timestamp: uint96(block.timestamp),
    arbitrator: _arbitrator,
    arbitratorExtraData: _arbitratorExtraData,
    metaEvidence: _metaEvidence,
  }));
}

function findBestParams(ParamsChange[] storage params, uint96 timestamp) internal pure returns(ParamsChange storage) {
   
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment