Hot answers tagged

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.


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.


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 ...


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 ...


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.


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.


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.


1

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


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 ...


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 ...


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


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 ...


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