Hot answers tagged

2

Just use cast to integer arithmetic: MINTING_VELOCITY = 2 ACCURACY_RATIO = 1000000 And the formula converts to: A x t x MINTING_VELOCITY / ACCURACY_RATIO


2

fixed Same kind of error for me today ! Wed Feb 10 2021 20:21:10 GMT+0100 (heure normale d’Europe centrale) Remixd is listening on 127.0.0.1:65520 setup notifications for C:\Users\XXXX\Documents\dev\remix_shared_folder Error: Error: EPERM: operation not permitted, lstat 'C:\Config.Msi' at RemixdClient.resolveDirectory (C:\Users\XXXX\AppData\Roaming\npm\...


1

If the MAIN contract inherits from RandomNumberConsumer making editDna internal should be enough. // Declare contract as abstract abstract contract RandomNumberConsumer is VRFConsumerBase { // Forward declaration function editDna(uint randomN, uint carId, bytes32 requestId) internal virtual; constructor() VRFConsumerBase(..) public { .. ...


1

It looks like your contract doesn't have LINK funds to perform the random number generation. Note this require in function getRandomNumber(): require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK - fill contract with faucet"); In the same documentation from this example, there is an explanation on how to fund this contract with LINKs ...


1

This line of code ensures that the passed tokens are sorted deterministically (e.g. token with lower address first), so that the pair address can be retrieved in a single lookup: (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2: ZERO_ADDRESS'); require(getPair[token0]...


1

You can get ABI json from etherscan API like below. var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider()); var version = web3.version.api; $.getJSON('https://api.etherscan.io/api?module=contract&action=getabi&address=0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359', function (data) { var contractABI = "";...


Only top voted, non community-wiki answers of a minimum length are eligible