New answers tagged

0 votes

How to calculate fee when dealing with different decimals token?

usethis insteadof staticgas const gasfee = web3.eth.getGasPrice()
Surya Vino's user avatar
0 votes

How to calculate fee when dealing with different decimals token?

If I understand the math problem correctly, the code should look something like that: uint decimalFactor = IERC20(token).decimals(); //should return 18 or 6 in your case. uint256 feeToCollect = (...
CryptoDude's user avatar
0 votes
Accepted

Where does Metamask store the private key (when the account is only locked with a machine-specific password)?

OK, I figured it out. Thanks @rdymak for (https://ethereum.stackexchange.com/a/64038/120999) Physically the encrypted secret passphrase is stored at this location in a .log file: "C:\Users\...
Mila A's user avatar
  • 738
0 votes

Is it possible to encode a struct to calldata when calling another function?

No, it is not possible to modify calldata. It is read only from within the same transaction. To create calldata you could make an external call. function isPriceOkay(Price calldata price) external ...
Ismael's user avatar
  • 30.5k
1 vote

What is the metamask algorithm for creating accounts based on one seed phrase?

It's done like this: import hdkey from 'ethereumjs-wallet/src/hdkey'; import * as bip39 from 'bip39' const seedPhrase = process.env.SEED_PHRASE; const walletsCount = 4; const masterKey = hdkey....
Илья Зеленько's user avatar
0 votes

Did anyone succeed to implement EdDSA verification using solidity?

I recently have open-sourced the library for message verification on Farcaster, you can use Ed25519.sol from there. https://github.com/pavlovdog/farcaster-solidity/blob/main/contracts/Test.sol#L58 ...
Sergey Potekhin's user avatar
1 vote

Did anyone succeed to implement EdDSA verification using solidity?

This is an implementation of EDDSA signature verification with sha512 digest (based on this RFC). https://github.com/rdubois-crypto/FreshCryptoLib/blob/master/solidity/src/FCL_eddsa.sol
Nikolay Zakirov's user avatar
1 vote
Accepted

Getting pancake swap's v3 price via eth_call

The https://nodes.pancakeswap.info/ URL is a node endpoint. If you make a simple eth_chainid curl call to it, it'll return 0x38, which is the chain id of the BNB smart chain mainnet. Although, when ...
Ake's user avatar
  • 1,099
1 vote
Accepted

Find out revert/error reason

The Tenderly debugger for the transaction shows that it's because the incorrect amount was sent with the call. For accessibility, here is the code from the screenshot (a redundant comment is left out ...
Arran Schlosberg's user avatar

Top 50 recent answers are included