CRYPTO NEWS

How to return a constant variable in huff

Let’s say I have a constant variable in huff:

#define constant myAddress = 0x0000000000000000000000000000000000000000 

How would I make a macro to read it? Since it doesn’t have a storage slot, I wouldn’t use sload…

#define macro GET_ADDRESS() = takes (0) returns (0) {     // No storage slot     [VALUE_LOCATION]        sload                      0x00 mstore     0x20 0x00 return } 

overflow error in ethersJS

Im building a simple whale tracker that prints out transactions larger than x amount. My code works really good for tokencontracts with 6 decimals(USDC) but when I try to use token with 18 decimals Im getting an overflow error. Error: overflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-overflow ] Here is my code: const decimals = await contract.decimals() const::Listen

Im building a simple whale tracker that prints out transactions larger than x amount.

My code works really good for tokencontracts with 6 decimals(USDC) but when I try to use token with 18 decimals Im getting an overflow error.

Error: overflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-overflow ] 

Here is my code:

 const decimals = await contract.decimals()     const DECIMAL = 10 ** decimals     console.log(DECIMAL)      const transferAmount = 100000 * DECIMAL     console.log(transferAmount)       console.log(`Whale tracker started!nListening for large transfer on ${name}`)      contract.on('Transfer',(from, to, value,  data)=>{         if(value.toNumber() >= transferAmount){             console.log(`Trasnaction ${from} to ${to} was sent with a value of ${value / DECIMAL} of ${symbol}n TransactionHash ${data.transactionHash}`) 

I hae checked the link in the error message but for some reason I cant figure out why this is happening. Does anyone have a fix for this problem?

How to return a constant variable in huff

Shopping cart
There are no products in the cart!
Continue shopping
0