All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Error: Struct containing a (nested) mapping cannot be constructed

I'm developing a Smart contract. In this Smart contract, I have one method called 'put' which creates a new Type when it doesn't exists and then adds it to a mapping (name <-> type). But after ...
0
votes
1answer
8 views

0x - Internal error on order API call

I'm receiving an internal error when attempting to place an order on the Avalanche chain. Url: https://api.0x.org/orderbook/v1/order Error: { "code": 100, "reason": "...
0
votes
0answers
9 views

How to connect to a geth authority in web3py?

Here is some code to connect to a geth authority using web3py: >>> from web3.auto.gethdev import w3 # confirm that the connection succeeded >>> w3.isConnected() True When I run ...
0
votes
1answer
12 views

TypeError: Operator == not compatible with types contract IERC20 and address [duplicate]

My goal is to compare my IERC20 contract with my address repaymentCurrency in a require statement: require(currency == listing.loanDetails.repaymentCurrency, "Error"); However, I keep ...
0
votes
0answers
28 views

Ethereum and Bitcoin

The fundamental reason that Ethereum and Bitcoin use different metrics to maintain the size of their blocks. Any help will be appreciated!
1
vote
0answers
14 views

How To Specify ChainID

I am interacting with the Harmony testnet using web3j, but since Harmony has 4 shards i also have to specify the chainID, otherwise it throw an error. When writing to the blockchain i was able of ...
0
votes
1answer
17 views

I can't set the limit that the contract accumulates tokens to exchange for BNB

My contract is a safemoon fork. He must tax transactions, accumulate some tokens and sell these tokens by BNB to send to the 4 wallets in the code. Turns out he must sell the tokens when he hits a ...
0
votes
0answers
10 views

Settig up a node on Devnet (eth2)

Please can anyone explain to me how to set up a node so I can connect to Devnet2 ? I'm following the instructions here. I've also tried running Geth in the terminal and get stuck on IPC location path. ...
0
votes
1answer
33 views

How to add Polygon (Matic) to MetaMask?

Metamask has mainnet installed, while testnets are hidden by default. But what details are required when adding a custom network to connect to the Polygon (Matic) network via Metamask? Are there any ...
0
votes
0answers
6 views

"false Transaction mined but the execution failed" error [closed]

constructor () Auth(msg.sender) { router = IDEXRouter(0x10ED43C718714eb63d5aA57B78B54704E256024E); pair = IDEXFactory(router.factory()).createPair(WBNB, address(this)); _allowances[address(this)][...
0
votes
1answer
28 views

Deploying ganache-local w/brownie: VM Exception while processing transaction: invalid opcode

I am going through brownie_fund_me part of this course: https://github.com/PatrickAlphaC/brownie_fund_me The initial deploy,.py works properly, but I keep getting some variation of invalid opcode and ...
0
votes
1answer
29 views

can anyone explain how 0x protocol swap tokens on contract level?

I am building a middleware contract to interact with 0x. but I can't find which function to use in the 0x contract. could anyone help me? can anyone explain how 0x swap tokens on contract level?
1
vote
0answers
15 views

Did I use the wrong wallet address?

I recently started mining with some left-over GPU time. My server is running Ubuntu. nvidia-docker run --memory="7g" -d kriation/ethminer -P stratum1+ssl://...
0
votes
0answers
19 views

How to call internal function on deployed smart contract

I'm deliving into NFTs and smart contracts I've deployed a simple NFT contract as a test usiing OpenZeppelin and Remix and the token Burn function is internal - if I, as the owner and creator of the ...
0
votes
1answer
22 views

How to run hardhat tests on a testnet?

I want to run my tests on testnet, mainly because I need to test chainlink VRF. How can I do that? this is my hardhat.config.js: require("@nomiclabs/hardhat-ethers"); require("@...
0
votes
1answer
20 views

How to identify a smart contract transaction

Apologies if this is a bit of a noob question. But I have a bit of trouble understanding a concept. I am designing a Smart Contract where I need to send data for the same transaction from multiple ...
1
vote
1answer
12 views

Transaction never gets minned on Polygon Testnet

I have been trying to send a tx using nodejs for some time now, however the tx only output’s the transaction hash but it is never confirmed or mined, I am using the following params for the same { ...
1
vote
1answer
22 views

Is it possible for the Solidity compiler to remove an external call?

I am experiencing a weird situation where it seems that the Solidity compiler (or optimizer) is removing an external call. I am performing an ERC20 token transfer on forked mainnet using Hardhat. From ...
0
votes
0answers
11 views

Monitoring uniswap pair buy and sell transactions via the logs filtering

Can anybody suggests the way to retrieve an Uniswap pair sell or buy transactions, filtering the events logs. I know, it's possible to monitor an token transfers continuously scanning token Transfer ...
0
votes
0answers
18 views

How to distinguish btw NFT and FT under the ERC1155

Let's say Bob has 1 token minted based on ERC1155. How can Bob or others distinguish Bob's token btw NFT and FT? Or is his token can be both NFT or FT? Please correct me.
0
votes
0answers
24 views

How to get all NFTs from an Enumerable ERC721 Smart Contract?

I'm trying to add a function to the ERC721 Smart Contract to return all the NFTs (items identified by tokenID) from a user address. At first, I was thinking on something like the following: ...
0
votes
0answers
28 views

How to use ERC1155 with files hosted on IPFS, when files are added regularly?

I'm looking to build an ERC1155 smart contract (I'm using OpenZeppelin) that will contain NFTs whose metadata will be hosted on IPFS. About 4,000 images for now, all unique (all amount of 1). An ...
1
vote
2answers
58 views

How can I split a transaction to two addresses using metamask?

My idea is to ask users what amount they want to tip another user. However I want to take 5% of that amount and send it to another address (as comission for site operator) I know the user would have ...
0
votes
0answers
15 views

web3 change account metamask not works

I'm trying to check when a metamask account changes within my application. However the features I found are not working, for example I am using the 2 new methods as an example below: // not works ...
0
votes
0answers
20 views

What is the token id?

Total crypto newb here, I would appreciate some clarifications about the tokenid on both the ethereum and polygon blockchains. I keep seeing this definition of tokenid, is the tokenid made up of the ...
0
votes
0answers
8 views

How do I send money in my app using metamask?

I am looking for a basic javascript example on how to send money using metamask from within my app
0
votes
0answers
10 views

Truffle has vulnerabilities when installed locally but not globally

I've installed truffle globally with 0 vulnerabilities (after npm audit fix). I'm going through a tutorial where I am using Truffle as a dependency — and when running npm install, it installs it ...
1
vote
1answer
14 views

Polygon NFT Contract Read Ethereum Mainnet State

Is it possible for my NFT contract deployed on Polygon to see if a user (msg.sender) has an NFT on the Ethereum mainnet. For example, if I wanted my NFT contract to give some sort of 'bonus' to all ...
0
votes
1answer
32 views

Smart Contract Testing - ethereum-waffle expect function

Can someone please explain the significance of the location of the "await" keyword in the "expect" function from the waffle testing framework? for example: this passes (assume its ...
0
votes
0answers
10 views

How to decode encoded transaction value

(web3js) Let's say I have the below data (specifications here). { ... hash: '0x86bc6fef9a3009f377a3a66b7fa654b3e498f4af46c297eab86346b3e5eabd7c', nonce: '0x2ed', value: '0x0', ...
1
vote
2answers
17 views

Is the Solidity contract class name of any relevance?

Let us consider a following contract generated by the wizard // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract ...
0
votes
1answer
13 views

Can I list my own smart contract NFT items on other platforms?

I am a bit confused cause I see everyone having tutorials on creating their own marketplace AND in OpenSea I don't see a list button only a create button. I want to create my own smart contract to ...
0
votes
1answer
20 views

I am trying to swap Eth to Dai using 0x-Api on on ropsten but my transaction reverted by EVM

Transaction hash: 0x9e4cd796a7f3a299ef412f8268e839e8a1600e01140bd2258d8a9d12ee5bf642 Transaction request we are sending to swap: { allowanceTarget: "0xdef1c0ded9bec7f1a1670819833240f027b25eff&...
0
votes
1answer
6 views

How to resolve Runlog error on Chainlink node

I keep getting the below error when I request data from my node. error": "rejecting job bd25ae01d8604b268abfbfa764399511 with payment 100000000000000000 below minimum threshold (...
0
votes
0answers
12 views

How to check and Increase API rate limit on 0x?

I am using 0x API for my dex and I am expecting at least 4k users on my app. But I don't see any subscription plan or anything on 0x documentation to increase or at least know my API rate limits. Is ...
0
votes
1answer
8 views

How to prove execution of contract method to a third party?

Let us consider the following setup. Alice executes a method doStuff(...) of a particular smart contract deployed to an EVM blockchain under address 0x0123456789. Execution of that method resulted ...
0
votes
0answers
18 views

Ethereum Virtual Machine

Hi I have a question for with respect to Ethereum Virtual Machine . I understand every full node in ethereum network will have its own "Ethereum Virtual Machine" embedded in it .(One Full ...
0
votes
1answer
15 views

Failed brownie import when running scripts

I am trying to setup eth-brownie to get a feel of the framework but face a couple of import-related problems. Im working from a MBP running macOS with Catalina v10.15.7 $ python --version Python 3.9.9 ...
0
votes
0answers
14 views

Infura vs Alchemy vs Cloudflare-ETH? [closed]

Infura - free/paid Alchemy - free/paid Cloudflare-ETH - full free Can someone explain to me why all video tutorials dApp on youtube use Infura instead of completely free CloudFlare?
0
votes
0answers
22 views

How can i use .send function properly?

i am trying to do a call of a method to smart contract this is my attempt: response = contract.methods.updateState(address).send({ from: accounts[0] }) but i am getting this error: Gas limit must be ...
0
votes
1answer
18 views

How to fix Note: The called function should be payable if you send value and the value you send should be less than your current balance

I want to transfer per second of given time but I got Error: Note: The called function should be payable if you send value and the value you send should be less than your current balance. pragma ...
1
vote
2answers
23 views

Read all historical price data of a Chainlink price feed in Javascript

I want to read all (!) historical price feed prices of a specific Chainlink price feed proxyContract off-chain via Javascript. Based on the docs article I iterate my query, each time reducing my ...
0
votes
1answer
13 views

Exact behavior of state revert in `try/catch`

I'm trying to make sure I fully understand the behavior of try/catch, specifically what state gets reverted when we catch an error. I could not be sure of certain behavior from the v0.8.10 docs. If I ...
0
votes
1answer
13 views

How is a direct swap transaction fullfilled by 0x

Looking at the direct swap example https://github.com/0xProject/0x-api-starter-guide-code/blob/master/src/direct-swap.js#L105-L113 Seems like the transaction is send to the chain's RPC URL which is ...
0
votes
1answer
6 views

call to FundMe.getVersion errored: VM execution error. Reverted 0x

I'm trying to get the version to show up when I test it but keep receiving this message. call to FundMe.getVersion errored: VM execution error. Reverted 0x // SPDX-License-Identifier: MIT pragma ...
0
votes
0answers
6 views

How to catch the revert error in javascript mocha for testing solidity contracts [duplicate]

I struggled to find a nice solution to my question and thought of sharing it here so that others could benefit and others may have better suggestions. I have a solidity code where I have a function ...
0
votes
0answers
5 views

DeclarationError about event emit solidity 0.7

In solidity 0.7 contract, an event tradeCompleted is defined as: event tradeCompleted(address _poster, string _posterItemName, uint256 _posterItemID, address _bidder, string _bidderItemName, ...
0
votes
0answers
17 views

Is it possible to "script" transactions

I would like to write a dapp that allows users to script transactions i.e. swap X for Y every 12 hours withdraw 5% from pool every day I thought about the following steps: The user defines the ...
0
votes
0answers
16 views

How can I make my contract reusable?

I want to create a Coin Flip game on Ethereum blockchain. I have one contract called CoinFlip. It has functions that enables one player to make a bet, second player can accept the bet, then the flip ...
1
vote
1answer
7 views

What is the default query limit on The Graph?

Say I have a GraphQL query like this, which I execute against a subgraph powered by The Graph: { foo { id bar } } What is the default number of instances of foo that a subgraph returns?

15 30 50 per page