This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Web3\Web3; | |
use Web3\Providers\HttpProvider; | |
use Web3\RequestManagers\RequestManager; | |
use Web3\Contract; | |
use Web3\Utils; | |
use Web3\Validators\AddressValidator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-console */ | |
const crypto = require('crypto'); | |
/** | |
* Modulus operation with a twist. It takes two parameters, a and b, and returns the remainder | |
* of the division of a by b. However, there's a condition to handle the case when a is negative. | |
*/ | |
function mod(a, b) { | |
return ((a % b) + b) % b; | |
} |