New answers tagged

0

Or in Python (with Web3py) from web3 import Web3 print(Web3.isAddress("0xBB9923E927F0bC33C901396F4C589B43DB991705"))


0

Here, Etherscan is used as the default RPC provider. They are just like Infura/Alchemy - provide access to Ethrereum nodes. Each provider has their own terms of usage and pricing.


0

Answering your second question to calculate maxFeePerGas programmatically you could call this function in ethers.js provider.getFeeData() which will return maxFeePerGas maxPriorityFeePerGas gasPrice, however currently it seems maxPriorityFeePerGas is hardcoded to a value of 2.5 gwei as per their code. Alchemy has the function eth_maxpriorityfeepergas to ...


0

I got it to work by overriding TASK_TEST_GET_TEST_FILES hardhat subtask which actually returns the files found for testing, task(TASK_TEST_GET_TEST_FILES, async ({ testFiles }) => { const overriddenTestFiles = glob.sync("tests/**/*.test.ts"); console.log(testFiles, overriddenTestFiles); return overriddenTestFiles; }); Here I used glob to ...


0

If you are seeing the success status for your transaction on etherscan, the transfer is being done and is ok. Exchange applications won't declare a successful transaction as long as they become sure (get confirmation) about the transaction being mined by miners. See this to know what confirmation means. So, it might take some time until they deposit the ...


1

There are two broad standards of tokens trading on OpenSea - ERC721s and ERC1155s ERC721 implements the ownerOf method – function ownerOf(uint256 _tokenId) external view returns (address); This suggests that an NFT can only be owned by one address. A nuance is that if this address points to a contract/multi-sig, one could argue that this NFT is owned by a ...


0

The method is paypable. This is a Solidity identifier that indicates that you can send the native coin (e.g. ETH or BNB or FMT) along with the contract call. Therefore the blockexplorer shows an extra field to specify the amount. Line 66 in your referenced contract checks if the correct value was sent along. More info: https://docs.soliditylang.org/en/latest/...


2

The receive function is triggered by a transfer of the native token only, such as ETH on Ethereum or BNB on Binance Smart Chain. Therefore, msg.value is always an amount of the native token and never an amount of any ERC-20 token.


1

It's the same thing, except that the casting part is done implicitly in the second example you provided.


0

Actually, it is possible to access the ethereum object from the window object from inside a useEffect hook, but your conditional statement is validating as true before ethereum has been injected since there is no web3 property for window which would evaluate to true when ! compared to undefined. Also, you aren't setting ethereum to a component level scoped ...


0

When you call the second function with this it will trigger an internal transaction, therefore msg.sender is the contract itself, which is different from the owner. You can call the function without this. which will not trigger an internal transaction and just "jump" to the function.


1

Building on what Civilian, SC Buergel and Rob Hitchens have said, the recommended way to do this is to use a pull payment strategy. First, you use Open Zeppelin's PaymentSplitter contract to send the payment to the contract with your desired recipients each receiving a certain number of shares. In a separate transaction, the money is then pulled to the ...


1

I agree with the above answer. Also, there are events that you can emit in your functions. Those events are saved on the blockchain and then you can use those events to check the transactions in your dapp, if you are creating a dapp.


3

First, EVM/Solidity doesn’t have the concept of a transaction hash. That’s the blockchain/record part. In your case, there’s no need for you to check if the transfer went through. The transfer REVERTS if failed. And any revert bubbles up so the function itself reverts and the user can then see this in their transaction hash.


0

The transfer tag means that this transaction was made by triggering the receiver contract's transfer function which is the same as web3's sendTransaction. It executes transfers of a specified number of tokens to a specified address (see this). Status declares the transaction's success status: 1 for successful, 0 for failed transactions. Status of a ...


0

Let me know if this faucet helps you. p.s. sent you 01 ETH (txn hash)


1

The problem went away by switching to use a different private key. I still don't understand why it happened. May be it is due to a bad nonce? One interesting observation is that tons of stuck tx suddenly went through on EtherScan.


0

you will need to go behind enemy lines and befriend the thief. Lure him with a honey pot of sorts and try to flush out his ID. Likely they could be on a different continent . . .


2

Before doing anything, I suggest first take a look at this to get familiar with contract deployment's gas calculation. After reading the aforementioned link, I suggest (if it is possible for you), minimize your solidity code. Removing extra codes, results in less bytecodes, which means you will pay less for the deployment. Be warned that decreasing the ...


3

Sorry, that's the cost of working on L1. Consider how today's average gas for all transactions was ~130 gwei or ~$150 USD: https://ycharts.com/indicators/ethereum_average_gas_price. This includes simple send and cheap calls. I suggest deploying to an L2.


0

I contacted MetaSwap support. They confirmed that ETH exists as wETH on Polygon and MetaMask browser extension does not support bridging currently. Instead I can use a bridge like Polygon or Hop to bridge the tokens across networks. I have not confirmed which form of tokens are required for each bridge. It appears that I can use my wETH to pay for the ...


0

You could try getBlockTransactionCountByNumber RPC method to get the number of transactions in a block. You can query Infura (or any other RPC provider) for each block that's been minted and create an aggregate. Or you can also get other block details too, like timestamp using getBlockByNumber method. It contains the list of all the transactions included in ...


0

yarn test will run the test script in your package.json: https://classic.yarnpkg.com/lang/en/docs/cli/test/ what I think you're actually trying to do is: npx hardhat test https://hardhat.org/guides/waffle-testing.html


0

Token transfers work very differently. To transfer X amount of token Y, you have to call the Y's token contract's transfer functionality. So you issue the transaction to the token contract, not to the receiver of the tokens. The transaction data then dictates who is the receiver of the tokens, and how many. You should research token transfers more, there are ...


0

Will these two gas APIs help you? https://docs.etherscan.io/api-endpoints/gas-tracker https://docs.ethgasstation.info/


0

You need to approve, yes. In solidity, just is this: IERC20(address(token)).approve(address(router), amountToApprove); So, you just need to convert it to the language you are using, if you are not using solidity. In ether.js, what I suppose you are using, check this: Execute transaction Approve directly against contract address (without ABI)


0

It is all about operation cost. All exchanges have to transfer every deposits to cold wallet to secure the funds. Lets use USDT deposit as an example For Externally Owned Accounts (EOA)/new deposit address approach, below steps are needed: Exchange generate addresses for each user (Free) User deposit USDT to their address in step 1 Exchange send ETHER to ...


0

Check the path of the .env file and make sure they are in the same directory.


0

There's a Paradigm sponsored faucet that will give you a proper amount of ETH and some extra ERC20 tokens to play with. For some networks it may say pending refill but Görli seems to be on.


0

If you want to run it locally Otterscan is really nice. If you are thinking about running a block explorer for your own network the ones you listed might be a better choice (especially BlockScout, as it is quite widely used)


0

I use Chailink faucet quite often, and it's working. But it gives you only 0.1 ETH at time, so you may need to farm a bit :)


0

Unfortunately the Goerli testnet faucet goes down with demand and traffic - and it looks like there is a lot of demand for Goerli right now. The MyCrypto Faucet should be still up - and feel free to shoot us an email if you need more than that.


2

First of all, the "eth" asset exists in different forms across Ethereum and Polygon. For each blockchain, we have one utility token and other erc20 compliant tokens (+ other standards). Ethereum eth - the utility token Ethereum weth - the erc20 wrapper for eth Polygon matic - the utility token Polygon wmatic - the erc20 wrapper for matic Polygon ...


0

When you execute IWETH9(WETH).withdraw(balanceWETH), your contract is calling WETH contract. So for WETH contract's context, your contract is the msg.sender. This is why the funds are getting to sent to it.


0

Unless you deployed an upgradable contract, the answer is yes, you will need to deploy a new contract since contracts are inmutable.


0

Try Settings > Advanced > Show test networks


1

This faucet isnt working for like 2 years.Try to find a different faucet or i could send you if you need


0

Transfering ETH (which is done by setting msg.value) is a state change. When your transaction reverts any state change is also reverted. This means the value "stays" in the original wallet. As you mentioned the only change that is done to the blockchain is the fee payment. Note: If an internal transaction reverts, it doesn't mean that the whole ...


0

I have been looking for something like what you are searching for until I found these useful links, I hope I could help you guys! https://adaascapital.com/price-impact-too-high-uniswap-fix/ https://adaascapital.com/price-impact-too-high-pancakeswap-solution/ Regards.


0

I was getting the same error. I had to make sure i had set up the right contract address in job description, and I was sending it to right address: contractAddress = "0x5633061EAFE5C3C2c059F1119bFE206cB8F952AB" submit_tx [type="ethtx" to="0x5633061EAFE5C3C2c059F1119bFE206cB8F952AB" data="$(encode_tx)"]


0

I resolved it by changing my encode_data task to this : encode_data [type="ethabiencode" abi="(bytes32 requestId, bytes value)" data="{\\"requestId\\": $(decode_log.requestId), \\"value\\": $(parse)}"]


1

In your hardhat.config.js you should have accounts instead of account. Due to this typo, ethers cannot invoke 'sendTransaction' once the signer is null


0

Openauction[0].bid({'from':accounts[0], 'amount': 1e18})


0

I deleted the .dapp folder in home directory and ran dapp testnet again and it worked.


1

Testing blockchains were created for testing purposes so the coins are worthless by design. PoA networks like Rinkeby, Goerli, Kovan the funds were allocated to respectable members with the explicit purpose of giving away funds for other projects testing needs. PoW networks like Ropsten anyone can mine, some people will mine for they own projects (software ...


0

In addition to the answer above I will add that you can calculate the fee needed for the transaction to execute by taking the gas which is needed for simple ether transfer 21000 and multiply it by the current gas price await web3.eth.getGasPrice(): const currentGas = await web3.eth.getGasPrice(); const requiredGasPrice = await web3.eth.estimateGas({to: TO}); ...


0

Use the estimateGas method to calculate the gas. web3.eth.estimateGas


Top 50 recent answers are included