BanqAudit.sol

This is the smart contract that contains all the logic.

Below the overview of all functions in the smart contract. The detailed description of a state change function can be found in the tab of the specific function.

#State changing functions
function changeDev(address payable _dev) external returns (bool);
function RequestAudit(bytes32 _contracthash, string memory _link, uint256[4] memory _rewards) public payable returns (bool success);
function depositAudit(bytes32 _contracthash) public payable returns (bool success);
function SubmitReport(bytes32 _contracthash, bytes32 _reporthash, string memory _link, uint256[10] memory _bugID, uint256[10] memory _bugClaim) public returns (bool success);
function VerifyReport(uint256 _reportID, uint256[10] memory _bugClaim, bool received) public returns (bool success);
function ClaimResponse(uint256 _reportID, bool agreed) public returns (bool success);
function CloseAuditRequest(bytes32 _contracthash) public returns (bool success);
function CloseReport(uint256 _reportID) public returns (bool success);

#Non state changing functions
function getAuditData(bytes32 _contracthash) public view returns (uint256[4] memory);
function getAuditReports(bytes32 _contracthash) public view returns (uint256[] memory);
function getAuditValidators(bytes32 _contracthash) public view returns (address[] memory);
function getReportData(uint256 _indexReports, uint256 id) public view returns (uint256[10] memory);

High overview

State change functions

  • changeDev() can only be called by current the developer address. It changes the address to the new address. The developer address receives the fee payed.

  • RequestAudit() can be called by anyone and is used to enter an audit request.

  • depositAudit() can be called by anyone and is used to deposit additional funds to an open audit.

  • SubmitReport() can be called by anyone that is not the owner of the audit. It is used to submit a report for a specific audit.

  • VerifyReport() can only be called by the owner of the audit (auditee). It is used to respond to the report by the auditee.

  • ClaimResponse() can only be called by the owner of the report (auditor). It is used to respond to the report by the auditor.

  • CloseAuditRequest() can only be called by the owner of the audit. It is used to close the audit. This only is possible if no reports are open.

  • CloseReport() can only be called by the owner of the report. It is used to close the report if it contains a mistake.

Non state change functions

  • getAuditData() can be called by anyone and returns the array of rewards per risk .

  • getAuditReports() can be called by anyone and returns the array of report indexes for this audit.

  • getAuditValidators() can be called by anyone and returns the array of auditors that have validated the source code of the audit.

  • getReportData() can be called by anyone and returns the arrays in the report struct. The input id can be 0 (returns bugID's), 1 (returns bugRisk from auditor), 2 (returns bugRisk from auditee).

Last updated

Was this helpful?