Skip to content

Instantly share code, notes, and snippets.

@0x3bfc
Last active January 4, 2019 14:27
Show Gist options
  • Save 0x3bfc/8a23df1036ae3226c4570761f1a1bd5a to your computer and use it in GitHub Desktop.
Save 0x3bfc/8a23df1036ae3226c4570761f1a1bd5a to your computer and use it in GitHub Desktop.
SecurifyReport.md
632.78s$ docker run -v $(pwd):/project chainsecurity/securify
Compiling project
Running Securify
Processing contract: /project/contracts/Migrations.sol:Migrations
Attempt to decompile the contract with methods...
Success. Inlining methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/OceanMarket.sol:OceanMarket
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/SLA/AccessConditions.sol:AccessConditions
Attempt to decompile the contract with methods...
Success. Inlining methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/SLA/ComputeConditions.sol:ComputeConditions
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/SLA/FitchainConditions.sol:FitchainConditions
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/SLA/PaymentConditions.sol:PaymentConditions
Attempt to decompile the contract with methods...
Success. Inlining methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/SLA/ServiceAgreement.sol:ServiceAgreement
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/auth/OceanAuth.sol:OceanAuth
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/didregistry/DIDRegistry.sol:DIDRegistry
Attempt to decompile the contract with methods...
Success. Inlining methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/contracts/token/OceanToken.sol:OceanToken
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/node_modules/openzeppelin-solidity/contracts/cryptography/ECDSA.sol:ECDSA
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol:SafeMath
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol:Ownable
Processing contract: /project/node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol:ERC20
Attempt to decompile the contract with methods...
Failed to decompile methods. Attempt to decompile the contract without identifying methods...
Propagating constants...
Verifying patterns...
Processing contract: /project/node_modules/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol:IERC20
Warning for LockedEther in contract 'Migrations':
|pragma solidity 0.4.25;
|
> |contract Migrations {
| address public owner;
| uint public last_completed_migration;
at /project/contracts/Migrations.sol(3)
*Violation* for MissingInputValidation in contract 'Migrations':
| }
|
> | function setCompleted(uint completed) public restricted {
| last_completed_migration = completed;
| }
at /project/contracts/Migrations.sol(15)
Warning for MissingInputValidation in contract 'Migrations':
|
|contract Migrations {
> | address public owner;
| uint public last_completed_migration;
|
at /project/contracts/Migrations.sol(4)
Warning for MissingInputValidation in contract 'Migrations':
|contract Migrations {
| address public owner;
> | uint public last_completed_migration;
|
| modifier restricted() {
at /project/contracts/Migrations.sol(5)
Warning for MissingInputValidation in contract 'Migrations':
| }
|
> | function upgrade(address new_address) public restricted {
| Migrations upgraded = Migrations(new_address);
| upgraded.setCompleted(last_completed_migration);
at /project/contracts/Migrations.sol(19)
Warning for UnhandledException in contract 'Migrations':
| function upgrade(address new_address) public restricted {
| Migrations upgraded = Migrations(new_address);
> | upgraded.setCompleted(last_completed_migration);
| }
|}
at /project/contracts/Migrations.sol(21)
Warning for UnrestrictedEtherFlow in contract 'Migrations':
| function upgrade(address new_address) public restricted {
| Migrations upgraded = Migrations(new_address);
> | upgraded.setCompleted(last_completed_migration);
| }
|}
at /project/contracts/Migrations.sol(21)
Warning for UnrestrictedWrite in contract 'Migrations':
|
| function setCompleted(uint completed) public restricted {
> | last_completed_migration = completed;
| }
|
at /project/contracts/Migrations.sol(16)
Warning for LockedEther in contract 'OceanMarket':
|*/
|
> |contract OceanMarket is Ownable {
|
| using SafeMath for uint256;
at /project/contracts/OceanMarket.sol(13)
Warning for UnhandledException in contract 'OceanMarket':
| uint256 _expire) public validAddress(msg.sender) returns (bool) {
| // consumer make payment to Market contract
> | require(mToken.transferFrom(msg.sender, address(this), _amount), 'Token transferFrom failed.');
| /* solium-disable-next-line security/no-block-members */
| mPayments[_paymentId] = Payment(msg.sender, _receiver, PaymentState.Locked, _amount, block.timestamp, _expire);
at /project/contracts/OceanMarket.sol(123)
Warning for UnhandledException in contract 'OceanMarket':
| // update state to avoid re-entry attack
| mPayments[_paymentId].state = PaymentState.Released;
> | require(mToken.transfer(mPayments[_paymentId].receiver, mPayments[_paymentId].amount), 'Token transfer failed.');
| emit PaymentReleased(_paymentId, mPayments[_paymentId].receiver);
| return true;
at /project/contracts/OceanMarket.sol(138)
Warning for UnhandledException in contract 'OceanMarket':
| // refund payment to consumer
| mPayments[_paymentId].state = PaymentState.Refunded;
> | require(mToken.transfer(mPayments[_paymentId].sender, mPayments[_paymentId].amount), 'Token transfer failed.');
| emit PaymentRefunded(_paymentId, mPayments[_paymentId].sender);
| return true;
at /project/contracts/OceanMarket.sol(151)
Warning for UnhandledException in contract 'OceanMarket':
| // amount should not exceed maxAmount
| if (amount > maxAmount) {
> | require(mToken.transfer(msg.sender, maxAmount), 'Token transfer failed.');
| emit LimitTokenRequest(msg.sender, amount, maxAmount);
| } else {
at /project/contracts/OceanMarket.sol(181)
Warning for UnhandledException in contract 'OceanMarket':
| emit LimitTokenRequest(msg.sender, amount, maxAmount);
| } else {
> | require(mToken.transfer(msg.sender, amount), 'Token transfer failed.');
| }
| /* solium-disable-next-line security/no-block-members */
at /project/contracts/OceanMarket.sol(184)
Warning for UnrestrictedEtherFlow in contract 'OceanMarket':
| uint256 _expire) public validAddress(msg.sender) returns (bool) {
| // consumer make payment to Market contract
> | require(mToken.transferFrom(msg.sender, address(this), _amount), 'Token transferFrom failed.');
| /* solium-disable-next-line security/no-block-members */
| mPayments[_paymentId] = Payment(msg.sender, _receiver, PaymentState.Locked, _amount, block.timestamp, _expire);
at /project/contracts/OceanMarket.sol(123)
Warning for UnrestrictedEtherFlow in contract 'OceanMarket':
| // update state to avoid re-entry attack
| mPayments[_paymentId].state = PaymentState.Released;
> | require(mToken.transfer(mPayments[_paymentId].receiver, mPayments[_paymentId].amount), 'Token transfer failed.');
| emit PaymentReleased(_paymentId, mPayments[_paymentId].receiver);
| return true;
at /project/contracts/OceanMarket.sol(138)
Warning for UnrestrictedEtherFlow in contract 'OceanMarket':
| // refund payment to consumer
| mPayments[_paymentId].state = PaymentState.Refunded;
> | require(mToken.transfer(mPayments[_paymentId].sender, mPayments[_paymentId].amount), 'Token transfer failed.');
| emit PaymentRefunded(_paymentId, mPayments[_paymentId].sender);
| return true;
at /project/contracts/OceanMarket.sol(151)
Warning for UnrestrictedEtherFlow in contract 'OceanMarket':
| // amount should not exceed maxAmount
| if (amount > maxAmount) {
> | require(mToken.transfer(msg.sender, maxAmount), 'Token transfer failed.');
| emit LimitTokenRequest(msg.sender, amount, maxAmount);
| } else {
at /project/contracts/OceanMarket.sol(181)
Warning for UnrestrictedEtherFlow in contract 'OceanMarket':
| emit LimitTokenRequest(msg.sender, amount, maxAmount);
| } else {
> | require(mToken.transfer(msg.sender, amount), 'Token transfer failed.');
| }
| /* solium-disable-next-line security/no-block-members */
at /project/contracts/OceanMarket.sol(184)
*Violation* for UnrestrictedWrite in contract 'OceanMarket':
| function deactivateAsset(bytes32 assetId) public returns (bool){
| // disable asset if it is not whitelisted in the registry
> | mAssets[assetId].active = false;
| return true;
| }
at /project/contracts/OceanMarket.sol(210)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| }
| /* solium-disable-next-line security/no-block-members */
> | tokenRequest[msg.sender] = block.timestamp;
| return true;
| }
at /project/contracts/OceanMarket.sol(187)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| mapping(bytes32 => Payment) private mPayments; // mapping from id to associated payment struct
|
> | // limit period for reques of tokens
| mapping(address => uint256) private tokenRequest; // mapping from address to last time of request
| uint256 maxAmount = 10000 * 10 ** 18; // max amount of tokens user can get for each request
at /project/contracts/OceanMarket.sol(40)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| // EVENTS:
| // ============
> | event AssetRegistered(bytes32 indexed _assetId, address indexed _owner);
| event FrequentTokenRequest(address indexed _requester, uint256 _minPeriod);
| event LimitTokenRequest(address indexed _requester, uint256 _amount, uint256 _maxAmount);
at /project/contracts/OceanMarket.sol(54)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| function register(bytes32 assetId, uint256 price) public validAddress(msg.sender) returns (bool success) {
| require(mAssets[assetId].owner == address(0), 'Owner address is not 0x0.');
> | mAssets[assetId] = Asset(msg.sender, price, false);
| mAssets[assetId].active = true;
|
at /project/contracts/OceanMarket.sol(102)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| require(mAssets[assetId].owner == address(0), 'Owner address is not 0x0.');
| mAssets[assetId] = Asset(msg.sender, price, false);
> | mAssets[assetId].active = true;
|
| emit AssetRegistered(assetId, msg.sender);
at /project/contracts/OceanMarket.sol(103)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| require(mToken.transferFrom(msg.sender, address(this), _amount), 'Token transferFrom failed.');
| /* solium-disable-next-line security/no-block-members */
> | mPayments[_paymentId] = Payment(msg.sender, _receiver, PaymentState.Locked, _amount, block.timestamp, _expire);
| emit PaymentReceived(_paymentId, _receiver, _amount, _expire);
| return true;
at /project/contracts/OceanMarket.sol(125)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| function releasePayment(bytes32 _paymentId) public isLocked(_paymentId) isAuthContract() returns (bool) {
| // update state to avoid re-entry attack
> | mPayments[_paymentId].state = PaymentState.Released;
| require(mToken.transfer(mPayments[_paymentId].receiver, mPayments[_paymentId].amount), 'Token transfer failed.');
| emit PaymentReleased(_paymentId, mPayments[_paymentId].receiver);
at /project/contracts/OceanMarket.sol(137)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| function refundPayment(bytes32 _paymentId) public isLocked(_paymentId) isAuthContract() returns (bool) {
| // refund payment to consumer
> | mPayments[_paymentId].state = PaymentState.Refunded;
| require(mToken.transfer(mPayments[_paymentId].sender, mPayments[_paymentId].amount), 'Token transfer failed.');
| emit PaymentRefunded(_paymentId, mPayments[_paymentId].sender);
at /project/contracts/OceanMarket.sol(150)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| function limitTokenRequest(uint _amount, uint _period) public onlyOwner() {
| // set min period of time before next request (in seconds)
> | minPeriod = _period;
| // set max amount for each request
| maxAmount = _amount;
at /project/contracts/OceanMarket.sol(198)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| minPeriod = _period;
| // set max amount for each request
> | maxAmount = _amount;
| }
|
at /project/contracts/OceanMarket.sol(200)
Warning for UnrestrictedWrite in contract 'OceanMarket':
| // authAddress can only be set at deployment of Auth contract - only once
| require(authAddress == address(0), 'authAddress is not 0x0');
> | authAddress = msg.sender;
| return true;
| }
at /project/contracts/OceanMarket.sol(221)
Warning for LockedEther in contract 'AccessConditions':
|/// @dev All function calls are currently implement without side effects
|
> |contract AccessConditions{
|
| mapping(bytes32 => mapping(address => bool)) private assetPermissions;
at /project/contracts/SLA/AccessConditions.sol(9)
*Violation* for MissingInputValidation in contract 'AccessConditions':
| }
|
> | function checkPermissions(address consumer, bytes32 documentKeyId) public view returns(bool) {
| return assetPermissions[documentKeyId][consumer];
| }
at /project/contracts/SLA/AccessConditions.sol(26)
*Violation* for MissingInputValidation in contract 'AccessConditions':
| }
|
> | function grantAccess(bytes32 serviceId, bytes32 assetId, bytes32 documentKeyId) public onlySLAPublisher(serviceId, msg.sender) returns (bool) {
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceId, address(this), this.grantAccess.selector);
| bool allgood = !serviceAgreementStorage.hasUnfulfilledDependencies(serviceId, condition);
at /project/contracts/SLA/AccessConditions.sol(30)
Warning for UnhandledException in contract 'AccessConditions':
|
| modifier onlySLAPublisher(bytes32 serviceId, address publisher) {
> | require(serviceAgreementStorage.getAgreementPublisher(serviceId) == publisher, 'Restricted access - only SLA publisher');
| _;
| }
at /project/contracts/SLA/AccessConditions.sol(17)
Warning for UnhandledException in contract 'AccessConditions':
|
| function grantAccess(bytes32 serviceId, bytes32 assetId, bytes32 documentKeyId) public onlySLAPublisher(serviceId, msg.sender) returns (bool) {
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceId, address(this), this.grantAccess.selector);
| bool allgood = !serviceAgreementStorage.hasUnfulfilledDependencies(serviceId, condition);
| if (!allgood)
at /project/contracts/SLA/AccessConditions.sol(31)
Warning for UnhandledException in contract 'AccessConditions':
| function grantAccess(bytes32 serviceId, bytes32 assetId, bytes32 documentKeyId) public onlySLAPublisher(serviceId, msg.sender) returns (bool) {
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceId, address(this), this.grantAccess.selector);
> | bool allgood = !serviceAgreementStorage.hasUnfulfilledDependencies(serviceId, condition);
| if (!allgood)
| return;
at /project/contracts/SLA/AccessConditions.sol(32)
Warning for UnhandledException in contract 'AccessConditions':
| bytes32 valueHash = keccak256(abi.encodePacked(assetId, documentKeyId));
| require(
> | serviceAgreementStorage.fulfillCondition(serviceId, this.grantAccess.selector, valueHash),
| 'Cannot fulfill grantAccess condition'
| );
at /project/contracts/SLA/AccessConditions.sol(38)
Warning for UnhandledException in contract 'AccessConditions':
| 'Cannot fulfill grantAccess condition'
| );
> | address consumer = serviceAgreementStorage.getAgreementConsumer(serviceId);
| assetPermissions[documentKeyId][consumer] = true;
| emit AccessGranted(serviceId, assetId);
at /project/contracts/SLA/AccessConditions.sol(41)
Warning for UnrestrictedEtherFlow in contract 'AccessConditions':
|
| modifier onlySLAPublisher(bytes32 serviceId, address publisher) {
> | require(serviceAgreementStorage.getAgreementPublisher(serviceId) == publisher, 'Restricted access - only SLA publisher');
| _;
| }
at /project/contracts/SLA/AccessConditions.sol(17)
Warning for UnrestrictedEtherFlow in contract 'AccessConditions':
|
| function grantAccess(bytes32 serviceId, bytes32 assetId, bytes32 documentKeyId) public onlySLAPublisher(serviceId, msg.sender) returns (bool) {
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceId, address(this), this.grantAccess.selector);
| bool allgood = !serviceAgreementStorage.hasUnfulfilledDependencies(serviceId, condition);
| if (!allgood)
at /project/contracts/SLA/AccessConditions.sol(31)
Warning for UnrestrictedEtherFlow in contract 'AccessConditions':
| function grantAccess(bytes32 serviceId, bytes32 assetId, bytes32 documentKeyId) public onlySLAPublisher(serviceId, msg.sender) returns (bool) {
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceId, address(this), this.grantAccess.selector);
> | bool allgood = !serviceAgreementStorage.hasUnfulfilledDependencies(serviceId, condition);
| if (!allgood)
| return;
at /project/contracts/SLA/AccessConditions.sol(32)
Warning for UnrestrictedEtherFlow in contract 'AccessConditions':
| bytes32 valueHash = keccak256(abi.encodePacked(assetId, documentKeyId));
| require(
> | serviceAgreementStorage.fulfillCondition(serviceId, this.grantAccess.selector, valueHash),
| 'Cannot fulfill grantAccess condition'
| );
at /project/contracts/SLA/AccessConditions.sol(38)
Warning for UnrestrictedEtherFlow in contract 'AccessConditions':
| 'Cannot fulfill grantAccess condition'
| );
> | address consumer = serviceAgreementStorage.getAgreementConsumer(serviceId);
| assetPermissions[documentKeyId][consumer] = true;
| emit AccessGranted(serviceId, assetId);
at /project/contracts/SLA/AccessConditions.sol(41)
*Violation* for UnrestrictedWrite in contract 'AccessConditions':
| );
| address consumer = serviceAgreementStorage.getAgreementConsumer(serviceId);
> | assetPermissions[documentKeyId][consumer] = true;
| emit AccessGranted(serviceId, assetId);
| }
at /project/contracts/SLA/AccessConditions.sol(42)
Warning for LockedEther in contract 'ComputeConditions':
|/// @dev All function calls are currently implement without side effects
|
> |contract ComputeConditions {
|
| struct ProofOfUpload {
at /project/contracts/SLA/ComputeConditions.sol(11)
Warning for UnhandledException in contract 'ComputeConditions':
|
| modifier onlyDataConsumer(bytes32 serviceAgreementId) {
> | require(msg.sender == serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), 'Invalid data scientist address!');
| _;
| }
at /project/contracts/SLA/ComputeConditions.sol(32)
Warning for UnhandledException in contract 'ComputeConditions':
|
| modifier onlyComputePublisher(bytes32 serviceAgreementId) {
> | require(msg.sender == serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), 'Invalid publisher address');
| _;
|
at /project/contracts/SLA/ComputeConditions.sol(37)
Warning for UnhandledException in contract 'ComputeConditions':
| }
|
> | modifier onlyStakeholders(bytes32 serviceAgreementId) {
| require(msg.sender == serviceAgreementStorage.getAgreementPublisher(serviceAgreementId) || msg.sender == serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), 'Access denied');
| require(!proofs[serviceAgreementId].isValid, 'avoid replay attack');
at /project/contracts/SLA/ComputeConditions.sol(42)
Warning for UnhandledException in contract 'ComputeConditions':
|
| modifier onlyStakeholders(bytes32 serviceAgreementId) {
> | require(msg.sender == serviceAgreementStorage.getAgreementPublisher(serviceAgreementId) || msg.sender == serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), 'Access denied');
| require(!proofs[serviceAgreementId].isValid, 'avoid replay attack');
| _;
at /project/contracts/SLA/ComputeConditions.sol(43)
Warning for UnhandledException in contract 'ComputeConditions':
| if(proofs[serviceAgreementId].exists){
| if(proofs[serviceAgreementId].isLocked) { // avoid race conditions
> | emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), false);
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(62)
Warning for UnhandledException in contract 'ComputeConditions':
| fulfillUpload(serviceAgreementId, true);
| }else{
> | proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), bytes32(0), signature);
| }
| emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
at /project/contracts/SLA/ComputeConditions.sol(69)
Warning for UnhandledException in contract 'ComputeConditions':
| proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), bytes32(0), signature);
| }
> | emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
| proofs[serviceAgreementId].isLocked = false;
| return true;
at /project/contracts/SLA/ComputeConditions.sol(71)
Warning for UnhandledException in contract 'ComputeConditions':
| if(proofs[serviceAgreementId].exists){
| if(proofs[serviceAgreementId].isLocked) { // avoid race conditions
> | emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), false);
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(86)
Warning for UnhandledException in contract 'ComputeConditions':
| fulfillUpload(serviceAgreementId, true);
| }else{
> | proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), hash, new bytes(0));
| }
| emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
at /project/contracts/SLA/ComputeConditions.sol(93)
Warning for UnhandledException in contract 'ComputeConditions':
| proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), hash, new bytes(0));
| }
> | emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
| proofs[serviceAgreementId].isLocked = false;
| return true;
at /project/contracts/SLA/ComputeConditions.sol(95)
Warning for UnhandledException in contract 'ComputeConditions':
| /// @param state get be used fo input value hash for this condition indicating the state of verification
| function fulfillUpload(bytes32 serviceAgreementId, bool state) public onlyStakeholders(serviceAgreementId) returns(bool status) {
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceAgreementId, address(this), this.fulfillUpload.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(serviceAgreementId, condition)){
| emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
at /project/contracts/SLA/ComputeConditions.sol(107)
Warning for UnhandledException in contract 'ComputeConditions':
| function fulfillUpload(bytes32 serviceAgreementId, bool state) public onlyStakeholders(serviceAgreementId) returns(bool status) {
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceAgreementId, address(this), this.fulfillUpload.selector);
> | if (serviceAgreementStorage.hasUnfulfilledDependencies(serviceAgreementId, condition)){
| emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return false;
at /project/contracts/SLA/ComputeConditions.sol(108)
Warning for UnhandledException in contract 'ComputeConditions':
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceAgreementId, address(this), this.fulfillUpload.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(serviceAgreementId, condition)){
> | emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(109)
Warning for UnhandledException in contract 'ComputeConditions':
| }
|
> | if (serviceAgreementStorage.getConditionStatus(serviceAgreementId, condition) == 1) {
| emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return true;
at /project/contracts/SLA/ComputeConditions.sol(113)
Warning for UnhandledException in contract 'ComputeConditions':
|
| if (serviceAgreementStorage.getConditionStatus(serviceAgreementId, condition) == 1) {
> | emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return true;
| }
at /project/contracts/SLA/ComputeConditions.sol(114)
Warning for UnhandledException in contract 'ComputeConditions':
|
| if(proofs[serviceAgreementId].dataConsumer == ECDSA.recover(ECDSA.toEthSignedMessageHash(proofs[serviceAgreementId].algorithmHash), proofs[serviceAgreementId].algorithmHashSignature)) {
> | serviceAgreementStorage.fulfillCondition(serviceAgreementId, this.fulfillUpload.selector, keccak256(abi.encodePacked(state)));
| emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| proofs[serviceAgreementId].isValid = true;
at /project/contracts/SLA/ComputeConditions.sol(119)
Warning for UnhandledException in contract 'ComputeConditions':
| if(proofs[serviceAgreementId].dataConsumer == ECDSA.recover(ECDSA.toEthSignedMessageHash(proofs[serviceAgreementId].algorithmHash), proofs[serviceAgreementId].algorithmHashSignature)) {
| serviceAgreementStorage.fulfillCondition(serviceAgreementId, this.fulfillUpload.selector, keccak256(abi.encodePacked(state)));
> | emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| proofs[serviceAgreementId].isValid = true;
| return true;
at /project/contracts/SLA/ComputeConditions.sol(120)
Warning for UnhandledException in contract 'ComputeConditions':
| return true;
| }
> | emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(124)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
|
| modifier onlyDataConsumer(bytes32 serviceAgreementId) {
> | require(msg.sender == serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), 'Invalid data scientist address!');
| _;
| }
at /project/contracts/SLA/ComputeConditions.sol(32)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
|
| modifier onlyComputePublisher(bytes32 serviceAgreementId) {
> | require(msg.sender == serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), 'Invalid publisher address');
| _;
|
at /project/contracts/SLA/ComputeConditions.sol(37)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| }
|
> | modifier onlyStakeholders(bytes32 serviceAgreementId) {
| require(msg.sender == serviceAgreementStorage.getAgreementPublisher(serviceAgreementId) || msg.sender == serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), 'Access denied');
| require(!proofs[serviceAgreementId].isValid, 'avoid replay attack');
at /project/contracts/SLA/ComputeConditions.sol(42)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
|
| modifier onlyStakeholders(bytes32 serviceAgreementId) {
> | require(msg.sender == serviceAgreementStorage.getAgreementPublisher(serviceAgreementId) || msg.sender == serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), 'Access denied');
| require(!proofs[serviceAgreementId].isValid, 'avoid replay attack');
| _;
at /project/contracts/SLA/ComputeConditions.sol(43)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| if(proofs[serviceAgreementId].exists){
| if(proofs[serviceAgreementId].isLocked) { // avoid race conditions
> | emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), false);
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(62)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| fulfillUpload(serviceAgreementId, true);
| }else{
> | proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), bytes32(0), signature);
| }
| emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
at /project/contracts/SLA/ComputeConditions.sol(69)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), bytes32(0), signature);
| }
> | emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
| proofs[serviceAgreementId].isLocked = false;
| return true;
at /project/contracts/SLA/ComputeConditions.sol(71)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| if(proofs[serviceAgreementId].exists){
| if(proofs[serviceAgreementId].isLocked) { // avoid race conditions
> | emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), false);
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(86)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| fulfillUpload(serviceAgreementId, true);
| }else{
> | proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), hash, new bytes(0));
| }
| emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
at /project/contracts/SLA/ComputeConditions.sol(93)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), hash, new bytes(0));
| }
> | emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
| proofs[serviceAgreementId].isLocked = false;
| return true;
at /project/contracts/SLA/ComputeConditions.sol(95)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| /// @param state get be used fo input value hash for this condition indicating the state of verification
| function fulfillUpload(bytes32 serviceAgreementId, bool state) public onlyStakeholders(serviceAgreementId) returns(bool status) {
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceAgreementId, address(this), this.fulfillUpload.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(serviceAgreementId, condition)){
| emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
at /project/contracts/SLA/ComputeConditions.sol(107)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| function fulfillUpload(bytes32 serviceAgreementId, bool state) public onlyStakeholders(serviceAgreementId) returns(bool status) {
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceAgreementId, address(this), this.fulfillUpload.selector);
> | if (serviceAgreementStorage.hasUnfulfilledDependencies(serviceAgreementId, condition)){
| emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return false;
at /project/contracts/SLA/ComputeConditions.sol(108)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(serviceAgreementId, address(this), this.fulfillUpload.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(serviceAgreementId, condition)){
> | emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(109)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| }
|
> | if (serviceAgreementStorage.getConditionStatus(serviceAgreementId, condition) == 1) {
| emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return true;
at /project/contracts/SLA/ComputeConditions.sol(113)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
|
| if (serviceAgreementStorage.getConditionStatus(serviceAgreementId, condition) == 1) {
> | emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return true;
| }
at /project/contracts/SLA/ComputeConditions.sol(114)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
|
| if(proofs[serviceAgreementId].dataConsumer == ECDSA.recover(ECDSA.toEthSignedMessageHash(proofs[serviceAgreementId].algorithmHash), proofs[serviceAgreementId].algorithmHashSignature)) {
> | serviceAgreementStorage.fulfillCondition(serviceAgreementId, this.fulfillUpload.selector, keccak256(abi.encodePacked(state)));
| emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| proofs[serviceAgreementId].isValid = true;
at /project/contracts/SLA/ComputeConditions.sol(119)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| if(proofs[serviceAgreementId].dataConsumer == ECDSA.recover(ECDSA.toEthSignedMessageHash(proofs[serviceAgreementId].algorithmHash), proofs[serviceAgreementId].algorithmHashSignature)) {
| serviceAgreementStorage.fulfillCondition(serviceAgreementId, this.fulfillUpload.selector, keccak256(abi.encodePacked(state)));
> | emit ProofOfUploadValid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| proofs[serviceAgreementId].isValid = true;
| return true;
at /project/contracts/SLA/ComputeConditions.sol(120)
Warning for UnrestrictedEtherFlow in contract 'ComputeConditions':
| return true;
| }
> | emit ProofOfUploadInvalid(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId));
| return false;
| }
at /project/contracts/SLA/ComputeConditions.sol(124)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
|/// @dev All function calls are currently implement without side effects
|
> |contract ComputeConditions {
|
| struct ProofOfUpload {
at /project/contracts/SLA/ComputeConditions.sol(11)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| return false;
| }
> | proofs[serviceAgreementId].isLocked = true;
| proofs[serviceAgreementId].algorithmHashSignature = signature;
| fulfillUpload(serviceAgreementId, true);
at /project/contracts/SLA/ComputeConditions.sol(65)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| fulfillUpload(serviceAgreementId, true);
| }else{
> | proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), bytes32(0), signature);
| }
| emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
at /project/contracts/SLA/ComputeConditions.sol(69)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| }
| emit HashSignatureSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
> | proofs[serviceAgreementId].isLocked = false;
| return true;
|
at /project/contracts/SLA/ComputeConditions.sol(72)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| }
| emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
> | proofs[serviceAgreementId].isLocked = false;
| return true;
| }
at /project/contracts/SLA/ComputeConditions.sol(96)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| return false;
| }
> | proofs[serviceAgreementId].isLocked = true;
| proofs[serviceAgreementId].algorithmHash = hash;
| fulfillUpload(serviceAgreementId, true);
at /project/contracts/SLA/ComputeConditions.sol(89)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| }
| proofs[serviceAgreementId].isLocked = true;
> | proofs[serviceAgreementId].algorithmHash = hash;
| fulfillUpload(serviceAgreementId, true);
| }else{
at /project/contracts/SLA/ComputeConditions.sol(90)
Warning for UnrestrictedWrite in contract 'ComputeConditions':
| fulfillUpload(serviceAgreementId, true);
| }else{
> | proofs[serviceAgreementId] = ProofOfUpload(true, false, true, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), hash, new bytes(0));
| }
| emit HashSubmitted(serviceAgreementId, serviceAgreementStorage.getAgreementConsumer(serviceAgreementId), serviceAgreementStorage.getAgreementPublisher(serviceAgreementId), true);
at /project/contracts/SLA/ComputeConditions.sol(93)
Warning for LockedEther in contract 'FitchainConditions':
|/// TODO: use enum VoteType rather than 1 and 2
|
> |contract FitchainConditions{
|
| using SafeMath for uint256;
at /project/contracts/SLA/FitchainConditions.sol(15)
Warning for UnhandledException in contract 'FitchainConditions':
|
| modifier onlyPublisher(bytes32 modelId){
> | require(serviceAgreementStorage.getAgreementPublisher(modelId) == msg.sender, 'service provider has to be publisher');
| _;
| }
at /project/contracts/SLA/FitchainConditions.sol(72)
Warning for UnhandledException in contract 'FitchainConditions':
| }
| // init model
> | models[modelId] = Model(true, false, false, k, new uint256[](2), bytes32(0), serviceAgreementStorage.getAgreementConsumer(modelId), serviceAgreementStorage.getAgreementPublisher(modelId));
| // get k GPC verifiers
| require(electRRKVerifiers(modelId, k, 1, timeout), 'unable to allocate resources');
at /project/contracts/SLA/FitchainConditions.sol(212)
Warning for UnhandledException in contract 'FitchainConditions':
| if(models[modelId].GPCVerifiers[msg.sender].vote) models[modelId].voteCount[0] +=1;
| if(models[modelId].voteCount[0] == models[modelId].Kverifiers) {
> | emit VotesSubmitted(modelId, serviceAgreementStorage.getAgreementPublisher(modelId), 1);
| }
| return true;
at /project/contracts/SLA/FitchainConditions.sol(251)
Warning for UnhandledException in contract 'FitchainConditions':
| //TODO: commit-reveal scheme to be implemented!
| if(models[modelId].VPCVerifiers[msg.sender].vote) models[modelId].voteCount[1] +=1;
> | if(models[modelId].voteCount[1] == models[modelId].Kverifiers) emit VotesSubmitted(modelId, serviceAgreementStorage.getAgreementPublisher(modelId), 2);
| return true;
| }
at /project/contracts/SLA/FitchainConditions.sol(270)
Warning for UnhandledException in contract 'FitchainConditions':
| /// @param count , represents the number of submitted votes by verifiers who testify that they check the existence of proof in Fitchain
| function setPoT(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 0, count) onlyPublisher(modelId) returns(bool){
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setPoT.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit TrainingConditionState(modelId, false);
at /project/contracts/SLA/FitchainConditions.sol(280)
Warning for UnhandledException in contract 'FitchainConditions':
| function setPoT(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 0, count) onlyPublisher(modelId) returns(bool){
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setPoT.selector);
> | if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit TrainingConditionState(modelId, false);
| return false;
at /project/contracts/SLA/FitchainConditions.sol(281)
Warning for UnhandledException in contract 'FitchainConditions':
| return false;
| }
> | if (serviceAgreementStorage.getConditionStatus(modelId, condition) == 1) {
| emit TrainingConditionState(modelId, true);
| return true;
at /project/contracts/SLA/FitchainConditions.sol(285)
Warning for UnhandledException in contract 'FitchainConditions':
| return true;
| }
> | serviceAgreementStorage.fulfillCondition(modelId, this.setPoT.selector, keccak256(abi.encodePacked(count)));
| emit TrainingConditionState(modelId, true);
| models[modelId].isTrained = true;
at /project/contracts/SLA/FitchainConditions.sol(289)
Warning for UnhandledException in contract 'FitchainConditions':
| /// @param count , represents the number of submitted votes by verifiers who testify that they check the existence of proof in Fitchain
| function setVPC(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 1, count) onlyPublisher(modelId) returns(bool){
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setVPC.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit VerificationConditionState(modelId, false);
at /project/contracts/SLA/FitchainConditions.sol(301)
Warning for UnhandledException in contract 'FitchainConditions':
| function setVPC(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 1, count) onlyPublisher(modelId) returns(bool){
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setVPC.selector);
> | if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit VerificationConditionState(modelId, false);
| return false;
at /project/contracts/SLA/FitchainConditions.sol(302)
Warning for UnhandledException in contract 'FitchainConditions':
| return false;
| }
> | if (serviceAgreementStorage.getConditionStatus(modelId, condition) == 1) {
| emit VerificationConditionState(modelId, true);
| return true;
at /project/contracts/SLA/FitchainConditions.sol(306)
Warning for UnhandledException in contract 'FitchainConditions':
| return true;
| }
> | serviceAgreementStorage.fulfillCondition(modelId, this.setVPC.selector, keccak256(abi.encodePacked(models[modelId].voteCount[1])));
| emit VerificationConditionState(modelId, true);
| models[modelId].isVerified = true;
at /project/contracts/SLA/FitchainConditions.sol(310)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
|
| modifier onlyPublisher(bytes32 modelId){
> | require(serviceAgreementStorage.getAgreementPublisher(modelId) == msg.sender, 'service provider has to be publisher');
| _;
| }
at /project/contracts/SLA/FitchainConditions.sol(72)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| }
| // init model
> | models[modelId] = Model(true, false, false, k, new uint256[](2), bytes32(0), serviceAgreementStorage.getAgreementConsumer(modelId), serviceAgreementStorage.getAgreementPublisher(modelId));
| // get k GPC verifiers
| require(electRRKVerifiers(modelId, k, 1, timeout), 'unable to allocate resources');
at /project/contracts/SLA/FitchainConditions.sol(212)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| if(models[modelId].GPCVerifiers[msg.sender].vote) models[modelId].voteCount[0] +=1;
| if(models[modelId].voteCount[0] == models[modelId].Kverifiers) {
> | emit VotesSubmitted(modelId, serviceAgreementStorage.getAgreementPublisher(modelId), 1);
| }
| return true;
at /project/contracts/SLA/FitchainConditions.sol(251)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| //TODO: commit-reveal scheme to be implemented!
| if(models[modelId].VPCVerifiers[msg.sender].vote) models[modelId].voteCount[1] +=1;
> | if(models[modelId].voteCount[1] == models[modelId].Kverifiers) emit VotesSubmitted(modelId, serviceAgreementStorage.getAgreementPublisher(modelId), 2);
| return true;
| }
at /project/contracts/SLA/FitchainConditions.sol(270)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| /// @param count , represents the number of submitted votes by verifiers who testify that they check the existence of proof in Fitchain
| function setPoT(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 0, count) onlyPublisher(modelId) returns(bool){
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setPoT.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit TrainingConditionState(modelId, false);
at /project/contracts/SLA/FitchainConditions.sol(280)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| function setPoT(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 0, count) onlyPublisher(modelId) returns(bool){
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setPoT.selector);
> | if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit TrainingConditionState(modelId, false);
| return false;
at /project/contracts/SLA/FitchainConditions.sol(281)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| return false;
| }
> | if (serviceAgreementStorage.getConditionStatus(modelId, condition) == 1) {
| emit TrainingConditionState(modelId, true);
| return true;
at /project/contracts/SLA/FitchainConditions.sol(285)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| return true;
| }
> | serviceAgreementStorage.fulfillCondition(modelId, this.setPoT.selector, keccak256(abi.encodePacked(count)));
| emit TrainingConditionState(modelId, true);
| models[modelId].isTrained = true;
at /project/contracts/SLA/FitchainConditions.sol(289)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| /// @param count , represents the number of submitted votes by verifiers who testify that they check the existence of proof in Fitchain
| function setVPC(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 1, count) onlyPublisher(modelId) returns(bool){
> | bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setVPC.selector);
| if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit VerificationConditionState(modelId, false);
at /project/contracts/SLA/FitchainConditions.sol(301)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| function setVPC(bytes32 modelId, uint256 count) public onlyValidVotes(modelId, 1, count) onlyPublisher(modelId) returns(bool){
| bytes32 condition = serviceAgreementStorage.getConditionByFingerprint(modelId, address(this), this.setVPC.selector);
> | if (serviceAgreementStorage.hasUnfulfilledDependencies(modelId, condition)){
| emit VerificationConditionState(modelId, false);
| return false;
at /project/contracts/SLA/FitchainConditions.sol(302)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| return false;
| }
> | if (serviceAgreementStorage.getConditionStatus(modelId, condition) == 1) {
| emit VerificationConditionState(modelId, true);
| return true;
at /project/contracts/SLA/FitchainConditions.sol(306)
Warning for UnrestrictedEtherFlow in contract 'FitchainConditions':
| return true;
| }
> | serviceAgreementStorage.fulfillCondition(modelId, this.setVPC.selector, keccak256(abi.encodePacked(models[modelId].voteCount[1])));
| emit VerificationConditionState(modelId, true);
| models[modelId].isVerified = true;
at /project/contracts/SLA/FitchainConditions.sol(310)
*Violation* for UnrestrictedWrite in contract 'FitchainConditions':
|pragma solidity ^0.4.25;
|
> |import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
|import './ServiceAgreement.sol';
|
at /project/contracts/SLA/FitchainConditions.sol(3)
*Violation* for UnrestrictedWrite in contract 'FitchainConditions':
|/// TODO: use enum VoteType rather than 1 and 2
|
> |contract FitchainConditions{
|
| using SafeMath for uint256;
at /project/contracts/SLA/FitchainConditions.sol(15)
*Violation* for UnrestrictedWrite in contract 'FitchainConditions':
| for(uint256 i=0; i < slots; i++)
| //TODO: the below line prone to 51% attack
> | registry.push(msg.sender);
| emit VerifierRegistered(msg.sender, slots);
| return true;
at /project/contracts/SLA/FitchainConditions.sol(131)
*Violation* for UnrestrictedWrite in contract 'FitchainConditions':
| serviceAgreementStorage.fulfillCondition(modelId, this.setPoT.selector, keccak256(abi.encodePacked(count)));
| emit TrainingConditionState(modelId, true);
> | models[modelId].isTrained = true;
| return true;
| }
at /project/contracts/SLA/FitchainConditions.sol(291)
*Violation* for UnrestrictedWrite in contract 'FitchainConditions':
| serviceAgreementStorage.fulfillCondition(modelId, this.setVPC.selector, keccak256(abi.encodePacked(models[modelId].voteCount[1])));
| emit VerificationConditionState(modelId, true);
> | models[modelId].isVerified = true;
| return true;
| }
at /project/contracts/SLA/FitchainConditions.sol(312)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| function registerVerifier(uint256 slots) public onlyValidSlotsValue(slots) returns(bool){
| // TODO: cut this stake from the verifier's balance
> | verifiers[msg.sender] = Actor(true, stake * slots, slots, slots);
| for(uint256 i=0; i < slots; i++)
| //TODO: the below line prone to 51% attack
at /project/contracts/SLA/FitchainConditions.sol(128)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| function deregisterVerifier() public onlyFreeSlots() returns(bool) {
| if(removeVerifierFromRegistry(msg.sender)){
> | verifiers[msg.sender].isStaking = false;
| //TODO: send back stake to verifier
| verifiers[msg.sender].amount = 0;
at /project/contracts/SLA/FitchainConditions.sol(141)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| verifiers[msg.sender].isStaking = false;
| //TODO: send back stake to verifier
> | verifiers[msg.sender].amount = 0;
| }
| emit VerifierDeregistered(msg.sender);
at /project/contracts/SLA/FitchainConditions.sol(143)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| require(!models[modelId].isTrained, 'avoid replay attack');
| require(!models[modelId].GPCVerifiers[msg.sender].nonce, 'avoid replay attack');
> | models[modelId].GPCVerifiers[msg.sender].vote = vote;
| models[modelId].GPCVerifiers[msg.sender].nonce = true;
| //TODO: if vote is false or true, we should follow the majority in order to slash the losers
at /project/contracts/SLA/FitchainConditions.sol(244)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| require(!models[modelId].GPCVerifiers[msg.sender].nonce, 'avoid replay attack');
| models[modelId].GPCVerifiers[msg.sender].vote = vote;
> | models[modelId].GPCVerifiers[msg.sender].nonce = true;
| //TODO: if vote is false or true, we should follow the majority in order to slash the losers
| //TODO: the losers. They might be verifiers or model provider
at /project/contracts/SLA/FitchainConditions.sol(245)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| require(!models[modelId].isVerified, 'avoid replay attack');
| require(!models[modelId].VPCVerifiers[msg.sender].nonce, 'avoid replay attack');
> | models[modelId].VPCVerifiers[msg.sender].vote = vote;
| models[modelId].VPCVerifiers[msg.sender].nonce = true;
| //TODO: if vote is false or true, we should follow the majority in order to slash the losers
at /project/contracts/SLA/FitchainConditions.sol(264)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| require(!models[modelId].VPCVerifiers[msg.sender].nonce, 'avoid replay attack');
| models[modelId].VPCVerifiers[msg.sender].vote = vote;
> | models[modelId].VPCVerifiers[msg.sender].nonce = true;
| //TODO: if vote is false or true, we should follow the majority in order to slash the losers
| //TODO: They might be verifiers or compute-data provider
at /project/contracts/SLA/FitchainConditions.sol(265)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
|/// TODO: use enum VoteType rather than 1 and 2
|
> |contract FitchainConditions{
|
| using SafeMath for uint256;
at /project/contracts/SLA/FitchainConditions.sol(15)
Warning for UnrestrictedWrite in contract 'FitchainConditions':
| }
| // init model
> | models[modelId] = Model(true, false, false, k, new uint256[](2), bytes32(0), serviceAgreementStorage.getAgreementConsumer(modelId), serviceAgreementStorage.getAgreementPublisher(modelId));
| // get k GPC verifiers
| require(electRRKVerifiers(modelId, k, 1, timeout), 'unable to allocate resources');
at /project/contracts/SLA/FitchainConditions.sol(212)
Warning for LockedEther in contract 'PaymentConditions':
|/// @dev All function calls are currently implement without side effects
|
> |contract PaymentConditions {
|
| struct Payment {
at /project/contracts/SLA/PaymentConditions.sol(11)
write /dev/stdout: resource temporarily unavailable
The command "docker run -v $(pwd):/project chainsecurity/securify" exited with 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment