All Questions

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

What are the mechanics of DeFi Yield Farms?

TL;DR: Does anyone have any literature or other resources they can point me at for how DeFi works under the hood, like really. How/why do percentages change, and where are defi operators pulling ...
0
votes
0answers
9 views

Converting constructor from 0.4.25 to latest version

The syntax of constructor in version 0.4.25 was contract A { address newContract; function createContract(uint a, string memory b, address c) public { newContract = new B(a, b, c); } } ...
0
votes
0answers
6 views

Contract Marked As Abstract

I encounter an error specifying contract "FlashLoanReceiver.sol" should be marked as abstract. Is that means I missed the constructor line? Thank you for your kind help pragma solidity ^0.6....
0
votes
0answers
8 views

For a given contract address, does a private key exist that maps to it?

I was reading this section from Mastering Ethereum. This specific part caught my attention: However, not all Ethereum addresses represent public–private key pairs; they can also represent contracts, ...
0
votes
0answers
12 views

EthTx adapter in Chainlink job, fails with “transaction reverted on-chain”

I have gone through the existing error link EthTx Adapter in Chainlink Job and the solutions recommended is also tried, but still i am facing the same issue. Approach I taken to debug is given below ...
1
vote
0answers
7 views

Why we sort tokens in uniswap functions?

function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1)...
0
votes
0answers
4 views

Unable to verify my contract on etherscan!

OK firstly hello and thank you to anyone that helps me out here! Below is the code i used to generate my token on Remix! Now I am aware that the IMPORT has a version of 0.6.0 and im hoping that ...
0
votes
0answers
9 views

Getting exception and high fees in a simple UniV2 swap

Function approve() works perfectly, while ethToTokens() gives an unreal high fee and also causes an exception. I cannot understand how to find the exception causing the issue in ethToTokens() Can ...
0
votes
0answers
12 views

Send transaction & get receipt with log

Using sendTransaction to submit a tx. It works. Then wanting to get the receipt and check the logs to extract data. That codes works in isolation. How to put the two together? The problem is the ...
0
votes
0answers
5 views

Why can't I save contracts in Remix - is it because I'm out of space?

So sometimes I'll save a contract, click another contract and when I come back to the original contract it's gone! I notice that if I delete some existing contracts, then it won't disappear and will ...
0
votes
1answer
7 views

Ensuring a fair distribution of an NFT set?

Suppose I have 1000 NFT's I would like to distribute. The user can see what any NFT looks like in advance, but they don't know what they'll be getting until they actually buy it. In other words, there ...
0
votes
0answers
7 views

web3py does not show true pending transactions when using dictionary parameter

If I use the following code: In: web3_pending_filter = web3.eth.filter('pending') hashes = web3_pending_filter.get_new_entries() print(web3.eth.get_transaction(hashes[-1])['blockNumber']) ...
0
votes
0answers
5 views

How to connect running node on aws server remotely as a rpc endpoint?

I have a full sync node running on an aws server, I am able to connect and interact with the node at 8545 locally. But I am not able to connect to it from remote computer. The code as follow. from ...
2
votes
0answers
20 views

What is the best way to accept either custom erc20 token or ether

I am working on marketplace smart contract where users can sell erc721 tokens. Everything seems to be working. I wanted to receive the erc20 token and ether both as payment methods. So what I do is to ...
1
vote
1answer
13 views

How can I grab a list of all txHashes from the current/previous block with JSON-RPC

I would like to grab the list of txHashes in the current block or the previous block. I would like to grab this from a json-rpc api. Is this possible? All I found was grabbing info about the block not ...
2
votes
1answer
17 views

Why does smart contract successfully deploying to Rinkeby fail to deploy to mainnet?

truffle.js: var HDWalletProvider = require("truffle-hdwallet-provider"); var mnemonic = ""; module.exports = { networks: { development: { host: "localhost", ...
1
vote
0answers
11 views

How do I check if an IPFS-Hash is valid or not, as an input?

I wanna store Ipfs-hashes (Content Identifier) on the blockchain in the code below. And because it's public and anybody can use it, I want to make sure the function only accepts valid Cids (i.e., the ...
2
votes
0answers
19 views

Is there a mechanism for fair, trustless Chainlink oracle pricing?

When using a Chainlink oracle node that you don't have a formal commercial agreement with, the user pays the node operator in Link tokens, but the node operator bears the cost of transacting on the ...
0
votes
0answers
21 views

WalletConnect web3 provider issue with TrustWallet

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP. I simply install the npm package "@walletconnect/...
0
votes
1answer
24 views

I read the description, but I don't understand it. Thank you for every day

ParserError: Expected type name function execfunct pragma solidity ^0.6.05; abstract contract AionClient is Aion, Context, Ownable{ using SafeMath for uint256; address private AionAddress; ...
1
vote
1answer
19 views

require(condition, “message”) vs revert with a custom Error(), which is better and why?

For Example: /** Custom Errors **/ ///`cid` is an invalid Ipfs-Cid /// @param cid Ipfs-Cid entered. error InvalidCid(string cid); ///Sender's address isnt valid error ...
0
votes
1answer
14 views

Deploy fail error in deploying TRC-20 contract

I aimed to deploy this TRC-20 contract (link) following this tutorial step by step on shasta test network. I complied the contract successfully but when I wanted to deploy the contract, I got the ...
0
votes
0answers
9 views

Why this error is coming Uncaught TypeError: Cannot read property 'on' of undefined?

Here is my code in which error is coming please help me out. initContract: function () { $.getJSON('Election.json', function (data) { // Get the necessary contract artifact file and ...
2
votes
0answers
15 views

Did Solidity ever release a new feature in a version that was rolled back in later versions?

The question title is pretty self-explanatory. I'm wondering if that ever happened. And if so, what were those features and which were the Solidity versions where they were released/rolled back?
0
votes
1answer
14 views

Copied Contract

firstly I have limited knowledge of solidity but am trying to learn some basics in understanding how a contract works. I have copied a contract that I am playing around with on ropsten test network ...
2
votes
1answer
9 views

How do I handle Fiat payments?

Is there a good method/way of handling Fiat money in my dapp? Is there anything like Stripe but for use on blockchain?
1
vote
1answer
10 views

food delivery dapp: handling driver sort algorithm over smart contract?

So I have a few apps- driver, customer and restaurant. I want to do randomized driver assignment (automatic) when customer places the order. Is this practical for a smart contract?
1
vote
0answers
21 views

Timestamp of when address received a token

Trying to find a way or documentation in obtaining the timestamp of when an address received the token in a smart contract. I have read many reflection based contracts that apply different levels of ...
0
votes
1answer
8 views

Multiple contract verification error

I am deploying a crowdsale smart contract. I deployed it on testnet.bscscan.com earlier.I had to change the name of the token , so I just changed the name and tried to verify the crowdsale contract ...
1
vote
0answers
11 views

Capture that a listener dismissed the MetaMask popup

I'm using ethers.js and I'm writing code to connect to MetaMask when the user clicks a "connect" button on my site. The problem I'm having is that I'm unable to determine if the user ...
0
votes
0answers
6 views

swapExactTokensForETHSupportingFeeOnTransferTokens fails for some tokens when called from script, but works when submitted from Pancakeswap

I have a simple code using web3.py that sells BEP20 tokens: deadline = int(time.time()) + 1200; nonce = w3.eth.get_transaction_count(w3.eth.default_account) sellTxn = self.web3Context.routerContract....
0
votes
2answers
28 views

Chainlink Beginner Tutorial: call to PriceConsumerV3.getLatestPrice errored: [object Object]

I have followed the steps in the Chainlink docs Beginner's tutorial, as described here: https://docs.chain.link/docs/beginners-tutorial/ Everything appears to work until the last paragraph: Click &...
0
votes
0answers
7 views

Burn .05% of each transferred token?

I have written my contract but want to also add the functionality to burn token after each transfer My code contract Token { mapping(address => uint) public balances; mapping(address => ...
0
votes
0answers
15 views

Cannot use transferFrom

no matter what I try, I am unable to call token.transferFrom without getting ERC20: transfer amount exceeds allowance - even though I have approved the allowance. Code speaks better than words: ...
1
vote
0answers
13 views

How do farming/staking platforms really profit? [closed]

Sorry if this question isn't directly related to Ethereum, but to DeFi in general. I understand how we, users of platforms like PancakeSwap, Aave, Curve and such, can profit from these platforms when ...
0
votes
0answers
7 views

Why is UniswapV2Factory not implementing IUniswapV2Factory 'getPair' function?

Sorry newb here. https://etherscan.io/address/0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f#code Why is there no function called 'getPair' even though IUniswapV2Factory declares it? Thanks in advance.
0
votes
0answers
33 views

How are tokens priced when traded in quantities on Uniswap?

I’m new to cryptocurrency and have gone through the entire documentation for Uniswap, but unfortunately still can’t seem to find an answer to this question. I’ll describe my question in this ...
0
votes
0answers
6 views

Solidity compiler 0.8.5 “Unreachable code.” Warning on certain parts of code that worked before

Now that I'm using the 0.8.5 compiler, I'm getting a warning that says "Unreachable code." for parts of my functions that didn't have any issues until 0.8.5 (works on any below that). Does ...
0
votes
0answers
22 views

Why can I no longer mine on the binance pool? [closed]

This question was closed due to being off-topic, which is fair enough, but I'll add the solution here in case it helps someone: Change protocol to stratum1+tcp. I have been using the ethminer client ...
0
votes
1answer
6 views

Constructor deploying token to ethereum chain

Suppose I want to deploy my smart contract in the ethereum main network as an erc20. In order for it to be an erc20 one of the requirements is balances[msg.sender] = _totalSupply; Is that right ? Why ...
0
votes
1answer
10 views

how to ensure the atomicity of multiple inter contract transactions

I am creating a contract to buy and sell different tokens in batches. and i want to ensure that all the transactions that would buy or sell the individual tokens, either pass or fail. my code would be ...
1
vote
0answers
8 views

Is hyper ledger fabric ERC compatible?

If I need to use an ERC-1400 token, can I use it on an AWS hyper ledger fabric for example? FYI: New to blockchain technologies
0
votes
0answers
24 views

Capturing accounts on metamask with Ethers.js

On this code, the private_key is the key that the user entered. My goal here is to get the private_key from the user and log in with whichever public key it matches among the accounts that I have ...
1
vote
1answer
10 views

Auto adjustable token supply

Is it possible to a token to adjust its own total supply so it can keep your price more stable? I mean when a token "realizes" it is too cheap it burns some amount and when is too expensive ...
0
votes
0answers
14 views

How do I use a Solidity Library in NodeJs

Can I interact with the Solidity library in nodejs with the ethers library if I have the "my_specific_library.json" file generated by truffle in the compilation of the the ...
0
votes
0answers
14 views

Uncaught TypeError: Cannot read property 'contract' of undefined

I'm getting this error. Can someone please help me Uncaught TypeError: Cannot read property 'contract' of undefined at add_details ((index):140) line:140--> var myContract = new Web3.eth.Contract(...
0
votes
1answer
19 views

TypeError: Member “gas” not found or not visible after argument-dependent lookup in tuple(bool,bytes memory)

How do I fix this? abstract contract AionClient is Aion, Context, Ownable{ using SafeMath for uint256; using Address for address; address private AionAddress; constructor(address addraion) public{ ...
0
votes
1answer
13 views

How do I fork the Uniswap V2 interface and make changes? [closed]

I am already done forking the smart contracts of the Uniswap, I am looking at forking the interface and then linking it up with the smart contract, is there a guide or way I can do this, I can't seem ...
0
votes
1answer
7 views

How to get events from a contract deployed on different network? - Web3

I have contract A in Avalanche FUJI C-chain. When I'm on C-chain testnet, I can get events from A using getPastEvents() in web3.js, but when I change the testnet (for example, to Goerli), I receive an ...
0
votes
1answer
14 views

“Gas requirement is infinite for the function” infinite gas error

I am getting the error "Gas requirement is infinite for the function" from the code I specified below. And the transaction is being reversed. What should I do to get this flow to work? ...

15 30 50 per page
1
2 3 4 5
700