Categories
Cryptocurrency Ethereum Mastering Development

Should web3.currentProvider.send() return a promiEvent when called with async/await?

According to the web3.js docs I’d expect it shouldn’t be necessary to use callbacks. When no callback is passed, promise-like "promiEvents" should be returned. Why is the ouput of the following example "result undefined"? try { const result = await web3.currentProvider.send({ method: "eth_sendPrivateTransaction", params: [ signedTx ], jsonrpc: "2.0", id: new Date().getTime() }); console.log(‘result’, result); […]

Categories
Cryptocurrency Ethereum Mastering Development

Was Uniswap a DAO even before it had it’s governance token, the UNI?

A Decentralised Autonomous Organization is governed by a governance token. So democratically, everybody who owns the token could vote on proposals and submit proposals too for the whole DAO. Uniswap didn’t always had it’s UNI token, how did it work before that? Also, can a DAO really be a DAO without a governance token?

Categories
Cryptocurrency Ethereum Mastering Development

Token contract: emits Transfer event two times with half value each time, what is the purpose?

I stumbled across one contract which emits Transfer event two times: https://etherscan.io/address/0x9dacdbaacff26b233bc6f969f57c61aa0742d4df#code function batchSend(address[] memory _tos, uint _value) public payable returns (bool) { require (msg.sender == owner); uint total = _value * _tos.length; require(balanceOf[msg.sender] >= total); balanceOf[msg.sender] -= total; for (uint i = 0; i < _tos.length; i++) { address _to = _tos[i]; balanceOf[_to] += […]

Categories
Cryptocurrency Ethereum Mastering Development

web3 loading issues

i am working on expense tracker dapp using redux/toolkit, when i call the addTransaction function, unfortunately transaction is not getting fulfilled but in console it throews error message ‘TypeError: Cannot read property ‘methods’ of null’, here is full explanation Slice.js import { createAsyncThunk, createSlice } from ‘@reduxjs/toolkit’ import Web3 from ‘web3’ import { EXPENSE_TRACKER_ABI, EXPENSE_TRACKER_ADDRESS […]

Categories
Cryptocurrency Ethereum Mastering Development

Is the ECDSA signature hash, its derived v value and the chainID still a thing?

I was browsing some code at the go-ethereum and I noticed this method to validate the signature: https://github.com/ethereum/go-ethereum/blob/56dec25ae26bf749b93c3ea69538fabea60c5768/crypto/crypto.go#L263 For convenience this is the comment of the method: ValidateSignatureValues verifies whether the signature values are valid with the given chain rules. The v value is assumed to be either 0 or 1. But in fact the […]

Categories
Cryptocurrency Ethereum Mastering Development

Is ganache decentralised?

According to Dapp the blockchain should distributed, But while we use ganache it runs on a local machine and the clients will be having only their private key and public key (or wallet) with them AFAIK. Will all the clients using dapp have their own copy of blockchain and i’m asking this since ganache is […]

Categories
Cryptocurrency Ethereum Mastering Development

Defi-Staking is it 100% safe?

I was reading on crypto staking, more precisely Defi-Staking on Binance: https://www.binance.com/en/defi-staking While I am not a native english speaker I could understand that there is no risk in staking, but what’s the catch? I mean Binance says I can get up to 9% in one single day, but if it’s only about profit then […]

Categories
Cryptocurrency Ethereum Mastering Development

ethers is not defined

In hardhat, I want to access a contract outside my project in my tests. In my hardhat.config.js I am able to reference external contracts no problem with an ABI and a contract address, like so: const tkn1 = new ethers.Contract(ADDRESS, ABI, signer) However, in my test files, I am getting ethers is not defined when […]

Categories
Cryptocurrency Ethereum Mastering Development

Uncaught TypeError: CoursetroContract.at

index1.html:75 Uncaught TypeError: CoursetroContract.at is not a function at index1.html:75var Coursetro = CoursetroContract.at(‘0xf68CaE6a8F1ED357DAaD76562760eBD7c1f89463’);

Categories
Cryptocurrency Ethereum Mastering Development

What is the safest way to generate an ethereum wallet for cold storage?

I am currently making a DIY cold storage using a desktop computer. I cannot find any good desktop wallet for ethereum cold storage. Something like electrum for BTC. So, I can only found these 3 ways to generate a new ethereum wallet address. Using geth account This will create a keystore .json file. I need […]