New answers tagged

2

The method above does nothing. If I execute the following... When you execute a task without passing any --network, that task is run in the in-process Hardhat network. This is an ephemeral network that is created and destroyed with the process. So when you run your task and then do npx hardhat console, the second command is using a new, fresh instance of ...


0

I found a solution to my problem! With ipfs-http-client, you need to use ipfs.add as part of an async/await function in order for ipfs.add to actually execute, it seems. Without it being in an async/await function, it didn't do anything at all when getHash() ran. This is how I changed getHash(): async function getHash() { try { const ...


0

According to the issue you linked, it looks like the core module does not handle reading files from your system. Instead, you must pass in a stream of files that IPFS can consume from. Since you are doing this in the browser, it is a little more complicated to achieve. Perhaps you might want to look into the FileSystem Access API, which offers the ...


0

I found this Metamask git for create deep links: https://metamask.github.io/metamask-deeplinks/ https://github.com/MetaMask/metamask-deeplinks


0

I figured it out. I was trying to have const maxInt = new BN(2^256 - 1); You need to make each number a new BN and perform the arithemetic to make it work. Also the numbers have to be in quotations I think. const maxInt= new BN("2").pow(new BN("256").sub(new BN("1"))); // Will pass into solidity as uint 2**256 - 1


1

JavaScript can't handle big numbers natively. That's where various BigNumber libraries come to play. To be consistent, it's best to always use BigNumber when dealing with integers in web3 projects. There are tons of different libraries out there, but I recommend using the one which your web3 library uses under the hood - you'll probably get utils for it ...


0

I believe it is because you need to add .send() to the end of any call to the blockchain that changes state (and .call() when reading state) for example: tx = await uniswap.swapExactTokensForTokens( amountIn, amountOutMin, path, to, deadline ); should be: tx = await uniswap.swapExactTokensForTokens( amountIn, ...


0

you can use Infura services. infura provide the web3. first you have to create acc in infura after that you should make project. and at least you can use your own Id in this code : web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/3c68ea1...your ID...f301753")); also you can use main net or ropsten network. please check ...


0

Here you can check out Opensea's metadata standards which has some info on SVG standards for their site: https://docs.opensea.io/docs/metadata-standards This is what they say about the image properties of your nft metadata image: This is the URL to the image of the item. Can be just about any type of image (including SVGs, which will be cached into PNGs ...


1

The problem is with the following lines: require('chai') use(require('chai-as-promised')) should() These should be chained calls, and so should re-written as: require('chai') .use(require('chai-as-promised')) .should()


Top 50 recent answers are included