All Questions

Filter by
Sorted by
Tagged with
1
vote
0answers
20 views

Create ERC721 with media file

I want to create an ERC721 smart-contract. The token will be associated to a png file. The users will see there tokens in metamask and i want to display there png files in metamask (this is very ...
0
votes
0answers
12 views

How can a contract accept some ether and send a stablecoin in return

My contract has to take ETH as a collateral and send some stablecoins ( like USDC) to user. How can I use any stablecoin into my contract , assuming contract has an infinite supply of USDC ? I too ...
0
votes
0answers
8 views

Problem importing my account to metamask

i tried to import my myetherwallet account into metamask by entering private key and try to connect both account but my imported account does not show any tokens i tried it many times by unistalling ...
0
votes
0answers
15 views

Am I doomed? Accidently sent tokens to 'bridge address' from exchange account [closed]

Good Evening all, I have encountered a bit of a problem. Being fairly new to the whole crypto game, I went to withdraw some ERC-20 tokens from an exchange account of mine and sent them direct to a ...
1
vote
2answers
74 views

Can you use block times as a measure of duration?

I have read that it takes about 12 seconds for an ethereum block to be mined. Let’s us say I have a contract mined on block 100, can I set a function that can only be run at block 200 or more? Thus ...
0
votes
0answers
11 views

Solidity beginner exercise: Santa'slist

I am trying to implement the following exercise "Santa's list": Build a system for tracking who is on their nice list and who is on their naughty list. Furthermore, I do not want duplicates ...
1
vote
0answers
29 views

eth_estimateGas Error when balance of an account < the amount to send in a transaction

I have used the following request to estimate gas in an ETH transaction in Ropsten. ## JSON-RPC over HTTPS POST curl https://ropsten.infura.io/v3/YOUR-PROJECT-ID \ -X POST \ -H "Content-...
0
votes
1answer
8 views

I sent some old CAS token to Binance but sent it to BTC address in error [closed]

Not showing on binance 0xd76e92ca9f39656061a5d88a17fba884db2b188ed02e2e678a7c58b24dd109f9 - I found it on etherscan, anyway I can get it back ? many thanks
1
vote
0answers
31 views

Correctly compiled contract on remix returns empty ABI

I have two questions. My contract has compiled and deployed successfully both using remix and truffle. However: q1) remix returns an empty array of ABI. Also, after I hit compile the contract at the ...
0
votes
0answers
7 views

Running --no-ancient-blocks on a synced node

I have an up to date OpenEthereum node that is taking a long time to sync it's ancient blocks, Which has left it syncing a batch of ancient blocks, while falling behind, then syncing up to date. Put ...
0
votes
0answers
20 views

How to recover ether from failed reverted transaction?

I did a swap on uniswap and I lost my ether. The transaction failed. How do I recover my ether? Why does the transaction fails?
1
vote
1answer
62 views

Can a flash loan used to flash attack a smart contract?

I am new to flash loans. Let us say I have smart contract where people vote. Your voting power on this contract is based on how many token x you have. The votes are yes and no and the vote with more ...
0
votes
0answers
10 views

ETH token transferred to TX id

I transferred ETH token from Binance hot wallet to ETH wallet by mistake. How can I get that returned to Binance wallet. Can someone please help me on this. Regards
2
votes
1answer
15 views

How to assign networkish for provider?

Here is the doc about provider in ethers 5.x document: new ethers.providers.JsonRpcProvider( [ urlOrConnectionInfo [ , networkish ] ] ) Connect to a JSON-RPC HTTP API using the URL or ConnectionInfo ...
2
votes
2answers
21 views

How Ethereum take fees in broadcast?

Can I broadcast someone else signed transaction and use fee from my address? if yes then how? Let me elaborate my Question Suppose person A want to transfer some ERC tokens to person B. But person A ...
0
votes
1answer
13 views

Eth transfer didn't get to my wallet [closed]

Transferred eth from bnb to crypto.com wallet, successful on block chain not reflecting in my wallet. TX ID: 0x768b065141910a5d225e187189433143aea9d792723536ffd87fd93247d8c484
1
vote
0answers
10 views

Error: Wallet has error: Error: could not detect network (event=“noNetwork”, code=NETWORK_ERROR, version=providers/5.0.17)

After enabling JWT token authentication on besu network, a connectionInfo with JWT token in headers is used to make connection to the network, instead of url. import { ContractFactory, ethers } from &...
1
vote
2answers
16 views

Can decimals() return different values for an ERC20 token according to the standard?

https://eips.ethereum.org/EIPS/eip-20 says this about the decimals() method for an ERC20 token: decimals Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by ...
5
votes
2answers
31 views

How do generalized sandwich attackers defend against Salmonella and Listeria?

Recently a trader extracted significant profits from sandwich attackers with a contract called Salmonella. The contract modifies the standard transfer function to send only a fraction of the requested ...
1
vote
1answer
18 views

How do NFT marketplaces work? (Mostly about authorization of transferring NFTs)

ERC721 says that NFTs can only be transferred by owners/authorized addresses. How are solidity marketplace contracts made to allow a third party address to transfer an NFT from your account to theirs ...
1
vote
0answers
15 views

How to let the user sign a nonce in frontend and check the authenticity in the backend?

My frontend code: html (using cdn, couldn't make the npm run...): <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script> javascript: web3.eth.personal....
4
votes
1answer
18 views

What's the meaning of “dirty” in Geth's INFO logs “Importing new chain segment…”

I am trying to understand the logs I see when I journalctl -fu my Geth service, which I restarted after it was offline for two days. This is less a troubleshooting question and more an extension to ...
0
votes
1answer
19 views

given tx hash: tokens transfered?

I have a transaction hash (for example 0xd97a7f7e15709ce345842a52a6e8db395e6ba779fd76a426b1878512a34a8128) I would need the information in red, basically the tokens involved (the first one is an ERC20 ...
0
votes
1answer
7 views

Do the Solidity v0.8 overflow checks apply to assembly operations too?

Since Solidity v0.8, the compiler has checks for {over,under}flow by default for all arithmetic operations. Do these checks apply to assembly (yul) arithmetic operations too?
1
vote
0answers
10 views

What is the fastest way to implement the find first set algorithm in Solidity?

As per Wikipedia, a find first algorithm is: a bit operation that, given an unsigned machine word, designates the index or position of the least significant bit set to one in the word counting from ...
0
votes
0answers
14 views

how to pass my arguments to constructor smart contract while deploying using web3 truffle

could you please help me with this step? I have a smart contract with a constructor with a parameter, but I don't know how to pass this parameter when deploying the smart contract using truffle and ...
0
votes
1answer
21 views

I AM Trying to connect my Website with Remix Ethereum IDE and getting Error { (index):85 Uncaught TypeError: CoursetroContract.at is not a function}

''' Document <link rel="stylesheet" type="text/css" href="main.css"> <script src="https://unpkg.com/web3@latest/dist/web3.min.js"&...
0
votes
0answers
14 views

How to deploy a Vyper smart contract? Remix fails to compile

I have been trying all the solutions and tutorials I found on the Internet, with no success. Remix fails to compile vyper smart contracts in local and remote. How to make it work?
0
votes
1answer
9 views

I need to know how to set a maximum buy limit per wallet

Yeah so I'm creating a eth token and I need to find a way that buyer have a purchasable maximum limit. Can anybody help me with that ? Can't find answer thanks a lot.
1
vote
0answers
18 views

Able to Produce Blocks but Still Balance is Zero

Kindly find the following results below from my Mac Terminal: miner.start(1) --> null miner.stop() --> null eth.getBalance(eth.accounts[0]) --> 350000000000000000000 eth.syncing --> ...
0
votes
1answer
18 views

Build with multiple solc versions?

My tokens and basic setup scripts are built in solidity 0.8.0 and I just downloaded GSN with OpenZeppelin because I need a platform which will fund users' few things. Now I can't compile because it ...
0
votes
0answers
17 views

Infura authentication in truffle-config.js

I have create a project on infura.io website. I have create a new truffle project. Here is my truffle-config.js file: const path = require("path"); const HDWalletProvider = require("@...
0
votes
1answer
26 views

Sign a message in javascript

I want to sign a message with my ethereum account in a javascript application. I do not want to work in a web-browser or with metamask. I want to build a stand alone javascript program. Is there a way ...
0
votes
0answers
10 views

How to get data from earlier blocks in ethereum BC via web3.py?

I am trying to get data from earlier blocks/transactions. I have created events and emitted them. I can see the logs in the Remix IDE. However, I cannot get the logs in web3.py. It only returns empty. ...
1
vote
1answer
34 views

Generating an Ethereum wallet with an existing private key

I want to understand how Ethereum works and i want to calculate the public key and wallet address from private key. I have read this tutorial: https://piyopiyo.medium.com/generating-an-ethereum-wallet-...
0
votes
0answers
20 views

send a certain portion to a specific address with every transaction

i have created a Smartcontract. now i want the functionality: where 2.5% of every transaction is transferred to a fixed address. say the address is 0x809341c1c1cba2d6accf8188bca463a119443d. i know it ...
1
vote
1answer
15 views

setting value using address.call() doesn't works

I am trying to run a setter function (testCallBar) in Caller contract which should run setVal() of Receiver contract using call method. But it does not works. testCallFoo() works as expected but ...
1
vote
1answer
13 views

Explore transaction from truffle test file

I have create this test: const { expectEvent } = require('@openzeppelin/test-helpers'); const MyContract = artifacts.require('MyContract'); contract('MyContract', function (accounts) { const [...
0
votes
1answer
18 views

How can i properly git a truffle/react project

Here is what i've done in a blank directory: $ truffle unbox react $ npm install @openzeppelin/contracts $ npm install @openzeppelin/test-helpers $ npm install @truffle/hdwallet-provider Then, i have ...
0
votes
0answers
9 views

Verify result of gas expensive view calculation in transaction

I'm have an expensive view function which calculates rewards over time and investment. When it comes to withdrawing rewards I would need to run this, which could overrun gas for the block. Is there a ...
1
vote
3answers
18 views

Get contract's owner address without openzeppelin Ownable

I want to know if Ethereum stores the contract's deployer address by default. I know Ownable Library which stores owner's address in a storage variable. I want to know if Ethereum blockchain stores ...
0
votes
1answer
10 views

Validator selection

When validating a block, do validators know who the other validators are, prior to voting? Does the proposer know the other validators prior to proposing a block? If so, that could lead to collusion ...
-1
votes
0answers
9 views

Who can help me clone a token [closed]

On bsc and also i would like to lock liquidity for 1 year aswell as other improvements etc Can anyone help me get a token stsrted.
0
votes
0answers
28 views

Are binance ERC20 token transactions not on the ethereum blockchain?

I'm using web3js get transaction info on a specific ETH address. When I make the getTransactions call, no info is presented. I then check etherscan and also see that my binance ETH wallet (for ...
1
vote
1answer
25 views

ERC20 token transfer attempt resulting in underpriced (price change attempted)

It's almost an exact copy of this but when I ran it, I get the following error message. (node:5189) UnhandledPromiseRejectionWarning: Error: Returned error: transaction underpriced Below is the code ...
2
votes
2answers
78 views

What happens if GitHub path for import changes?

I wondered what happens if for example OpenZeppelin changes the path of a contract I have imported like this: import "@openzeppelin/contracts/token/ERC721/ERC721.sol";? Will my contract ...
0
votes
0answers
17 views

Api call to write a contract [closed]

How to write a contract on uniswap router with etherscan API. I want to write a contract on the router as soon as a trigger function execute.
0
votes
1answer
17 views

Does a failing `require` condition cause emitted events to be reverted too?

Consider the following contrived contract function: function submitOffer(uint256 foo) public payable { emit MyEvent(foo); // then later... require(foo > 10, "Foo must be greater ...
2
votes
1answer
31 views

Solidity's keccak256 hash doesn't match WEB3 keccak hash

TL;DR: I have a method in a contract to calculate a keccak256 hash, and I'm trying to replicate it in Web3, but the hashes don't match. My problem is very similar to the one in this question, but the ...
0
votes
0answers
21 views

Ethereum solidity membership and rating application [closed]

I have been looking for almost 2 weeks but I can't find any use case for my implementation. I want to create an application for movies adding and rating using Ethereum and Solidity on local ...

15 30 50 per page