All Questions

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

swapExactETHForTokens - Gas Error Message

After spending hours of research, I finally found the code from this forum that will do the trick for me. I've successfully compiled the code in Remix (Kovan Test Environment), but I'm getting this ...
0
votes
1answer
9 views

What is the proper way to check if msg.sender is the contract owner?

I'm trying to make a function that returns true if msg.sender is the owner. This is my function; function isAdmin() public view returns (bool){ require(admin == msg.sender); return true; ...
0
votes
0answers
7 views

Unimplementedfeatureerror Any clue on how to fix this please? Thanks

pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; interface Structs { struct Val { uint256 value; } enum ActionType { Deposit, // supply tokens Withdraw, //...
1
vote
0answers
11 views

Is it worth to store Ether at the full precision in database?

Ether has precision of 10^18 which makes it impossible to use BIGINT type in database to store values in weis: DECIMAL type should be used instead. Is it worth to store values in Gwei to stay with ...
-2
votes
1answer
11 views

Datetime in solidity

how can i get date time in solidity like that: 14/10/2020 20:50. I don't want 8:50 PM. I get in timestamp but timestamp not possible convert because I have wrong timestamp.
4
votes
0answers
18 views

How to call a method after a specific tx in a block

With web3, it is possible to call a method of a smart contract at a specific block : myContract.methods.methodName().call(transactionObject, blockNumber, callback) Is there a way to call it after a ...
0
votes
1answer
11 views

How to encode data for low level call? (Compound/Uniswap governence)

I can't get the transaction to execute no matter how much I play with it. I know that it reverts during the secondary call because I always get this revert message: Timelock::executeTransaction: ...
0
votes
1answer
16 views

Is it bad idea to store my passwords on blockchain with a smart contract?

I want to save my passwords and some other personal data on a ethereum like blockchain. it seems more persistant to me. I may lose my e-mail , my pc may crush and I may lose my usb stick. But nothing ...
0
votes
0answers
10 views

Is it bad idea to store my passwords on blockchain with a smart contract?

I want to save my passwords and some other personal data on a ethereum like blockchain. it seems more persistant to me. I may lose my e-mail , my pc may crush and I may lose my usb stick. But nothing ...
0
votes
0answers
19 views

Require not working properly, always lead to an error

There is a login page and register page in my dapp based on refer and earn concept to authenticate and authorize user respectively..Login part is working fine, but when I try to register a new account ...
0
votes
0answers
12 views

Etherscan “Write” buttons not interacting with Metamask

For some reason, I cannot get any of the "Write" buttons on Etherscan to intereact with my metamask. I made sure to "connect to Web3" before I proceed to click on the "Write&...
0
votes
0answers
11 views

How to collect logs from Uniswap V2: Router 2?

I have a problem with collecting logs from Uniswap router contract. I use json_rpc eth_getlogs When I call the method I receive nothing. What I'm doing wrong? curl -X POST --data '{"jsonrpc":...
0
votes
0answers
6 views

How to detect public address with web3 py on dapp level?

Let's say I deploy a voting app with web3py as the backend. Now an arbitrary user wants to cast a vote. Given that web3py cannot be integrated with metamask, what is the conventional way to detect the ...
1
vote
1answer
14 views

How to transferFrom an external erc20 token with IERC20?

Currently, I try to send Wrapped ETH from my account to a contract address by using IERC20. But it returned an error on Remix. By the way, I could call token.balanceOf(msg.sender) but can't execute ...
0
votes
0answers
8 views

What do you think about Ethereum + Privacy? [closed]

Currently the Ethereum ecosystem is showing the most adoption, by any metric - but it’s still held back by a lack of privacy for users and developers. The DeFi ecosystem on Ethereum is growing at a ...
-3
votes
0answers
19 views

How to make only contract creators can transfer the coin

Please excuse me even if I am not good at English. I'm interested in making ERC20 tokens these days. But I want add a function that only contractor creators can transfer the otheway. Please let me ...
0
votes
1answer
21 views

How to get the type of transaction (Send/Receive/Approve/Swap) and the ERC20 tokens involved in that transaction?

I', getting to know the Ethereum technology (so rookie level). By far, with the free APIs (etherscan.io, ethplorer.io, coingecko) I have been able to build a "watch wallet". It looks like ...
0
votes
0answers
7 views

Can I create an Enum using a function and arguments? [closed]

I'm trying to make a game wherein I have to frequently change game opponents. Thus I need a way to define Enum participants using an external function. contract E { function setNames(string _side1, ...
1
vote
1answer
21 views

Why do almost all of the ERC20 tokens have even number of decimals?

I'm thinking of creating a token with a decimal point of odd number. However I'm kind of worried if there is any issue that can be caused by using an odd number for the decimal point. Is there any ...
0
votes
0answers
17 views

Update Deposit when call function [closed]

I need update deposit when call function like that: struct Deposit { uint256 depositTime; uint256 lastDepositTime; uint256 amount; uint256 validUntil; } ...
0
votes
0answers
19 views

Why the cost of executing the same function in the smart contract slightly decreases every execution time?

I am trying to deploy a simple smart contract application. My target is to build something like a calculator that accepts input values from different addresses. Such addresses are pre-determined by ...
0
votes
0answers
11 views

Pass ADDRESS(string) as argument to contract function using web3.py

I've been stuck on this isseu for more then 24 hrs now. I have the following function in my solidity contract: function getBalance(address _addr) public view returns(uint256){ return userBalance[...
0
votes
0answers
13 views

Web3 in Firefox

I hope you are all well. Do you know how it is possible to inject web3 in firefox with and without Metamask? Thank you Take care Pierre
0
votes
1answer
22 views

How to use derived contracts with the same function name? [closed]

I'm trying to have a single contract that can be use as a single parent, or as multiple derived contract. Problem is both contract are overriding the same "transfer" function. Example: ...
1
vote
1answer
15 views

Infura: certificate has expired error when deploying on Rinkeby

I was trying to deploy some contracts on Rinkeby using Infura, and got the following error: Error: certificate has expired\n at TLSSocket.onConnectSecure (_tls_wrap.js:1088:34)\n at TLSSocket....
0
votes
0answers
27 views

invalid rpc response on ethereum geth

despite thinking this is an solved issue. After 1 years i have faced this issue, never met before. here is the environment; have dockerize aws ethereum instance which makes mining geth node 8545:8545 ...
1
vote
0answers
15 views

About Buidler Evm

1.How can I execute payable functions, like this putting the Value in the Builder console? 2.Can someone tell me the way to be able to change the address on the Buidler evm console? To execute ...
3
votes
1answer
23 views

Do miners undergo a sunken cost of attempting to verify an invalid transaction signature?

In the case of an 'invalid' transaction whereby the state transition of the execution is deemed to conflict in some way and reverts, the transaction itself is actually valid; gas is consumed, tx ...
0
votes
0answers
14 views

How can you see if a project locked their funds? [closed]

Lately owners often say that they locked their tokens, to increase credibility. IIUC this means that they can't sell their tokens until a specific date. Where do you see this and how does it look like ...
0
votes
1answer
25 views

How to handle a Solidity return value/event in JavaScript test? [duplicate]

I'm trying to create a basic ERC721 NFT, using OpenZeppelin contarct. I started with something similar to their example code: //SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; ...
0
votes
0answers
12 views

connecting mobile dapps to mobile wallets using walletconnect [closed]

i hope life is going good bros and sisters. I am new to react native and blockchain . I am making a demo pet shop react native app (to learn mobile wallets integration with react native) ...in pet ...
2
votes
2answers
16 views

Ethereum Wallet - Hangs at startup + 403 ws error

I have installed the Ethereum Wallet, Ethereum-Wallet-win64-0-11-1 (zip file), as described in the book. When I start up Ethereum Wallet (testnet Ropsten, syncmode “light”) the wallet seems to load ...
-1
votes
0answers
20 views

How to get into “eth.signtransaction”? [closed]

I'm not an expert but I really do need step by guide on how or where can I perform this "eth.signTransaction"? The reason I’m asking as I wanted to obtain “DATA” as in (Param) in order for ...
0
votes
0answers
20 views

Is address.call(abi.encodeWithSignature(…)) the best function to call functions of other smart contracts for with least gas fee consumption?

I am quite new to solidity coding. I am trying to find out the best way to call complex functions like swap from 1Inch exchange smart contract from my smart contract which can execute the function by ...
0
votes
0answers
17 views

Why does this function work in truffle tests and fail through metamask?

I have the following function and it has been working perfectly in truffle tests as I was developing the smart contracts and now that I am implementing it in the front end I have been getting a error ...
-1
votes
0answers
12 views

Creating contract instance fails because of missing interface definition in ABI. Am I using the wrong ABI? [closed]

I am trying to interact with a smart contract (the HNY token contract in particular https://blockscout.com/poa/xdai/address/0x71850b7E9Ee3f13Ab46d67167341E4bDc905Eef9/contracts) on the xDai chain. I ...
1
vote
1answer
12 views

How to ensure the authenticity of the block header obtained by the light node

When I join the Ethereum network, I ask for block header data from neighboring nodes. How can I guarantee the reality of data?What if the neighbors conspired to give me bogus data?
0
votes
0answers
16 views

In Ethereum, is it possible for a malicious client to duplicate a coin by double executing a transaction?

Is it possible a scenario in which a malicious client executes two transactions with the same nonce of a specific account and copies and sends coins? Suppose users A, B, and C have the following ...
0
votes
0answers
23 views

Copying ABI Code in Truffle

In Remix, one can directly copy the ABI code from the utility without having to do any manipulation. I was wondering if there is a built-in method in Truffle to do the same. I am aware that this ...
1
vote
0answers
17 views

Best practice for securely verifying Ethereum addresses

What is the best practice for users to securely send a POST to an API with their Ethereum address? My inclination is to have the user sign a message with their private key, send the resulting ...
2
votes
1answer
37 views

geth method eth_getBalance does not exist

I'm unable to run any commands after setting up clef and geth on the Görli chain. geth attach /path/to/clef.ipc Welcome to the Geth JavaScript console! modules: account:1.0 rpc:1.0 > eth....
0
votes
0answers
15 views

VM error (revert) when trying to send value to a contract's fallback function

I'm going through the Solidity docs and in the fallback function section, I'm having some issues running the example provided, specifically in terms of sending value to the receive function of ...
0
votes
1answer
19 views

Perform an automated transaction using 1inch API

To perform an automated 1 inch transaction I use these two functions. It works well at first. Unfortunately, in the last few days I have always had the same errors: Fail with error 'Return amount is ...
0
votes
1answer
23 views

Can I get back tokens that I accidently sent to a contract address?

I just started using metamask today and accidentally sent 500 dollars worth of crypto to the contract address instead of the ETH address (yes I'm a moron). Is there anyway for me to get my crypto back ...
-1
votes
0answers
19 views

Return code error

How can I get require error message from return. function withdraw(uint256 amount) public returns(bool) { address payable addr = msg.sender; uint256 value = collect(addr); ...
0
votes
0answers
12 views

How can I get intellisense to work when writing javascript tests in truffle?

Truffle injects a global web3 instance into your tests and also seems to set up some mocha functions in the global scope (contract, describe and it). When I open the test file for a truffle project in ...
2
votes
1answer
24 views

How to recover an emptied file in Remix

I am using Remix IDE on Chrome browser for developing smart contracts. Today during working on a file when I changed program tab and returned to it again, I found that all of the file contents has ...
-1
votes
0answers
19 views

why TransferFrom is not working in Airdrop [closed]

address[] public dests; uint256[] public values; function multiSend(address _tokenAddr) public returns (uint256) { dests.push(0x5ed22c0B67A1775B64F76eB00A1243FfA259B1A0); dests.push(...
0
votes
1answer
12 views

Conceptual Question: What is the point of making an auction decentralized?

I understand how a blockchain works, I know the pro/cons between a centralized vs decentralized system. My question is specifically tied to auctions (eg: ascending auctions): what advantages would be ...
0
votes
0answers
9 views

How to send a transaction to Besu configured as a Free Gas Network

I have downloaded and configured Besu as a Free Gas Network (https://besu.hyperledger.org/en/stable/HowTo/Configure/FreeGas/ ). Creating transaction using Truffle works fine, but not in my application ...

15 30 50 per page
1
2 3 4 5
610