Hot answers tagged

5 votes

How to get Token balances

To get all the ERC20 Tokens Balance, you can use Moralis API const Moralis = require("moralis").default; const { EvmChain } = require("@moralisweb3/common-evm-utils"); const ...
Iulian Novenschi's user avatar
4 votes
Accepted

Uniswap v3 LP Token Data

Yes, from the linked contract in your question, the contract has a view function called positions() where you supply a token ID and it returns the relevant information about that position. This will ...
Sam Calamos's user avatar
3 votes

How do I make a contract mint NFTs randomly with a metadata that's already on IPFS?

Yes, you are correct that Chainlink VRF is a good solution to generate a random number at mint time for your NFT, and it can help to prevent any potential exploitation of the contract. Here's example ...
Talha Sajid Chaudhary's user avatar
3 votes

How to find total value in ETH of all NFTs owned by a user

If you like to get the user's NFT portfolio value, then you can use Moralis to provide you with such data. Simply sign up to Moralis to get the API key and install the SDK: npm install moralis Then, ...
Yoseph Kurnia Soenggoro's user avatar
3 votes
Accepted

Does casting a Keccak256 hash to a uint256 increase likelihood of a collision?

A keccak256 string has a length of 256 bits. Obviously, uin256 also has 256 bits. Since they both have the same length, there shouldn't be any problems when converting them even back and forth. I ...
Lauri Peltonen's user avatar
2 votes

what this error and how to solve it with metamask wallet?

There seems to be an error with the smart contract. Please post your code so that we can have a closer look, the error is not very explicit.
0xheartcode's user avatar
2 votes
Accepted

When someone sends me a erc721, does my wallet actually receiving it?

Yes, the same happens with the ERC721, you simply become the owner of that NFT in the contract. As you can see in the contract below from OpenZeppelin, the transferFrom() function calls _transfer(). ...
0xheartcode's user avatar
2 votes

Type error : Expression has to be an lvalue

constructor (string memory name_, string memory symbol_) { name = name; symbol = symbol; } You're assigning name and symbol to themselves. Here is your error: name = name; symbol = symbol; As ...
Adam Boudj's user avatar
  • 2,351
2 votes
Accepted

Is it possible to track marketplace sales for an ERC721?

Here is an example code on how you can track NFT transfer events on a smart contract using Moralis streams API. import Moralis from "moralis"; const addStream = async () => { if (!...
JohnVersus's user avatar
2 votes

How to approve my own token in a nft contract

You are correct, when you call other smart contract from a contract, caller in other contract will be the contract from which the request is being initiated. While for the approval of tokens its best ...
Naveed Ali's user avatar
2 votes
Accepted

How is this solidity function calling another solidity function without referencing it?

mintSurfaceReacher function is called when you invoke requestRandomSurfaceReachT1 function is because the way API3 Airnode is configured to handle the requests. When request is made to API3 endpoint ...
Naveed Ali's user avatar
2 votes
Accepted

How to identify baseURI?

The baseUri would be the CID of the metadata folder. Your metadata folder contains the metadata of each image or NFT. And every metadata further contains the CID of the image. Thus, use the metadata ...
Shubham Sharma's user avatar
2 votes
Accepted

Does creating a new NFT collection require a contract for it?

Yes, in order to create an NFT collection you have to create a smart contract that inherits the ERC721 standard and deploy it. If your NFT contract is meant to be fairly standard I suggest that you ...
Rodrigo Fernandes's user avatar
2 votes
Accepted

How to find all the NFTs, ERC721 and ERC1155, owned by address of *a certain collection*?

This requires indexing the blockchain. This is fairly simple using Moralis APIs. https://docs.moralis.io/web3-data-api/evm/how-to-get-nft-owners-by-an-address Alternative, you can do this using ethers....
lordarora's user avatar
  • 296
2 votes

No field for creator in ERC721?

There is no notion of original creator in the ERC721 spec. The creator could be considered the first person to mint a particular NFT, which you can get by looking for the Transfer event that had the ...
Travis Jacobs's user avatar
2 votes
Accepted

Does an NFT with a certain id exists? ERC1155

You can make use or uri() function, which will fail it a token has not been minted yet. Otherwise you can utilize the ERC1155Supply extention, which gives you the exists(id) function.
Nal Luksic's user avatar
  • 1,087
2 votes

How to get ERC 721/1155 and ERC-20 data?

You can get all the information you are looking for using Moralis API. Here is an example of getting all the NFTs using moralis. const Moralis = require("moralis").default; const runApp = ...
Iulian Novenschi's user avatar
2 votes
Accepted

Trying to get txn hash

You could use a WebSocket from a node provider to track the transfer event that all ERC-20 and ERC-721/1155 smart contracts emit when there is a token transfer. Check this example in ethers v6: const ...
Sahil - QuickNode's user avatar
2 votes
Accepted

Getting trading data efficiently

This data is not available readily on-chain, so it becomes difficult to get this kind of data. QuickNode has this data available via their Graph API You get historical NFT Trading data, marketplace ...
Sahil - QuickNode's user avatar
2 votes
Accepted

Is there a way/tool to check if an NFT or token address is malicious?

One can analyze address risks using two add-ons from QuickNode Marketplace. 1. MistTrack Address Risk Scores Add-on. Enable the MistTrack Address Risk Scores Add-on on your QuickNode Ethereum RPC ...
Sahil - QuickNode's user avatar
2 votes

How to retrieve all ERC721 tokens of a certain collection what a wallet ownes?

In order to do it without using the likes of Moralis. You need: An RPC node The contract address The wallet address The contract ABI Then you can write a function like this: async function ...
Filip's user avatar
  • 931
2 votes

Transfer Ownership of a contract from one adress to another problem

The answer to your question lies in the contract. Which you did not provide. Logically ,according the proper functioning of ERC721 (which i will assume is the standard of your NFT), if he gave you ...
Torof's user avatar
  • 561
2 votes

Transfer Ownership of a contract from one adress to another problem

Based on the Ownership contract made by OpenZeppelin, that you can find just below with the github repo : OpenZeppelin Docs Github repository file If ownership has been transferred to your Matic ...
FrostX.eth's user avatar
2 votes

Deploying a smart contract without private key

Short answer: You can't deploy on their behalf if you don't have their private key or their signed tx. You can achieve similar to what you describe by either one of the two methods: Two ...
minhhn2910's user avatar
  • 1,720
2 votes

Lookin for simplest way to identify any NFT owned by a known, owned, public address

This should be helpful for you: You can get all the NFTs owned by a wallet and the metadata with the image link using Moralis NFT API. Here is an example const Moralis = require("moralis")....
Iulian Novenschi's user avatar
2 votes

Can I have different metadata of the ERC-1155 NFTs with the same token ID?

The simple answer is: no you can't. The uri method used on ERC-1155 contract only take as parameter the tokenId so you cannot specify a "sub-id" under each tokenId. The goal of the ERC-1155 ...
Skychris's user avatar
1 vote

Question on tokenUri

The base token URI would be the same for all ten the only change you will see is a change in the name of the file after the CID. For example, if I have uploaded the photos like 1.json, 2.json, 3.json, ...
Zartaj Afser's user avatar
  • 3,239
1 vote

How is this solidity function calling another solidity function without referencing it?

Simple answer, I didn't notice => this.mintSurfaceReacher.selector, in the airnodeRrp.makeFullRequest() function call. This obviously where mintSurfaceReacher is called.
ChristianOConnor's user avatar
1 vote
Accepted

Please clear this doubt on NFT

When you mint an NFT, you are not changing the name and symbol, you are incrementing the tokenId. It means that you would have the same name and symbol but a different TokenId. The tokenId is a ...
donoso.eth's user avatar
  • 1,423
1 vote

Cant you just see the NFT that would be minted next?

It mainly depends on how the URI is stored within the contract. One option is to have only one link to a folder and token is equal to the metadata names. If this option is used, you could potentially ...
Nal Luksic's user avatar
  • 1,087

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