2022 Developer Survey is open! Take survey.

New answers tagged

0 votes

How to add website link to erc20 token on etherscan.io

You didn't mention which chain your token is on, so I will give an example using the Ethereum mainnet. The process is the same for other chains, just swap out the block explorer. (bscscan.com, ...
user avatar
  • 1
0 votes

Invalid type for argument in function call

don't worry it's just a type error, you need to put >= _value inside require statement. Replace this: require(balanceOf[msg.sender]) >= _value; With: require(balanceOf[msg.sender] >= _value);...
user avatar
3 votes
Accepted

Ethereum stuck in the smart contract

Unfortunately, I don't see any way to get the Eth. The only places where the code sends Eth is in claim when it sends the sent amount (sent inside that transaction) to someone, but it never sends more ...
user avatar
0 votes

What is the difference between NFTs and a smart contract?

So ERC20 and ERC721 are standars for smart contracts, meaning that smart contracts that are ERC20 or ERC721 complient must have a set of functions implemented inside them. So contracts that implement ...
user avatar
0 votes
Accepted

What is the difference between NFTs and a smart contract?

Smart contracts are not owned by anything, unless the contract itself contains code for it to know that some address has ownership permissions over it that it has defined. ERC721 is an implementation ...
user avatar
0 votes

Where can I find info for how to create a Coin/Token?

you can get many tutorials over youtube, google, and even in ethereum official website: https://ethereum.org/en/developers/tutorials/understand-the-erc-20-token-smart-contract/ openzeppeline is also a ...
user avatar
0 votes
Accepted

Transfer function not changing custom token(ERC20) balance after successful transfer from transfer function?

Ok, Whilst in progress with a project I was doing, The transfer function cannot be used for this. So instead use transferFrom function that is provided by ERC20. But to use it, You first need to give ...
user avatar
0 votes

What’s the difference between fallback() and receive() and between payable vs transfer?

Fallback functions can be used instead of receive functions. However, to clearly distinguish between eth transferring and not, receive functions are being used now.
user avatar
0 votes

Where can I find info for how to create a Coin/Token?

I don't know if you have come across Openzeppelin
user avatar
0 votes

Error HH411: The library openzeppelin, imported from contracts/Project.sol, is not installed

I did yarn add @openzeppelin/contracts and it worked for me!
user avatar
  • 1
0 votes

Get Transaction details using Python

Using web3.py you can use the eth.get_transaction method to get transactions details from a tx hash. Connect to a node, I recommend to use chainstack.com, it`s free and works great. from web3 import ...
user avatar
  • 51
0 votes
Accepted

How to show Token Transfer details on mumbai polyscan?

After a lot of research and retries, I have come to know that Mumbai Testnet does not allow ERC-1155 TOKEN transferred details to be shown in transaction details. I deployed the same contract on ...
user avatar
1 vote
Accepted

How large is the key-value dataset of Tether?

As of 2022-05-18 14:35:00 UTC the Tether USDT contract has a total of 4,568,883 holders. It will consume 4,568,883 x 32 bytes = 146,204,256 bytes = 139.43 Mbytes.
user avatar
  • 29.3k
1 vote
Accepted

Can Ethereum prevent secondary market sales?

Yes, since win-token-v1 and win-token-v2 are most probably ERC-721 tokens (NFTs), they manage their own ledger and able to allow transferFrom to be executed from a specific msg.sender, that will be ...
user avatar
  • 1,236
0 votes

Can Ethereum prevent secondary market sales?

Yes, this can easily be done, by making the smart contract store which adresses have which tokens. This is standard for e.g. ERC20 tokens. For example, if you own USDT, you don't actually have this in ...
user avatar
1 vote
Accepted

Initializing IUniswapV2Pair from msg.sender

So IUniswapV2Pair is a cast, that casts an address into an interface, in this case the IUniswapV2Pair interface. Doing this essentially makes all the functions inside of the interface easily callable ...
user avatar
0 votes
Accepted

Multi Contract Interaction / Contract interacting with another contract / Contract using another contract without Inheritance

You cannot access on-chain transaction data and events from inside the EVM. What you can access instead, is any data that your contract has stored for its own use, by its functions, when those ...
user avatar
1 vote

Transaction fail error

Your smart contract code works. Possibly your problem when adding this condition: require(msg.value > 0.1 ether); is that you don't set the value inside msg.value textbox present in DEPLOY & ...
user avatar
  • 1,195
0 votes

How to show Token Transfer details on mumbai polyscan?

Mumbai explorer does not recognize this ERC721 token. Displaying tokens is a special feature added to better display NFT transfers, but the explorer needs to index that token appropriately. The token ...
user avatar
  • 1,236
0 votes

View all NFTs owned by specific Ethereum wallet

Lazy way 1 : go to a large NFT market place (eg the not so great opensea) and lookup the address or use this link: https://opensea.io/{{wallet address here}} Lazy way 2: same as 1 but etherscan (or ...
user avatar
  • 161
0 votes

Do Solidity smart contract symbols support unicode?

Nope, write (unicode"✕ray Ýour ℤen",unicode"✕Ýℤ"). e.g. ERC721(unicode"✕ray Ýour ℤen", unicode"✕Ýℤ"){ _setBaseURI("https://foo.foo"); } actully ...
user avatar
0 votes

View all NFTs owned by specific Ethereum wallet

This is not possible and in my opinion a fundamental design flaw. Given an ETH address, the only way to enumerate all NFTs it owns is to crawl the ETH blockchain like opensea.io does
user avatar
  • 101
0 votes

ERC20 -> ERC20 Swapping liquidity pool

For create a new pair, you need to add liquidity to this specific pool. In your case, you have two options: Manually: Go to Uniswap dapp, click on Pool -> More -> Create a new pool -> Insert ...
user avatar
  • 1,195
0 votes

Why command `npm hardhat` doesn't create a new sample project?

its not npm hardhat, its npx hardhat. ref: https://hardhat.org/getting-started/
user avatar
3 votes

How to Burn Tokens from someone wallet

You can't burn tokens from other addresses/contracts unless that address/wallet approves you to do it. See the ERC20 approve method.
user avatar
  • 141
0 votes
Accepted

Is there a list of all Ethereum unit converters?

This is not an exhaustive list but these are the tools that I know about: Name Description ABDK Toolkit Multiple number format conversion (including ETH) dEth tools ETH and tokens conversion ...
user avatar
0 votes

Pool.borrow ValueError: Gas estimation failed: 'execution reverted'

I reply to myself in case somebody else encounters the same issue. Since I'm quite new interacting with blockchains, I discovered there are many DAI contracts, and NOT all of them are supported or ...
user avatar
  • 11
0 votes

Send erc20 token with pay another address

As you know all coin transfer functions regard as transaction and all transactions need gas fee
user avatar
0 votes

UniswapV2Router02 addLiquidityETH transaction reverted impossible to read

I think you miss from in transaction call options: {value: '100000000000000000000', from: '0x0000000000000000000000000000000000000000'}
user avatar
0 votes
Accepted

How do I get addresses of tokens held by a smart contract?

The way the EVM is designed doesn't permit you to query all tokens held by a contract. Technically, it is the token contract that stores users' balances. The only way to keep track of all assets ...
user avatar
0 votes

Why command `npm hardhat` doesn't create a new sample project?

You must to run $ npx hardhat --verbose you will get the location of a hardhat config file like this: $ hardhat:core:config Loading Hardhat config from /home/lyon/hardhat.config.js +0ms delete it ...
user avatar
  • 1

Top 50 recent answers are included