All Questions

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

0x exchange v3 debugging (execution reverted, more details inside)

I am trying to swap the erc721 token for erc20 using the 0x protocol which I deployed on the testnet. Using the following script to perform the swap: /** * Local, Data & Env imports * Exchange....
0
votes
0answers
3 views

Redeploying the same contract using more gas on token.transfer()?

I redeployed a contract on Github with the same compiler and optimization parameters. However on token.transfer(), the redeployed contract uses about ~5k more gas than the original contract. Is there ...
0
votes
0answers
2 views

Truffle migration, how to get the deploy file on the previous migrate?

I have encountered the problem when I use truffle migration, it works fine so I deploy the contracts on the mainnet for actual use. After a while, I decided to make some changes and try to upgrade the ...
0
votes
0answers
3 views

project ID does not have access to polygon l2 using infura

i am deploying to polygon test net with hardhat. but when i try to deploy this error came up. here is the config file: require("@nomiclabs/hardhat-waffle"); require("dotenv")....
0
votes
1answer
6 views

Error encountered during contract execution [Out of gas]?

i have this address 0xb5f82127b5067f1019abd362ba812c0ef8196717 as you can see i have 3 transaction failed with this error : Warning! Error encountered during contract execution [Out of gas]. I was ...
0
votes
1answer
12 views

Solidity contract to handle multiple uniswap trades and refund to sender at the end

I'm looking for a simple solidity contract that I can send tx swap data to, wether in hex or an array. Ex: send funds to contract Swap a > b, Swap b > c, Swap c > a, return funds to address I ...
0
votes
1answer
12 views

In React.js, How can I get return data from smart contract method including event and emit?

I have smart contract server function and that function including emit and event. event TokenMinted( address indexed _recipient, uint256 indexed _tokenId ); function ...
0
votes
0answers
7 views

Swap ETH to DAI using ISwapRouter from Uniswap

I am trying to get started with Uniswap V3. As an example, I took the most basic use case: Given X amount of ETH do a swap to DAI. Unfortunately, I am not being able to make it work. There is already ...
0
votes
1answer
15 views

Does a view function always have access to msg.sender?

Any transaction happening on the blockchain obviously has an associated sender address, which solidity stores in msg.sender. However, if I have a view function which can be used to read the state from ...
0
votes
0answers
3 views

Trouble sending correct amount of a token with web3

i'm trying to transfer a value of 1 of my erc20 token to my contract. In my front end I am using: tokenContract.methods.approve(contract_addr, 1).send({from: accounts[0]}); In my smart contract I am ...
0
votes
0answers
6 views

Best practices for functions with highly variable gas cost

I'm developing a Dapp with a function (let's just call functionA) that has potentially significantly different gas cost between invocations. This is due to the need for costly extra computation when ...
0
votes
0answers
7 views

Cannot migrate contract to blockchain on Truffle's Pet Shop tutorial

I have completed Truffle's Pet Shop tutorial up to the point of migrating the Adoption.sol contract with 2_deploy_migration.js . This is the error that shows up in the terminal. Starting migrations... ...
0
votes
1answer
11 views

Is it possible to create 500 Ethereum/MetaMask wallets from code and prefund them?

I am looking through Brownie and Hardhat but see nothing in the docs that suggests this. I have tried looking through Authereum and other wallets to no avail.
0
votes
0answers
11 views

Using signature to send NFT

is it possible to use signatures (EIP-712) to execute transactions. For example Person A gives his signature to a Smart Contract, to transfer A's NFT. Now there is person B, which wants to buy the NFT....
0
votes
1answer
8 views

web3 event keeps on running after resolve()

In my project I have a contractInteract function that interacts with a blockchain contract returning a promise. I add a "confirmation" event. This event logs "Confirmed!" every ...
0
votes
1answer
9 views

Testing address(this) generates exception, how to obtain the correct value for address(this)

I have modified the following code from a michalzalecki website https://michalzalecki.com/ethereum-test-driven-introduction-to-solidity/ to test address(this): pragma solidity 0.5.16; import "...
0
votes
0answers
15 views

Can an external source be used in place of a proxy contract?

The recommended way to create updatable contracts is to create a proxy contract which then calls an origial contract. I haven’t worked with proxy contracts yet, but I’ve seen the code and it appeared ...
0
votes
0answers
7 views

How to "export table" - save state of ethereum smart contract from ETH blockchain?

In a traditional database you can just export the table and save all the data. For example if you go to etherscan you can view and Read the contract. I would like to know, how could i "export&...
0
votes
0answers
11 views

Is there a list of compiled known ethereum addresses?

Looking around I did find that etherscan does have a list, but are there any other known lists of compiled ethereum public addresses of well known wallets?
0
votes
1answer
10 views

Reset array to initial state (delete all elements)

I was wondering which was the appropriate way to reset an array to initial state, and so delete all the elements that it contains. I found the following ways: delete paidPlayers; paidPlayers.length = ...
0
votes
1answer
11 views

How can I open an URL in Metamask explorer from a mobile navigator website?

How to open the URL of web3 in the Metamask explorer from a href link in that web3?
0
votes
0answers
13 views

How to send tether token in ether wallet using web3

I am gonna send tether token from my wallet address to other wallet address using web3. const Web3 = require('web3'); const web3 = new Web3('https://mainnet.infura.io/v3/projectId'); web3....
0
votes
0answers
7 views

How to get all pending transactions using web3js

I am working on custom blockchain testnet. I wanna see all pending transactions on my local block explorer. To do this I first tried with web3.eth.getPendingTransactions() but it always returned ...
0
votes
0answers
10 views

Using delegatecall [duplicate]

I have a contract from which I want to do a delegatecall, which approvesForAll the contract A in contract B. I use delegatecall to keep the sender the one initiating the transaction. function ...
0
votes
1answer
17 views

Calculate Percentage

I want to calculate user reward per day. uint256 totalBalance = 111; uint256 rewardPerDay = 1000; function calculateReward(uint256 userBalance) public view returns (uint256) { uint256 ...
1
vote
2answers
23 views

Interacting with closed source contract

I am a pro developer but relatively new to blockchain development. There is a close source contract that I can interact with via the provider's web interface. The screenshot below is the receipt of ...
0
votes
1answer
9 views

Returned values aren't valid, did it run Out of Gas? using call function with web3js

I'm new to blockchain development, I have done some simple projects before and I had no issue in calling the functions with web3js, but now I'm trying to run a call function on a smart contract using ...
0
votes
1answer
13 views

Why do we need to use private variable getters inside the same contract?

I recently read a smart contract from Openzepplin with the following code in it uint256 private certainAmount; function getCertainAmount() public returns (uint256){ return ...
0
votes
1answer
7 views

Are events only useful for loggin purposes?

After reading a bit of documentation about events and reading some answers here, I don't really get why events are useful in solidity. Emit an "event" means to notify listeners about ...
0
votes
0answers
9 views

A proxy factory does not return the clone contract address

I have three smart contracts: An abstract one: pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; /** * @title Base contract for state machines */ ...
1
vote
1answer
34 views

How to edit minium link payment as a node-operator

Been running a node, and I notice the payment in configuration settings is not editable, how do I figure that out, also am not seeing the Oracle balance in link increase and it debiting the user using ...
0
votes
2answers
20 views

ERC-721 NFT how long can be metadata url string

I have three questions: what is the size limit for url field of ERC-721 NFT metadata. can that url be changed by some smart contract. can that url and token id be discovered/visible by over smart ...
1
vote
1answer
10 views

Running chainlink node on google cloud and accessing the node server as an operator

I was able to access the localhost:6688 when I was running the node server, so whenever I closed the console the server will go down, so I decided to detach it by installing sleep now the server is up ...
0
votes
1answer
18 views

How does the value of an NFT is calculated as a loaning asset?

I’ve been thinking, could it be that the very high NFT prices is an economic trick? In other words, is this scenario possible: -Alice have X value -So, Alice hires Bob off-chain to submit a rubbish ...
0
votes
1answer
4 views

compare uint from datestamp always return true

function testDate(uint date1,uint date2) public returns (bool) { require(date1 == date2,'not same date') return date1 == date2; } let res = await TestSol.testDate.call(‘1630972800’,‘1631145600’)...
0
votes
0answers
3 views

Access data part in ERC 1155 Token

I'm new to the DEFI and blockchain concepts. So spare me if this is a lame question. I am working on a project that needs data to be encoded and fed into the ERC 1155 token. I made a dummy contract ...
0
votes
1answer
8 views

Can we achieve ATOMICITY in our smartcontract transactions?

The scenario is: I have 2 smartcontracts and contractA calls the method in contractB. Lets assume a transaction is signed in one of the method in contractA which does something and then also calls the ...
0
votes
0answers
10 views

Can I reset the initial set price for erc20 token on uniswap?

I am relatively new to cryptocurrency and wanted to try listing an erc20 token. I listed my erc20 token on Uniswap and set its initial price while adding the first liquidity. Later, I wanted to change ...
0
votes
0answers
6 views

How does geth tests do code gen?

I'm trying to understand how the ethereum test related geth golang code work. I'm stuck at how the test json files are processed. https://github.com/ethereum/go-ethereum/blob/master/tests/...
0
votes
0answers
18 views

Gas Limit Drops to Zero for Internal Transaction

I've deployed a contract to Rinkeby involving a few different interfaces I've written. This result in a fair number of transactions occurring behind the scenes with different contracts. There is a ...
0
votes
0answers
13 views

Stack Too Deep error with only 5 items on stack

So, there are a lot of these questions and I've read through a bunch of them and several blog posts, but I'm still stumped on why I'm getting the error here. My function (to reproduce, copy it to here)...
1
vote
1answer
9 views

Testing for emitted events in Hardhat

I have a Solidity contract that inherits from ERC721PresetMinterPauserAutoId I want to write a test that verifies that a Transfer event has been emitted by the contract after the public mint(to) ...
0
votes
0answers
6 views

Transferring NFTs with approved Smart Contract

Im currently developing an ERC-721 DApp and I would like to give the owner of the NFT the chance to approve a Smart Contract Address, so that the Smart Contract can do the transaction. Now I have the ...
1
vote
1answer
9 views

Uniswap - Do you pay multiple fees when going through routes?

If an X/USDT pair does not exist, we might want to trade between an intermediary coin such as ETH: so now we are trading X/ETH/USDT. Does this incur two independent trades under the hood with separate ...
0
votes
1answer
14 views

How do you do confirmations for ERC20 tokens?

new to blockchain. I've got a good understanding of bitcoin and other similar tokens and how their confirmations and transactions look. But I'm still trying to figure out how Ethereum and ERC20 tokens ...
1
vote
0answers
8 views

Metamask time vs block time

I am building an app using web3. I was running some test, and something came up. Why network's block time doesn't match with metamask time to accept transacion even when I set the "fastest" ...
0
votes
0answers
12 views

Eternal storage smart contracts

I am trying to make smart contracts with an eternal storage design. So lets say I have contract A and B: Contract A is Ownable { struct Item { uint256 id; uint256 price; address ...
0
votes
0answers
11 views

Private keys & not buffer being passed to test file

I'm running a test on a very simple pool contract. I am using Mocha to write the tests, but Hardhat's network to run them. After firing up my Hardhat node I get the 10 test accounts per usual with ...
0
votes
1answer
32 views

How to determine if a pending transaction will revert?

Is there any way to understand if a specific transaction will revert while in pending status? If so, how can I code it exactly?
0
votes
0answers
12 views

How do i sign a transaction with web3js?

I have a dex project that uses metamask to sign transactions, i am trying to remove metamask and turn it into a CEX, users login to the site and are given their own address and private key for ...

15 30 50 per page
1
2 3 4 5
747