All Questions

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

I am trying to addLiquidity on Uniswap v2 but I am getting error Reason provided by the contract: "TransferHelper: TRANSFER_FROM_FAILED"

function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external ...
0
votes
0answers
5 views

How to transfer the Ether sent to a smart contract to the owner of the contract?

lets say i have a donation smart contract that accepts donations, the code should be the following : contract Donation{ address payable owner; construct() { owner = msg.sender; } ...
0
votes
0answers
2 views

How to get liquidity of tokens (example bnb - cake)?

I need to get liquidity of tokens. Example, bnb - cake, new token - bnb, new token - busd. I found 2 options as I can. First option, It use lp address. https://bscscan.com/token/...
0
votes
0answers
3 views

Cannot do cyclic import in Solidity

Cannot import ClassA in ClassB, while ClassB imported in ClassA Interfaces will not help, because they also would import each other. How can I manage this?
1
vote
0answers
5 views

How often are Chainlink price feeds updated?

I browsed through the Chainlink docs but I couldn't find an answer for how often prices are updated. My understanding is that they have a rule that if the markets become super volatile, they ...
0
votes
0answers
3 views

Brownie, Where do I put my Infura API Key... not The ID, The Actual Key?

I am following this tutorial https://www.youtube.com/watch?v=p36tXHX1JD8 and I don't know where to put my infura API Key. I see in the Github repo that the .env file looks like this: export ...
0
votes
0answers
4 views

What is the price of deploying an ERC-721 token contract on the main net?

I have a few questions regarding the deploy to the main net. They are mostly about the cost of it. Im using hardhat and ether.js for deployment. The contract itself is written in Solidity. Could you ...
0
votes
0answers
3 views

How long does it take an experienced developer to deploy a simple auction smart contract with front end?

I'm currently vetting eth devs for a nifty personal platform but I'm not a developerand don't have much of a concept for the complexity for time involved for Solidity development. Ballpark estimates ...
0
votes
0answers
6 views

Solidity array address delete remains Zero address

i have an array address[] allAssets which holds list of addresses and it is populated with [ '0xc778417e063141139fce010982780140aa0cd5ab', '0xaD6D458402F60fD3Bd25163575031ACDce07538D',...
0
votes
1answer
10 views

Does ReentrancyGuard locks every addresses while a `nonReentrant` function is called?

I am looking to secure a function within a contract from reEntrancy attacks, by attaching the nonReentrant modifier to it. function myFunction(...) public nonRentrant { // ... } My question is: a) ...
0
votes
1answer
7 views

Interface Oracle Contract

I am following the CryptoZombies tutorial to create an Oracle Interface. However, I am having an error in Smart Contract which will be my interface, according to the tutorial it is the same, 2 details ...
0
votes
0answers
5 views

Sending transaction from server

I Want to validate the data sent from the users in a server and continue with the transaction from there, is it possible? I couldn't find any relevant information on the web, can anyone direct me on ...
0
votes
0answers
8 views

how to make a useful tool to detect the vulnerbility in a smart contract

it's so hard for me to analyze the source code of each classic SC vulnerbility detection tools, but I need to figure out the skeleton of the dectecion system and upgrade some existing detect ...
0
votes
0answers
10 views

Which contract does Opensea uses for polygon mumbai?

I've been testing buying NFT on Opensea. I've bought nft on rinkeby, which will trigger AtomicMatch of the underlying wyvern exchange contract. However, after I've done the same thing for Opensea ...
0
votes
0answers
8 views

Funding the Polygon Chain Without Gas Fees

From what I hear, the big value point of the Polygon chain is that it has low gas fees. As far as I can tell, the only way to fund a wallet on the Polygon chain is by converting Ether into Polygon ...
0
votes
1answer
18 views

The purpose of launching a token or your own coin (higher level)

sorry in advance if this is the wrong forum for such a question. I just want to understand something at a high level. When projects, for example new video games are launching on a Blockchain (e.g. on ...
0
votes
0answers
10 views

"Cannot read property 'data' of undefined" when place limit order [closed]

we use 0x api to place limit order in the past months without no troubles. But today when we place limit order with invoking the api of .../sra/v4/order, it returns the below error info. ERROR(status ...
1
vote
1answer
9 views

Is it safe to append a variable in array of structure during upgrade the contract?

I'm working on an upgradable contract using Openzeppelin upgrade. I'm aware that upgrading the contract must take the storage layout into consideration. However, I'm still not so confident about the ...
0
votes
0answers
7 views

Querying conditionally with graphQL

I have this query which is working fine: const CHART_DATA = gql` query chart{ ethereum(network: bsc) { dexTrades( options: {limit: 10000, asc: "timeInterval.hour"} date: {since: &...
0
votes
0answers
5 views

type: '0x2' Compatibility on Arbitrum Testnet

On Ropsten and Rinkeby Ethereum Testnets I have to specify "type: '0x2'" with my "send" transactions since the implementation of EIP-1559. However, on Arbitrum Testnet, if I ...
0
votes
0answers
4 views

How to avoid function definition conflict between parent contract and interface

Given an interface interface ICat { function external lives() external view virtual returns (uint256); } And a contract contract CatStorage { uint256 lives; } The following contract, inheriting ...
0
votes
0answers
9 views

Burn function not working

I am trying to create ERC20 token smart contract everything is good except burn function I am getting an errors, Any help please. Below the full contract // SPDX-License-Identifier: MIT pragma ...
0
votes
0answers
6 views

Web3.js-- getBalance to web3.utils.fromWei, store the value in a variable to be used in a table

so the goal here is to get the balance of the connected account and display it in the table. Ive been working on this all day and im feeling stuck. Heres what I have: function App(){ ///.....
0
votes
0answers
5 views

Solidity - How to implement fees ONLY if user selling on Uniswap

I woudlike to implement a mecanisme in my token (5% fees only if user sell in uniswap router) : function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of ...
0
votes
0answers
6 views

How to remove metamask wallet from second computer

I have two computers. On computer 1, I have metamask set up with a couple of accounts (second account created within MM, NOT imported) and I have several networks set up. Yes I have the seed phrase ...
0
votes
0answers
5 views

What is the Chain ID for Metamask associated with truffle develop?

I was following a tutorial but found out that it is outdated. Inputting 'truffle develop' in bash states that it started on "http://127.0.0.1:9545/." However, when I try to connect Truffle ...
0
votes
0answers
5 views

Ganache throws "Invalid JSON RPC response" when trying to fork mainnet from full geth node

I have full Ethereum node running GETH 1.10.10-stable-bb74230f and when I try to fork mainnet from it with Ganache it fails with: Error: The fork provider errored when checking net_version: Invalid ...
0
votes
1answer
12 views

Mint erc20 tokens

I mint 1,000,000 of tokens (MAX SUPPLY). I want that 50% of the tokens can be minting like a reward. I have to send that 500,000 tokens a wallet or i can leave it in the contract?
0
votes
1answer
6 views

Send transaction with smart contract

is it possible to send transactions to an address from the smart contract without having to confirm the transaction on metamask? I mean, I need a certain condition to start a transaction that sends ...
0
votes
1answer
12 views

Why Solidity Inheritance Parent and Child have their respective values?

I need to split my smart contract because of the size limit, so I created Inheritance. Never did it before. But I got into trouble, I tried to go back to basics and try this code : // SPDX-License-...
0
votes
0answers
6 views

Override web3 methods using web3-provider-engine

I have created an open-source key management system, like a digital vault that manages the ETH keyring, which has methods implemented to securely sign transactions and export keys without having the ...
0
votes
1answer
6 views

OneSplit (Web3.py) - How to get the exact price of a pair on 1inch?

the title explain itself, im using the OneSplit contract to get the price of a pair in 1inch. But the whole point is that i used getExpectedReturn correctly but it returns a value with no decimals and ...
0
votes
1answer
8 views

how i redirect the transaction to use my wallet rather than metamask on chrome?

how I redirect the transaction to use my wallet rather than metamask on chrome ? I have created a wallet and I want to use it in my next transactions, but I don't know the process of linking it with ...
0
votes
1answer
11 views

Is there a way to programmatically access OpenSea's assets/orders that are in Matic/Polygon?

I would need to access an asset's orders in OpenSea but their API is not available for Polygon. Their graphql doesn't seem to be open to external calls, and by doing a GET of the asset page itself, I ...
0
votes
1answer
20 views

Error on array .pop()

I have a function to modify an array, if I comment out the .pop() line, it passes, if not, I get this error: VM error.revert Code: function moveShipsToSpace(uint[] memory ships, uint16 fromSpace, ...
0
votes
1answer
21 views

ERC20 Token Transfer Issue

I have a test token (ERC20) deployd on ETH test network (Kovan) The token was deployed using Unicrypt tool So far everything ok, but the issues is how can i transfer tokens from an outside smart ...
0
votes
1answer
10 views

Chainlink: How to get the jobspec for a specific feed?

I am trying to determine the off-chain source of price data for a feed. From reading the docs, this is declared in the job spec. So, given a specific price feed, https://market.link/feeds/9765bb8d-...
0
votes
1answer
13 views

How to create mint function but with msg.sender

I want a mint function but instead of _mint(to, amount) i want _mint(msg.sender, amount) how can i do it??
0
votes
1answer
10 views

In web3.js is it possible not to duplicate emitting of connection error events?

My smart contract has several events to listen for, and my dapp normally interacts with the contract through a wrap provided by the contract Web3.js abstraction. It would be nice for me to logically ...
0
votes
1answer
12 views

UnhandledPromiseRejectionWarning: Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent

I am trying to run the below code: // Import modules var Web3 = require("web3"); const HDWalletProvider = require("truffle-hdwallet-provider"); const { interface, bytecode } = ...
0
votes
0answers
10 views

how to cache responses of rpc api calls in DApps

Issue: JSON RPC Queries When interacting with an ethereum rpc interface for building DApps with JS or TS, the huge amount of communication round trips becomes a huge burden. The UI just takes a couple ...
0
votes
1answer
12 views

How to derive value from transactions ETH

When I use python web3 to get an transaction: w3.eth.getTransaction('0x0ae2e71023a5801e557472d9b58dee483a8617cff3afcdeae171889e0db70ded') I get: AttributeDict({'blockHash': HexBytes('...
1
vote
2answers
14 views

Gas efficient way to generate multiple different random numbers

I am constructing some nft metadat on-chain, and need to grab pseudo random number for each of the traits, these numbers need to be different. So far best I came up with is following function ...
0
votes
0answers
8 views

RPC Runtime Errors With Metamask

Im trying to create a basic product list/buy/sell form locally. While trying to run a transaction on Metamask I get a console error with this stack: MetaMask - RPC Error: [ethjs-query] while ...
0
votes
1answer
6 views

Is there a difference whether a struct is defined inside a contact or outside of it?

Both, struct Test { uint x; uint y; } contract A { Test test; } and contract A { struct Test { uint x; uint y; } Test test; } are valid ways to define a struct. Is there any ...
0
votes
0answers
8 views

Why is `abi.encodePacked` preferred to `bytes` in string comparison?

The official documentation recommends to test string equality using keccak256(abi.encodePacked(s1)) == keccak256(abi.encodePacked(s2)) Why is this to be preferred to keccak256(bytes(s1)) == keccak256(...
0
votes
0answers
13 views

Changing contract address in the ABI of the front-end

I am developing a react dapp and have a smart contract deployed on the test net. I am deeply concerned with regards to the security of this dapp. This question is very much related to this As I ...
0
votes
0answers
6 views

I'm getting this error : VM Exception while processing transaction: revert, while trying to send value from my frontend to smart contract

I'm trying to develop a Dapp but I'm stuck right now, due to this error that I'm getting while sending value from my frontend to smart contract. So, basically I want to update the UI once this ...
0
votes
0answers
29 views

How will the gas fee be allocated in ethereum 2.0?

Such as title, how will the gas fee be allocated to validator in ethereum 2.0? Will give it all to the block proposer? I don't see an explanation for this in the official documents. My idea is this: ...
0
votes
0answers
13 views

How to find best router from many sources ( pancakeswap, bakeryswap , mdex, ...) [closed]

I researched a finding router algorithm like dodoex. But I don't know how dodoex can find a path that can make the biggest return in a router? Are all paths fixed and stored in a list or dynamic? If ...

15 30 50 per page
1
2 3 4 5
769