function payWorker1(address schoolId) public payable returns(bool){
        require(Schools[schoolId].moneySent == false);
        require(Schools[schoolId].verified == true);
        Schools[schoolId].moneySent = true;
        return true;

But works fine when I just transfer to one account and without calculation. And function works properly just the amount is not transferred from the contract.

  • I would start with some debugging logs to output the calculations. We don't see enough of the contract to spot the problems. There are, at least, four variables and a set of accounts (array or mapping) that could be related to the problem. Consider showing a complete, small experimental contract that manifests the problem and the exact inputs someone needs to use to replicate the problem. – Rob Hitchens May 18 '19 at 20:21
  • Do the division last, not first! – goodvibration May 19 '19 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.