iamtrask / Sonar

DEPRECATED - Decentralized Machine Learning Server (hosted on Blockchain)
Apache License 2.0
141 stars 49 forks source link

Fix model warnings #52

Closed sagivo closed 6 years ago

sagivo commented 6 years ago

compiling the solidity model will yeild these warnings:

/ModelRepository.sol:112:5: Warning: Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
    Model model = models[grads[gradientId].modelId];
    ^---------^
,/ModelRepository.sol:139:24: Warning: Decimal literal assigned to bytesXX variable will be left-aligned. Use an explicit conversion to silence this warning.
    newWeights.first = 0;
                       ^
,/ModelRepository.sol:140:25: Warning: Decimal literal assigned to bytesXX variable will be left-aligned. Use an explicit conversion to silence this warning.
    newWeights.second = 0;
                        ^
,/ModelRepository.sol:97:3: Warning: Function state mutability can be restricted to pure
  function calculateIncentive(uint bounty, uint totalError, uint solvedError) constant public returns(uint total) {
  ^
Spanning multiple lines.

This PR will fix it! 💪 Please follow the individual commits for more info.