texts: How would you use a proxy erc20 contract if you cannot preserve msg.sender?

texts:
Let's say I use a proxy contract which allows me to make an ERC20 token transfer from my account.

At the moment the only way to do so is to use tx.origin which gets the original EOA address of the caller but this is not stable and often not implemented in ERC20 contracts.

My question is, how to allow a proxy contract to make ERC20 transfers on behalf of the user even though msg.sender becomes the proxy contract's address? I am aware you could approve an allowance but this requires an extra transaction and I would like to do it in one.


texts: What is the max number of Blocks which can be created in Quorum

texts:
I have nodes running from past few days, with almost 4100+ transactions successfully completed. When i try to interact with the contracts again to add/modify details it shows error

Error when interacted through web3js application

Error when interacting through remix browser

The same transactions made when block number was below 4000 worked absolutely fine. So, i have a doubt is there is any limit on how many blocks can be created in Quorum network.

Can anyone please help me solve this issue.


texts: Are there any restrictions on the length of the value that can be stored as type string in Solidity? I am trying to store a string value in the smart contract member field. The length comes to around 220 chars. If I reduce the string value to around 140 chars I am able to store it. Any more and it does not work.


texts:
Pardon me if this is not the right place.

I am looking for some example/use-case to learn and write first Solidity Smart Contract. Can you recommend some list which I can refer or you tell some interesting one?

I have given myself 2 weeks to finish it up.


texts:
I have created three nodes on a private ethereum blockchain passing a unique networkid flag along with usage of the same genesis file .

Now two of them are running on remote machine , and one on my local system. The issue i am facing is i am able to add the remote nodes as peers when i use the admin.addPeer command on the geth console , but not when i am using bootstrap nodes -

geth --bootnodes enodeRemotePeer1,enodeRemotePeer2 --datadir local --rpc --rpcport 8001 --rpcapi "eth,web3,miner" --rpcaddr "127.0.0.1" --port 8002 console


texts:
I am having trouble testing a very naive transfer method for my coin, based off of the ethereum.org demo coin. I've simplified it down into the essentials, yet my solidity unit test keeps failing. Here's the coin contract:

pragma solidity ^0.4.24;

// A very naive coin for sanity checking
contract Mikancoin {
  uint public totalSupply;
  uint8 public decimals = 3;
  mapping (address => uint) public balanceOf;

  constructor(uint _initialSupply) public {
    totalSupply = _initialSupply * 10 ** uint(decimals);
    balanceOf[msg.sender] = totalSupply;
  }

  function transfer(address _to, uint _tokens) public returns (bool success) {
    // todo: add more checks
    balanceOf[msg.sender] -= _tokens;
    balanceOf[_to] += _tokens;
    return true;
  }

  function balanceOf(address _tokenOwner) public view returns (uint balance) {
    return balanceOf[_tokenOwner];
  }
}

Now I wrote a test of the transfer method:

pragma solidity ^0.4.24;

import "truffle/Assert.sol";
import "truffle/DeployedAddresses.sol";
import "../contracts/Mikancoin.sol";

contract TestMikancoin {
  address fox = 0x284A84baA00626e2773a1138D53923b4acAED2F4;

  function testTransfer() public {
    Mikancoin mikan = Mikancoin(DeployedAddresses.Mikancoin());

    uint startingBalance = mikan.balanceOf(msg.sender);

    Assert.equal(mikan.balanceOf(fox), 0, "Initial fox balance");

    uint tokens = 5;
    Assert.isTrue(mikan.transfer(fox, tokens), "Transfer succeeded");
    Assert.equal(mikan.balanceOf(fox), tokens, "Fox balance after transfer");
    Assert.equal(mikan.balanceOf(msg.sender), startingBalance - tokens, "Sender balance after transfer");
  }
}

I'm running locally against ganache-cli via truffle test. It fails with the following output:

  1 failing

  1) TestMikancoin
         testTransfer:
       Error: Sender balance after transfer (Tested: 99000, Against: 98995)


texts: If i change a existing uint variable in a struct compared to normal ones does it consumes the same amount of gas(cost)?  Im trying to optimize my contracts cost


texts: "VM Exception while processing transaction: invalid opcode" only with Byzantium hardfork

texts:
i'm testing my Smart Contract with Truffle and Ganache, everything works fine while using hadfork version "Petersburg", but when i switch to Byzantium i receive this error while truffle performs deploy:

Compiling your contracts...
===========================
√ Fetching solc version list from solc-bin. Attempt #1
> Compiling .\contracts\Migrations.sol
> Compiling .\contracts\MyContract.sol
√ Fetching solc version list from solc-bin. Attempt #1
> Artifacts written to C:\Users\[...]\AppData\Local\Temp\test-202032-8352-17dkmqb.vs9r
> Compiled successfully using:
   - solc: 0.5.17+commit.d19bba13.Emscripten.clang

Error: Returned error: VM Exception while processing transaction: invalid opcode    at PromiEvent (C:\Users\User-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\promievent.js:9:1)
    at TruffleContract.setCompleted (C:\Users\User-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\execute.js:169:1)
    at Migration._deploy (C:\Users\User-PC\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\migration.js:93:

Truffle and Ganache are both updated to the latest version. i'm using web3 1.2

The Smart Contract is ok, i also did a lot of test and debuging on remix.

Any suggestion?


texts: Creating contract issue. Contract keeps loading

texts:
I'm testing the process of creating an Ethereum contract using the Mist Rinkeby test Network. I used the code from an online tutorial, everything went fine, except at the creation of the contract.

The contract stays on "Creating contract" status for more than 24 hours now where it is supposed to take few minutes.

The transaction says that there are more than 4677 block confirmations but I can't still execute the contract as it is still in "creating" status.

Please see the TX link below:
https://rinkeby.etherscan.io/tx/0x34f2b0cac6803a95a99240f70768f650ffec46d98a95be0455c49ba05bac1b02

Note that I am using Mist 0.9.1 on Mac OS 10.12.6.

Thanks a lot for your help guys!


texts: Web3.js can access coinbase but not use it in transactions

texts:
This question is about web3.js

I'm working on a very simple dapp to test out making a token. There's only two functions in my contract - one to mint coins and one to transfer them.  I'm trying to make a fountain site where people can go get my token

The part that's confusing me is how I'm accessing the visitors account.  This code snippet works - it'll let me grab their coinbase and use it as their default address.

var contractAddress = '0x791E39A210B49811459531A54790377540eFfcde';
var myCoin = eth.contract(contractABI).at(contractAddress);
var wallet = web3.eth.defaultAccount = web3.eth.coinbase;

var transaction = myCoin.mint(wallet, value)

But if I change it to not set the default address, i get an invalid address error.  Below code does NOT work, despite me being able to log web3.eth.coinbase in the console no problem.

var contractAddress = '0x791E39A210B49811459531A54790377540eFfcde';
var myCoin = eth.contract(contractABI).at(contractAddress);
var wallet = web3.eth.coinbase;

var transaction = myCoin.mint(wallet, value)

Can anyone explain this implementation choice in web3.js?  Why is my contract method dependent on defaultAccount in this way?


texts: Control Structures- why is switch and goto not in Solidity?

texts: I was surprised to not see this question here already, and I've either missed the explanation in the docs or it's just not there. It's appreciated. Thanks.


texts: How do I increase the amount of memory geth can use for cache?

texts:
I'm running geth on a system with 96GB of memory, soon to be bumped up to 192GB. I currently start geth with --cache 32768 but I plan to double it when my memory is upgraded. However, I've noticed that when geth starts up I get this message: Sanitizing cache to Go's GC limits       provided=32768 updated=32188
So it seems that there is some limitation the Go is putting in place that prevents me from setting the cache larger than 32118MB. How do I raise this limit?


texts: View contract details in a Django application

texts: I'm trying to create Crowdsale using Ethereum. I've done everything from Token creation, to DAO creation, to Crowdsale creation in Ethereum Wallet. Now, I want my web app (built in Django) to be able to view details in the contract such as how many coins are left, how much is a coin in ETH, what is the goal in a Crowdsale. How will I be able to do this?


texts: Find a Function Call Across All Contract Transactions

texts:
Is it possible to search for a particular function call across all transactions of a smart contract?
I'm doing due diligence on 1inch's smart contract in order to see if renounceOwnership was called and thus no further tokens can be minted using the external mint function.
So far I've been going through the first transactions on Etherscan in the contract manually looking at the Input Data and Logs.


texts:
I have been traying for days to make this work but i cannot really find a solution to this.
I tried several examples i found, included this: https://github.com/SmaCo/Tex/blob/fea52bc7f1cf01a8574ea3df2abcac6770bd8ade/TokenTransferEx.sol

I can transfer the token into the contract and see that are there (the token contract can see them aswell) but the method to withdraw them always fail. I have no idea how to debug this by the way.

For example this is the contract above i deployed and where i sent 5000 of my test tokens: https://ropsten.etherscan.io/address/0x838d49a113ff5ec7cf8deb8565c11716cd1c77fb#tokentxns

Anybody can explain what it may be the problem here?

Im using Metamask and https://remix.ethereum.org to run my test on ROPSTEN network


texts: How to send uint256 and Address types to Smart contract in JavaScript web3/ethers?

texts:
Im trying to send a query to Pancakeswap's router function getAmoutsOut
here the code for importing the contract using ethers ABI:
const router = new ethers.Contract('0x10ED43C718714eb63d5aA57B78B54704E256024E', [
'function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)',
'function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts)'
], account);

As you can already tell the parameters are in uint256 and an array of Address type objects.
how Ami supposed to send valid parameter type to the contract. I've tried a couple of built in ethers utilities functions but so far no luck. I'm 90% sure the error comes from the BNB amount.
Also side note yes ethers works fine with BSC provided you use a BSC node. much like web3.
Anyway here's the code for contract deployment.
desiredCoin = 'coin contract address example';
bnb = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c';
const amountIn = 1000000000000000000 // 1 bnb
const pairAddress = [ethers.utils.getAddress(bnb), ethers.utils.getAddress(desiredCoin)];
amounts = await router.getAmountsOut(
    ethers.utils.getAddress('0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73'), //this is the factory address.
    amountIn,
    pairAddress);
    amountOutMin = amounts.sub(amounts[1].div(slippage) //(Ik that if we were to work with hex this wouldnt be valid :/)
);


texts: Does infura support rinkeby event listening

texts:
Hi I ran a simple voting example connecting to https://rinkeby.infura.io/ since I do not run local Eth node. Everything works fine except event watching.

var event2 = contractInstance.EventTester();
event2.watch(function(error, result){
 if (!error){
 console.log(result);
 }else {console.log(‘ERROR’)}
});

When I submit a transaction I do not see that the event was fired (it is called in the contract function). Am I missing anything ?


texts: "Getting AGE/TIMESTAMP of a Pending Transaction from a Transaction Checker"

texts: Can I get TIMESTAMP of a pending transaction as soon as it's added to etherscan.io recent transactions list? I'm using GETH and WEB3 for a transaction checker and it's fetching me recent pending transactions but I can't get the timestamp out of it. Is there a way to sort this issue out?


texts: If you need a server to store HTML and java script code, then what is the use of the block chain?

texts:
I have been studying block chain for a while, and I came to know that decentralisation of data is its greatest pros. From my understanding, if block chain is massively adopted in the future, we will no longer need servers, since everything will be stored on the block chain.
Currently, we can store solidity smart contracts on the block chain. However, we still need a server to store HTML, CSS, and many other scripts. So, my question is, how is block chain beneficial when we still need a server to run applications  conveniently? Where is the decentralisation here?


texts: Remix IDE: Problem with Executing set method

texts:
I have created a contract and trying to run the contract on the Remix IDE. Following is the code of my contract:
pragma solidity 0.5.9;
contract MyContract{

   uint256  peopleCount;
   struct Person{
       string   _firstName;
       string   _lastName;
   }
   Person[]  public  people;
   function addPerson(string memory _firstName, string memory _lastName) public{

      people.push(Person(_firstName, _lastName));
      peopleCount += 1;
   }
    function  getFirstName() public view returns (string memory) {
       return people[0]._firstName;
   }
   function   getLastName() public view returns (string memory){
       return people[0]._lastName;
   }
      function setFirstName(string memory _val) public {
      people[0]._firstName = _val;
   }

}

I have attached an image when I click the setFirstName(..) tab, I get a trasact button and a box for providing the value of _val argument as shown in the following image:

[vm] from: 0x5B3...eddC4to: MyContract.setFirstName(string) 0x7EF...8CB47value: 0 weidata: 0x639...00000logs: 0hash: 0xf02...883db
transact to MyContract.setFirstName errored: VM error: invalid opcode. invalid opcode The execution might have thrown. Debug the transaction to get more information.
I dont know how to do the debugging, somebody please guide me.
Zulfi.


texts: I am wondering if it is possible to transplant a geth node from one computer by overwriting the .Ethereum folder with a full synced node's .Ethereum folder.


texts: Could Ethereum support decentralized and not-for-profit stock markets, futures markets, etc?

texts:
A lot of the discussion I've heard around crypto seems to fixate on the currency aspect. However, to truly decentralize the global economy, it seems to me like you'd have to also decentralize the engines that make it all tick... the stock exchanges, futures markets, etc.
If this is indeed possible, then Ethereum seems like the most promising blockchain with it's support for smart contracts and distributed applications.
So with that said, is a distributed stock exchange powered by a distributed currency possible? Does this concept even make sense? Specifically...

What sort of entity would run the market? Assuming it's powered by Ethereum smart contracts, could the code be open sourced and maintained by an open organization? Put another way, could the entity that is matching buyers with sellers truly be not-for-profit?
What would the stock that is traded on a market like this actually consist of? Would the stock actually be NFTs?
From an engineering perspective, is there any reason why smart contracts and the blockchain in general would be unfit for powering something like a stock market?


texts: how can someone use the smart contract deployed on Rinkeby network? what are next steps after successful deployment?

texts: I am new to the smart contract and blockchain technology but learning step by step. I developed a small bidding smart contract in solidity. Using Truffle, NPM and Infura, I deployed it in the Rinkeby test network. Deployment is successful. Now I want to test the functionality and want to others to access it so that they can test it too. It is a bidding contract. I want to know if the actual functionality has been incorporated in it. I could not find a way to use the contract on Rinkeby network. Where should the transactions happen to do the bidding? How to direct the transactions to Auction contract? How can I actually involve people to do the bidding? I haven't posted the code as it has no issue. Any inputs would be really appreciated. Thanks in advance.


texts: Find the address of the wallet know almost all the letters

texts:
I want to find ethereum address and I have almost all the letters. The beginning of the wallet: 0xb6b2ceb624a6b667e67af1893b16706baec21
But how can I find remaining letters?


texts: Geth Websocket Behavior during reorganization

texts:
I have a question about the behaviour of Geth during re-org. Particularly, I am connecting to Geth web-socket to receive new blocks when they are discovered. Usually every 10 to 15 seconds I get a block message on the web-socket.

My question is what I will receive during re-org?
Say a re-org of 4 blocks occurred (so the last 3 blocks I received are orphaned now, and there are 4 new blocks to me), will Geth send all the blocks at once (old/new), or it will send what exactly.
I am not able to find any documentation for the above, please provide to link to documentation if you can find any.

Also please help with how to simulate/test reorg with Geth on test net.


texts:
How do I call sendTransaction from within an iPhone app?

I was thinking of running a web to Geth proxy where the iPhone app would call the Api exposed by the proxy which in turn calls my self hosted Geth client. Is that the right way to go? Does such proxy exist in open source?

Thanks in advance!


texts:
Many different PoS approaches have been proposed but I am having a hard time finding documents that explain exactly how their protocols work. So, what are some current implementations of PoS?

Where can I find documentation about how PoS validates blocks?


texts: Why are fees so high, what am I doing wrong

texts:
I'm trying to transfer a small amount of ETH from one account to another. However the fees its sugesting are crazy. This can't be normal.

Firstly it asks for 1 ether, which is $470. Dragging the slider down and it asks for 0.05 ether which is still alot at $23.

Am I missing something? Is it a bug?


texts:
How can I find the current blockchain size?  (Obviously, I mean without downloading and installing a client, downloading the blockchain, and measuring on disk.)

I would also like a way to determine the blockchain size for expanse, ETC, etc.


texts: Is there an ethereum simulator that does things like price swings and congestion?

texts:
Is there an Ethereum network simulator that does things like gas price swings, many other transactions submitted, etc?  I'm aware of running things like geth or ganache but as far as I can tell they don't really have modes that simulate what an actual network can look like.  (Am I wrong?  It'd be great if there were just some flags to either of those that could be used.)
I'm not talking about connecting to something like Ropsten, I'm talking about a private network that can be controlled and manipulated (and probably replayed) for use in tests.


texts: Is there a point to hide Ethereum nodes with TOR?

texts:
From a privacy perspective, is there any point in trying to torify ethereum nodes?

I know there's a script to do that in bitcoin, although doing so may ironically made the bitcoin node more vulnerable to attacks.

Follow up question: has anyone successfully torified their geth node?  I don't think ip addresses are logged in the block chain, so it's probably hard to verify.


texts: What are advantages and disadvantages of low/high difficulty?

texts: What are advantages and disadvantages of low difficulty? What would happen, if it were low? and high! Can you give me some examples and tell me why ethereum developers picked 17,179,869,184 for difficulty?


texts: Creating a Secure android wallet application using web3 js

texts:
I'm new to ethereum and geth. I just want to know that my current architecture or solution to make a new Android wallet in secure way.

Mobile wallet -> sends private keys over https -> REST API(Node js) -> Web3.js -> Geth JSON RPC (locally available).

is it secure way to develop a wallet?
or else please suggest me some ideas.


texts: I have looked through all of the glossaries I know of for genesis/chain spec files but I don't see this one.  Can anyone tell me what "difficultyHardforkTransition" means?


texts: How would ICO smart contracts function under these scenarios?

texts:
Having been inspired by an idealistic desire to attempt a way forward amidst ongoing diplomatic crises, I hired a team to help me create a mega-infrastructure ICO project at Beringia.io - but I suppose that's besides the point. My questions stem from the fact that, in learning how to interact with this smart contract, I've encountered some curiosities:

a) What happens if someone sends ETH to our contract address without ever submitting the purchase details we ask of buyers at Beringia.io – will they still receive BER, or what happens? (the contract address is displayed after the person fills in the information in the screenshot below, and then clicks "buy BER tokens") and b) WHY does this occur?
a) What happens if someone DOES register an account at Beringia.io and submits an order but they wait a long time to actually send ETH to the contact address? Is there any time limitation for completing this process? and b) What if the amount of ETH is different from what they said on our ICO site, they never send the ETH, or the valuation of ETH massively changes in the interim?
And can only the creator of a coin create contracts? I recently learned to create tokens on my own (albeit via Metamask & Token Factory) to help a friend, and sent her 99.99% of the tokens. If she wished to launch an ICO or create a smart contract for some other purpose, would she need access to the original wallet which germinated the smart contact creating the coin, or can any owner create smart contracts with the coin?

Thank you all!


texts: How to listen to events using Web3 v1.0?

texts:
I have a problem when listening for events from my contract.

Code js :

var Web3 = require('web3');
var abi = '...';
var contractAddress = '0x62e7Dd1Af52d5A08D401b1e156cC4CB1d2f89d57';
var eventName = 'Transfer';
//var web3;
var etat;
const web3 = new Web3(new Web3.providers.WebsocketProvider('http://127.0.0.1:8545'));
/*
var MyContract = new web3.eth.Contract(JSON.parse(abi));
var myContractInstance = MyContract.at('0x78e97bcc5b5dd9ed228fed7a4887c0d7287344a9');

// watch for an event with {some: 'args'}
var myEvent = myContractInstance.Transfer({}, {fromBlock: 0, toBlock: 'latest'});
myEvent.watch(function(error, result){
    console.log(result)
});

// would get all past logs again.
var myResults = myEvent.get(function(error, logs){ console.log(logs) });

// would stop and uninstall the filter
myEvent.stopWatching();
*/

var TokenContract = new web3.eth.Contract(JSON.parse(abi),contractAddress);
TokenContract.events.allEvents({ fromBlock: 'latest' }, console.log)
console.log('1********************************************************************************')
console.log(TokenContract);
console.log('2********************************************************************************')
var event = TokenContract.events.Transfer();
console.log(event);
console.log('3********************************************************************************')

TokenContract.once('Transfer', {
}, function(error, event){ console.log(event); });

event.watch(function(error, result){
    if (!error) {
        alert("wait for a while, check for block Synchronization or block creation");
        console.log(result);
        console.log('pas d erreur');
    }else {
        console.log(error);
        console.log('erreur')
    }
});

I have tested a lot of possibilities but the function .watch doesn't run :

TypeError: event.watch is not a function

How do you listen to events using Web3 1.0?


texts: Truffle Console: "undefined" message varaiable declaration

texts:
I am giving following commands at Truffle console but I am getting "undefined" message:

> $ truffle console
>
> You can improve web3's peformance when running  Node.js versions older
> than 10.5.0 by   installing   the (deprecated)  scrypt package in your
> project
>
> truffle(ganache)> let accounts =await web3.eth.getAccounts()
>
> undefined

Truffle version is:

> truffle(ganache)> truffle version
>
> Truffle v5.1.27 (core: 5.1.27)
>
>  Solidity v0.5.16 (solc-js) Node v8.10.0 Web3.js v1.2.1
>
>  truffle(ganache)>

Somebody please guide me.

Zulfi.


texts:
I was following this youtube video in order to install Ethereum client on Ubuntu 15.10

First I installed Go language environment. Then I have build QT following this wiki

After that I tried to download and install Ethereum CLI client with

go get -u github.com/ethereum/go-ethereum/ethereum

But, I get the following error

github.com/ethereum/go-ethereum (download)
package github.com/ethereum/go-ethereum/ethereum: cannot find package "github.com/ethereum/go-ethereum/ethereum" in any of:
    /usr/local/go/src/github.com/ethereum/go-ethereum/ethereum (from $GOROOT)
    /home/cooldudeabhi/work/src/github.com/ethereum/go-ethereum/ethereum (from $GOPATH)

How do I fix this?


texts: Is there a way to see all incomming connections?

texts: I am running geth and net.listening shows true, but admin.peers only show connections to other peers for block synchronization, is there a way to list all incoming connections, which are synchronizing blocks from this local node?


texts: the best way to monitor my own account transactions in openethereum

texts:
Please I want to know if I subscribe to pendingTransactions with web3 will it monitor and send notifications of accounts pending Transactions only or all pending transactions on Ethereum network. my project requires users to create Ethereum address now I need to monitor incoming transaction of each user address to complete their services

var Web3 = require('web3')
var Web3WsProvider = require('web3-providers-ws')

var web3 = new Web3(new Web3WsProvider('ws://localhost:8547'))

web3.eth.subscribe('pendingTransactions', function (error, result) {

    }).on("connected", function (subscriptionId) {
                            console.log('subscriptionId :>> ', subscriptionId);
                        })
                        .on("data", function (transactionHash) {
                            web3.eth.getTransaction(transactionHash)
                                .then(function (transaction) {
                                });

                        })
                        .on("error", console.error);

web3.eth.subscribe('newBlockHeaders', function (error, result) {

            console.error(error);
        })
        .on("connected", function (subscriptionId) {
            console.log('subscriptionId :>> ', subscriptionId);
        }).on("data", (blockHeader) => {
            web3.eth.getBlock(blockHeader.hash, true).then(async (r) => {
                var txs = r.transactions
                console.log('acclist :>> ', acclist);
                txs.forEach(async  (txId) => {

                    console.log('txId :>> ', txId);
                })
            });

        })
        .on("error", console.error);


texts: Contract state does not change after sendTransaction

texts:
I created a very simple contract. Deployment is finished but it does not work as my expectation. Can you help me to fix it?

My expectation is changing "num" value after "add(int)" transaction.

The contract is followings.

Tx

https://ropsten.etherscan.io/tx/0x74426948905cd6e70e8b9d64a660b3c179b7c8a224ca5cd0234842768eb501db

Raw Code

pragma solidity ^0.4.0;
contract Addition {
  int num = 0;
  function add(int a){
    num += a;
  }
  function get() returns(int){
    return num;
  }
}

Although I did sendTransaction with "add(1)" data, the get value does not change.

The sendTransaction is below

Tx

https://ropsten.etherscan.io/tx/0x26db79c7c3c65992f17f4f62d5d191705933e785dff54db6d27e6f3a92d7117e

What I did:

(1) sendRawTransaction (create a contract)

var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider("http://xxxx:xxxx"));

var Tx = require('ethereumjs-tx');
var privateKey = new Buffer('xxxx', 'hex')

var rawTx = {
  nonce: '0x00',
  gasPrice: '0x10D1F',
  gasLimit: '0x10D1F',
  to: '0x692a70d2e424a56d2c6c27aa97d1a86395877b3a',
  data: '606060405260008055341561001357600080fd5b5b60d6806100226000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680636d4ce63c14604757806387db03b714606d575b600080fd5b3415605157600080fd5b6057608d565b6040518082815260200191505060405180910390f35b3415607757600080fd5b608b60048080359060200190919050506097565b005b6000805490505b90565b8060008082825401925050819055505b505600a165627a7a723058207e968ad53b91047ab71334a49530112b3725aaa27d9c6d3860da0bcf09c5c16d0029'
}

var tx = new Tx(rawTx);
tx.sign(privateKey);

var serializedTx = tx.serialize();

console.log('0x' + serializedTx.toString('hex'));

web3.eth.sendRawTransaction(serializedTx.toString('hex'), function(err, hash) {
  if (!err) {
    console.log(hash);
  } else {
    console.log(err);
  }
});

(2) sendRawTransaction (execute add() method)

var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider("http://xxxx:xxxx"));

var Tx = require('ethereumjs-tx');
var privateKey = new Buffer('xxxx', 'hex')

var rawTx = {
  nonce: '0x03',
  gasPrice: '0x53d9',
  gasLimit: '0x53d9',
  to: '0x692a70d2e424a56d2c6c27aa97d1a86395877b3a',
  data: '0x87db03b70000000000000000000000000000000000000000000000000000000000000001' // add(int256) with param 1
}

var tx = new Tx(rawTx);
tx.sign(privateKey);

var serializedTx = tx.serialize();

console.log('0x' + serializedTx.toString('hex')); // 0xf885038253d98253d994692a70d2e424a56d2c6c27aa97d1a86395877b3a80a487db03b700000000000000000000000000000000000000000000000000000000000000011ba0ec6de7c9c1f31dc95014156479925b2ebd933b715f2bb4450f5d74992d7b3423a016f6a7c6e1885412400a622f82ffa033936c06755896096c7638936c065571c1

web3.eth.sendRawTransaction('0x' + serializedTx.toString('hex'), function(err, hash) {
  if (!err) {
    console.log(hash); // 0x26db79c7c3c65992f17f4f62d5d191705933e785dff54db6d27e6f3a92d7117e
  } else {
    console.log(err);
  }
});

(3) call (execute get() method)

var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider("http://xxxx:xxxx"));

var result = web3.eth.call({
    to: "0x692a70d2e424a56d2c6c27aa97d1a86395877b3a",
    data: "0x6d4ce63c" // get()
});

console.log(result); // 0x => I expected 1


texts:
where I can find same articles or materials to understand differences between rpc and ws connection over geth.

From my point of view rpc is part of a websocket connection, so why I have to use ws connection?


texts: Given no performance penalty for maximum tokens creation. Why most tokens are not created max?

texts:
Given the answer to this question here:
Is there a performance penalty towards creating the maximum number of tokens with ERC-20 etc?

Why are most tokens in circulation / used not created to their maximum supply possible?


texts: How to get started after participating in the presale?

texts:
I participated in the Ethereum presale and have my wallet stored safely in my password manager. Then I stepped away from all things ethereum for a couple years. Now I'm ready to get back into it. I have some questions:

Is it possible to use my real ether on the frontier release?
Do I need to convert my wallet in any way for it to work with the frontier release?
Should I move my ether to a safer wallet or anything while mining on frontier?

Thanks and sorry for the very basic questions.


texts:
I am having trouble understanding the scope with delegatecall method. Here are my two contracts:

contract Caller {
     uint public testVar = 88;
     uint public myVariable = 6;

     function delegatecallExample(address _contract, uint newVar) public {
         _contract.delegatecall(bytes4(keccak256("updateMyVariable(uint256)")), newVar);
     }

}

contract CalledContract {
    uint public myVariable = 5;

    function updateMyVariable(uint newVar) public payable {
        myVariable = newVar;
    }

}

After deploying to a fresh remix instance, calling Caller.delegatecallExample with CalledContracts address and lets say 111, I observe that CalledContracts first declared variable (testVar in this case) is changed to 111 instead of myVariable. So what is the scope of delegatecall?


texts: Is it possible to analyze transaction with a smart contract by inputting a transaction ID?

texts:
EDIT: Alright, this is a duplicate:
Can a contract view the details of a transaction, given a transaction id?
Edit2: answer is either to oraclize or do the API call to, for example, etherscan:
https://etherscan.io/apis
Lets say user A sends either a token or Ethereum to a contract address B.
This generates a transaction ID  0x123abc...
What I would like to do next is to have the user input the transaction ID 0x123abc... into a smart contract function, and to get any of the outputs:
-Current transaction status (Fail, Accept, In-Progress,...)
-From address (which is the wallet address A) and To address (which is the contract address B)
-Token amount (or Eth amount) that was transferred
-Token address (if token was transferred)
-Block number if it is a pass
Is it possible to do this?  Any pointer to a document or similar would be great.


texts: How to install Serpent and PyEPM on ubuntu

texts:
I am trying to install Serpent and PyEPM on ubuntu and I am receiving this error message: "Could not initialize package"

The commands I run:

sudo apt-get install Serpent

pip install pyepm

What am I doing wrong.


texts: How can we reduce the transaction time in ethereum?

texts:
I created a single node using geth --dev and tried transacting between two personal accounts using: eth.sendTransaction({from: 'first_acc', to: 'second_acc', value:web3.toWei(1, "ether")})

This however takes a long time. How can I reduce the time required for the transaction?


texts:
I am getting totalSupply of Tokens of a contract using ERC20 totalsupply method.

I am trying to convert hex returned to decimal.

I am receiving:

var totalSupply = "0x00000000000000000000000000000000000000000000006c6b935b8bbd400000";

Then I am doing:

console.log(parseInt(totalSupply, 16))

But I get a scientific number, how can I show regular number? am I converting it correctly?


texts: What's wrong with my code, I am signing a transaction? Invalid v,r,s error?

texts:
func main() {
    privateKey, err := crypto.GenerateKey()
    if err != nil {
        log.Fatal(err)
    }

    auth := bind.NewKeyedTransactor(privateKey)

    balance := new(big.Int)
    balance.SetString("10000000000000000000", 10) // 10 eth in wei

    address := auth.From
    genesisAlloc := map[common.Address]core.GenesisAccount{
        address: {
            Balance: balance,
        },
    }

    blockGasLimit := uint64(4712388)
    client := backends.NewSimulatedBackend(genesisAlloc, blockGasLimit)

    fromAddress := auth.From
    nonce, err := client.PendingNonceAt(context.Background(), fromAddress)
    if err != nil {
        log.Fatal(err)
    }

    value := big.NewInt(1000000000000000000) // in wei (1 eth)
    gasLimit := uint64(21000)                // in units
    gasPrice, err := client.SuggestGasPrice(context.Background())
    if err != nil {
        log.Fatal(err)
    }

    toAddress := common.HexToAddress("0x4592d8f8d7b001e72cb26a73e4fa1806a51ac79d")
    var data []byte
    tx := types.NewTransaction(nonce, toAddress, value, gasLimit, gasPrice, data)
    chainID := big.NewInt(1)
    signedTx, err := types.SignTx(tx, types.NewEIP155Signer(chainID), privateKey)
    if err != nil {
        log.Fatal(err)
    }

    err = client.SendTransaction(context.Background(), signedTx)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("tx sent: %s\n", signedTx.Hash().Hex()) // tx sent: 0xec3ceb05642c61d33fa6c951b54080d1953ac8227be81e7b5e4e2cfed69eeb51

    client.Commit()

    receipt, err := client.TransactionReceipt(context.Background(), signedTx.Hash())
    if err != nil {
        log.Fatal(err)
    }
    if receipt == nil {
        log.Fatal("receipt is nil. Forgot to commit?")
    }

    fmt.Printf("status: %v\n", receipt.Status) // status: 1
}

I am using the above code to send an ethereum Transaction but am not able to send it. It is showing :
panic: invalid transaction: invalid transaction v, r, s val

Any and all help will be appreciated


texts: How do I call the burnFrom() function once my contract is deployed?

texts: I'm using the Openzeppelin library in my contract where MyToken is StandardBurnableToken. Once I deploy that and I want to burn a set amount of the initial supply how do I call the function? I don't see anything in the RPC documents or web3 in read the docs. Do I use my existing wallet and send tokens to a dead wallet?


texts: How to use browser solidity as replacement for the mix-ide?

texts:
As mix will not be developed further and browser-solidity should be a replacement for it, I have tried to use browser-solidity as chrome extension.

Now I have some questions about it.

How do I point to local sol files in my file-system? Is it even possible?
How do I test my frontend files (html/js)?

Both where possible with mix, and if browser-solidity want to replace the mix-ide it should support these use-cases.

Should I open a feature request?


texts: What happens to the ERC-20 tokens that are "migrated" (e.g. to VeChain); do the ERC-20 tokens remain at the original address?

texts: I'm asking for the mechanical explanation of what happens to the ERC-20 token data at the original address; post migration to a new chain.  For example, if I had 100 LivePeer (LPT) ERC-20 tokens at address "x"; had them migrated onto VeChain.  What remains at address "x"?  Do the original ERC-20 tokens disappear?  Or do they stay behind (visible in etherscan) but are basically deprecated/dead?


texts: Issue: Defining constructors as functions

texts:
Why do i ask this? I've been trying to solve this for hours.

Problem version 1:

Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.function TokenERC20(

 */
function TokenERC20(
    uint256 initialSupply,
    string tokenName,
    string tokenSymbol

Version 2

browser/Test.sol:187:6: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.

/* Initializes contract with initial supply tokens to the creator of the contract */
 function MyAdvancedToken(
    uint256 initialSupply,
    string tokenName,
    string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}


texts: Missing Ether from Bitstamp to Jaxx Wallet

texts:
Need some help please. I sent two transactions of ether to my friends ether wallet.

From coinbase .8 eth
From bitstamp 1 ether

The coinbase ether has shown up in his wallet; however, the bitstamp 1 ether has not shown up.

I went to ether scan to check his wallet and find where the missing ether is. It looks like to me it is sitting in the "internal transactions"

I assume this because of the timestamps. I sent the bitstamp transfer first and the coinbase transfer second. They are both two minutes apart.

Here is the link on Ether scan .

Can someone please help and tell me what is going on with the 1 ETH? Will it be credited to my friends wallet? What should I do?

Thanks,
T


texts: Whisper shh_getMessages not receiving posted messages with shh_post

texts:
I am using Whisper shh_post and posting some messages (multicast with no "to") and that seems to be working. I.e.: the response's error count is zero.

And then I have another small console app that I run the shh_getMessages method to get that message I just posted, but that returns no messages, and no errors also.

I don't have any filters in the receiving side and the only parameter I have there is the count: "0x7"

Any ideas?


texts:
I installed a node on the pc with the parameters geth --rpc --rpcaddr localhost --rpcport 8545 and I want to check the account balance:

const Web3 = require('web3')
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
const address = '0xbdfd7125408363bfa36b8e83753b53dd695eef24'
web3.eth.getBalance(address, (err, wei) => {
  console.log(balance = web3.utils.fromWei(wei, 'ether'))
})

but the balance is always 0, although there are funds there, what’s the problem?


texts:
Let's say we have information about WePower contract.

I would like get some information about this contract via API. For eg. this,

https://api.etherscan.io/api?module=contract&action=getabi&address=0x4CF488387F035FF08c371515562CBa712f9015d4&apikey=YourApiKeyToken

But there are no values of parameters -- only it's description(contract ABI ).
Is there are any methods to get it?


texts: How to add numbers in Solidity without getting an error?

texts:
I don't understand why this doesn't return 11.
I hope someone can help me with this.
Thanks in advance!
pragma solidity 0.8.0;

contract a {
    uint256 numberA = 5;
    string operator = "+";
    uint256 numberB = 6;

    function add() external view returns(string memory)
    {
        return(numberA + operator + numberB);
    }
}


texts: How to make payable function to receiveTokens and not ether?

texts: How to make payable function to receive tokens and not ether?


texts: Are events only useful for real-time listening by dapps?

texts:
Why would I need to use events when I can access a contract's variables through the automatic accessor functions?

Please explain the use of and/or need for events.


texts: How to give a non-zero balance to a contract at time of deployment using Remix?

texts:
In case we want to deploy a contract by web3.js we can easily determine the balance of the contract at time of deployment as follows:

const thisContract = new web3.eth.Contract(abi);
thisContract.deploy({
        data: bytecode,
        arguments: [< parameters of the constructor>]
    }).send({
       from: "0x3455D7167A2EE2d660EE85F8e90C6b3B1cCB7163",
       gas: 5000000 ,
       gasPrice: '3000000000',
       value: 5000 // here we determine the balance of the contract
    },
    function(error, transactionHash) {
        console.log(error);
        console.log(transactionHash);
        console.log('function exec');
    }).then(function(newContractInstance) {
    console.log('Contract Instance:' + newContractInstance.options.address);
});

In this example, the balance of the contract is value: 5000.

However, when we want to do this by remix, is there any option to determine the value of the balance of the contract at time of deployment ?


texts: Private network, Geth, receipt not found for transaction 0x

texts:
I started a private network with Geth.
Geth 1.5.9-stable, Windows 10. Here is My genesis.json:

{
    "nonce": "0x0000000000000042",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x0",
    "gasLimit": "0x8000000",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
        "0x0a53521645e1F9380989ce3F55aF0d8A0f902DAb": {
            "balance": "1000000000000000000000000000000"
        }
    }
}

Then I created two different folder for blockhains:

geth --datadir "C:\Ethereum\TestChains\1" init "C:\Users\user1\Desktop\Ethereum\genesis_1.json"

geth --datadir "C:\Ethereum\TestChains\2" init "C:\Users\user1\Desktop\Ethereum\genesis_1.json"

Then I started running two nodes. One of them with --mine key:

geth --maxpendpeers=5 --nodiscover --networkid "15985" --datadir "C:\Ethereum\TestChains\1" --port 30304 --rpcport 18999 console

geth --maxpendpeers=5 --nodiscover --networkid "15985" --datadir "C:\Ethereum\TestChains\2" --port 30305 --ipcdisable --mine --minerthreads=2 --etherbase="0x0a53521645e1F9380989ce3F55aF0d8A0f902DAb" console

And finally I adds peer manualy:

admin.addPeer("enode://ec491fe874bcba129add0fab1b3a3a30109fefb5cb1b8497ed1397a1f6a5de54da2c3097cfde4cfc32f3d3297bfb679c7c13948583fe50f7d31d310affe1e112@127.0.0.1:30305")

Both nodes shows "neighboring nodes" by admin.peers command.
I runs EthereumWallet (Mist) and I see one neighboring peer -

Troubles and qustions:
1)
Transaction not works. I send 1000 eth by EthereumWallet, I see this transaction in Geth , but a few minutes later I see in log

  I0322 12:42:41.765915 internal/ethapi/api.go:1026] receipt not found
  for transaction
  0x7811d28051834923f4e4fefe672dfa3bbebcc9876faf336e317e6ff3652be4f5

2) (already solved below)
Geth witn --mine key constantly doing something. This log-messages is every few seconds raised by Geth - I0321 11:12:13.857226 miner/worker.go:517] commit new work on block 624 with 0 txs & 0 uncles. Took 0s.
He constantly creates new empty blocks (0 txs & 0 uncles). Why? And why He do not creates a block with My transaction?


texts: web3.eth.getTransactionReceipt not sending status for some transaction

texts:
Hi i am new to cryto world.
There is a strange problem
for certain transactions web3.eth.getTransactionReceipt is not sending status
example 0x6cc737fca2da03bb89557857c7558f8ad470587b99e01689efdf0df0a040b080
can someone help please


texts:
When mining in pools, does a user get the mining reward for a block as a function of computational resources even if he did not find the PoW for that block?

My guess is that the rewarding scheme is pool specific.


texts: How do I determine if mining Ether is going to be a viable (profitable) endeavor?

texts:
I'm new to Ethereum and mining. I would like to start mining for Ether and have been following threads and articles on the AMD 290's GPU capabilities and would probably want to lean towards this adapter.

How can I determine if starting to mine (solo) today makes financial sense? What factors do I need to take into account?

edit: for hardware, contemplating an i7 4th/6th gen or xeon 5th gen, probably around $1k range. for gpu i am planning up to 3 290's. as for electricity, it averages around $.13/kwh where i am.


texts: Why isn't there more concern of Ethereum reaching 1TB? Should we be worried?

texts:
I've read previous answers such as that posted by user: eth that highlights some of the EIPs such as 103: Serenity and 105: Sharding. These are more long term solutions but this is an emergent problem as of RIGHT NOW

What I'm unaware of is a theoretical upper bound on the size of the blockchain? There is concern of the blockchain going over 1TB. This is on the borders of storage on consumer laptops and over which would drastically reduce the access of Full nodes to the masses.


texts:
I am not a Core developer, however, I tried to write a code for someone. Everything went fine but I am unable however after that am unable to transfer or get to know where are the tokens which got created. Am I doing something wrong?

here is the code:

pragma solidity ^0.4.11;

contract ReserveToken {

    string public name = "Reserve";      //  token name
    string public symbol = "RST";           //  token symbol
    uint256 public decimals = 6;            //  token digit

    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;

    uint256 public totalSupply = 50000000000000;
    bool public stopped = false;

    uint256 constant valueFounder = 100000000000000000;
    address owner = 0x0;

    modifier isOwner {
        assert(owner == msg.sender);
        _;
    }

    modifier isRunning {
        assert (!stopped);
        _;
    }

    modifier validAddress {
        assert(0x0 != msg.sender);
        _;
    }

    function ExominiumToken(address _addressFounder) {
        owner = msg.sender;
        totalSupply = valueFounder;
        balanceOf[_addressFounder] = valueFounder;
        Transfer(0x0, _addressFounder, valueFounder);
    }

    function transfer(address _to, uint256 _value) isRunning validAddress returns (bool success) {
        require(balanceOf[msg.sender] >= _value);
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        balanceOf[msg.sender] -= _value;
        balanceOf[_to] += _value;
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) isRunning validAddress returns (bool success) {
        require(balanceOf[_from] >= _value);
        require(balanceOf[_to] + _value >= balanceOf[_to]);
        require(allowance[_from][msg.sender] >= _value);
        balanceOf[_to] += _value;
        balanceOf[_from] -= _value;
        allowance[_from][msg.sender] -= _value;
        Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) isRunning validAddress returns (bool success) {
        require(_value == 0 || allowance[msg.sender][_spender] == 0);
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function stop() isOwner {
        stopped = true;
    }

    function start() isOwner {
        stopped = false;
    }

    function setName(string _name) isOwner {
        name = _name;
    }

    function burn(uint256 _value) {
        require(balanceOf[msg.sender] >= _value);
        balanceOf[msg.sender] -= _value;
        balanceOf[0x0] += _value;
        Transfer(msg.sender, 0x0, _value);
    }

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}


texts: How to pass struct data type in constructor?

texts:
let us suppose my contract looks like:

contract Site_contract{

    struct details{

        bytes32[] name;
        bytes32[] location;
        uint256 number;
    }

    site_details private this_site;

    function Site_contract(struct this_site_){

        this_site = this_site_;

    }
}

And i am getting error, doing soo.
Can someone tell me where did i go wrong?


texts:
What's the difference between a Block header H and the header after it has been passed to function L_H?
L_H is defined in Section 4.4.3 Equation 32 and is used in Section 4.4.2 Equation 29(2nd)
Yellow Paper
Thanks a lot!


texts: Is there any JS library can create a new Ethereum address from a password as input parameter?

texts:
In geth console we can create a new address like this:

personal.newAccount("my-password")

I'm looking for a library which can create a new account with my password without any Ethereum node.


texts:
I have a private test blockchain with ganache. I deploy one contract and make a couple transactions. Looking at the ganache UI I realized that the first account haves a ether consume to make the deploy etc.

In a private chain who/where goes the ether reward?? And if one especific account make lots of transaction the while go down. If that account have 0 ether, that account is disabled???


texts: Does every node in the network has to mine the block for each transaction?

texts:
Let's say I have 10 miners node in my network. Once a transaction is initiated, all nodes will be informed about this and then they start mining. 1st node has highest computational power and finished mining the block before other nodes do.
Now, will other nodes continue to mine the same block or they will stop mining after 1 st node has finished mining.


texts: Non deterministic gas usage of the same function

texts:
Environment

Truffle v4.1.8
node 10.0.0
pragma solidity ^0.4.21;

Issue

I'm calling the claimRefund function on my smart contract using metamask. When calling the function with 37081 gas limit at 20 gwei gas price, the transaction spends 36924 gas and gets reverted with EVM Revert.

If I change params to 58080 gas limit at 20 gwei gas price, the transaction passes spending 24721 gas.

The code is shown below:

   /**
   * @param investor Investor address
   */
  function refund(address investor) public {
    require(state == State.Refunding);
    uint256 depositedValue = deposited[investor];
    deposited[investor] = 0;
    investor.transfer(depositedValue);
    emit Refunded(investor, depositedValue);
  }
  }

  function claimRefund() public {
    require(isFinalized);
    require(!goalReached());

    vault.refund(msg.sender);
  }

Question

How is it possible that the same call results in a different gas spent amount? Also, how can a function fail after spending more gas and pass after spending less gas?


texts: nodejs/web3j error: could not decrypt key with given passphrase

texts:
I want to invoke a send transaction from my nodejs code using web3js api. But I'm getting error at unlock step: could not decrypt key with given passphrase.
I added default account assignment after looking at some other posts. But still the same error.
Any clue?

web3.eth.defaultAccount = web3.eth.coinbase;;
web3.personal.unlockAccount (fromAddress, passphrase, 15000, function(err, result) {

    if (err) {
        console.log('DAO unlock error: ' +err);
        return next(err, null);
    }

    web3.eth.sendTransaction(fromAddress, toAddress, passphrase, sendAmount, function (err, result) {
        if (err) return next(err, null);

        return next(null, result);
    });

});


texts: How can I bridge public and private blockchains or smart contracts?

texts:
I want to create an ERC20 based token for an upcoming ICO and bridge this somehow with our private blockchain.  Creating the token was easy enough and I can do this part.  The team plan to get the ERC20 token listed at some point in the future with an ERC20 compatiable exchange.

What I am trying to understand is how our platform should interact with those ERC20 tokens and token holders.  Do we just give users a public ethereum wallet address on our platform and deposit the ERC20 tokens here, if a users spends them on our platform do we just move those ERC20 tokens to our own platforms public ethereum address and create the equivalent on our own private blockchain, is there an automated way to bridge this.

At some point we would like to take these ERC20 tokens from the public and have them converted to the equivalent coin on the private Ethereum consortium blockchain or the other way around when users are leaving our platform they should be able to withdraw their equivalent balance on our platform in these ERC20 tokens.

I am looking some resources and guidance on possible best practices to bridge the two chains or smart contracts on different chains.


texts: Creating a Bitcoin brain-wallet using an Ethereum contract

texts: I would like to create a Bitcoin brain-wallet generator using an Ethereum contract that takes as input a given password, and gives as output a deterministic Bitcoin private and public key corresponding to the given password. I assume the deriving of the addresses themselves from the password could be done purely by hashfunctions (SHA-256 and RIPEMD160). The motivation is of course to have an "indestructible" and trustless brain-wallet such that the generator can never be lost, and one would know for sure that it does not store any generated keys. Is this possible, and how do I ensure that the function input is not exposed to the network and/or "man in the middle attacks"? thanks.


texts: Solidity browser compiler function gas cost vs actual transaction cost

texts:
When executing a function through the browser compiler, the compiler shows the gas costs, for example:

Transaction cost: 30754 gas.
Execution cost: 9290 gas.

Are these costs actually identical to the transaction costs on the homestead blockchain (assuming the transaction only executes the given function)?
Is it safe to assume that if a certain function is optimized there, it will also be optimized on the live blockchain and vice versa?


texts: How to connect to Ethereum Mainnet from a Mobile App?

texts:
I have tested with various private Ethereum chains and test ones using Web3 and RPC calls to a node from React. I am working on connecting to the mainnet for Ethereum with the same principle.

If I have a mobile app, should I connect to a light node on the phone or a service such as infura to main security for connecting to the public Ethereum network?

Any comments are welcome.


texts: I'm trying to call a function from deployed contract, i get the following error

texts:
Gas estimation failed
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Invalid JSON RPC response:

Contract source code

trying to call mint function.


texts: What does a position means in an ethereum Tx?

texts: There are 2 fields in the following Ethereum Tx, named nonce & {position}. What does position mean?


texts:
I'd like to set lots of arguments in solidity functions. I wonder how many arguments contracts can handle.
Does it depend on number of arguments or data size?


texts: Unable to call token contract function from another contract

texts:
I am having a ERC20 token contract and another test contract which will trigger transfer function on token contract. I am getting a transaction receipt but transfer is not happening in the token contract. This my code

import "./ERC20Token.sol";
Contract Test {
  function Test() {
  }

  function triggerTransfer(address tokenAddress, address to, uint value) {
      ERC20Token tok = ERC20Token(tokenAddress);
      tok.transfer(to, value);
  }

}


texts:
E.g. a function that just returns huge struct data. Is there any limit in data so that calling this function will not be possible?
pragma solidity ^0.4.13;

contract Project
{
    struct Person {
        address addr;
        uint funds;
    }

    Person[] people;

    function getPeople(uint[] indexes)
        public
        view
        returns (address[], uint[])
    {
        address[] memory addrs = new address[](indexes.length);
        uint[]    memory funds = new uint[](indexes.length);

        for (uint i = 0; i < indexes.length; i++) {
            Person storage person = people[indexes[i]];
            addrs[i] = person.addr;
            funds[i] = person.funds;
        }

        return (addrs, funds);
    }
}

code sorce
If I stored 1000000000000... Person, can I return them with getPeople()?
Edit: Changed function to view, avoiding confusions.


texts: List of Smart Contract Addresses for all recently created Tokens

texts:
Is there a way to Get a list of Smart Contract Addresses for all recently created ERC-20 Tokens?
Recently means for the last 24 hours (for example) or for/in the last block.
Thanks in advance!


texts: web3.eth.syncing returns undefined||false for multiple minutes even syncing is done on the background

texts:
How to view latest block number of a geth node in the console:
Answer follows:

> var sync = web3.eth.syncing;
undefined
> console.log(sync);
[object Object]
undefined
> sync
{
  currentBlock: 1486592,
  highestBlock: 1488447,
  startingBlock: 1486592
}

Please note that I am working on a private blockchain. There are few nodes and network is fragile.

My goal is to get the highestBlockNumber right away no matter what from my local node. But this function sync = web3.eth.syncing does return false on many cases and I may need to wait few minutes to get a valid information. And when it does return a valid block number, it has already head of the time.

    while [ $startBlockNum == $undefined ]
    do
        startBlockNum=$(echo "$header; mylib.highestBlock()"   | sudo nodejs);
        echo $startBlockNum;
    done

    exports.highestBlock = function() {
       var sync = web3.eth.syncing;
       console.log( sync.highestBlock );
       return sync.highestBlock;
    };

For example. When I called: sync = web3.eth.syncing highestBlock should be 100 but it returns false. I have check sync value inside a loop until it returns a valid information, and when it does it returns 2 minutes more later and returned blockNumber=108 (which highest block# already updated, and actually 8 blocks ahead).

[Q] What may be the reason web3.eth.syncing returns undefined or false for multiple minutes even sync is done on the background?

Is there any way to prevent this from happening? If sync = web3.eth.syncing returns undefined could I trust the value returned by eth.blockNumber?


texts:
var filter = web3.eth.filter({fromBlock: 350000, toBlock: 'latest',address:"0x075da4ebae466b80d451b0627296d5d38b3e99c1"});

var myResults1 = filter.watch(function (error, log) {

   console.log(error);
   console.log(log);
 });

filter.get(function(error, result){ console.log(error, result); });

The above code always shows empty result. What is the problem?

If I change like this it returns nothing:

var filter = web3.eth.filter({fromBlock: 350000, toBlock: 'latest'});
filter.get(function(error, result){ console.log(error, result); });

I need to get the transactions details by the account if there another option please give that idea.


texts:
I'm a PHP developer and I'm new to Ethereum.

Looking different documentation and different Solidity contracts, I can not find a single example of how money can be managed on a contract (apart from kill()).

For example I need to create a contract where:

User send money to my contract
Money will be used for goods so asap should be converted into USD Dollars and send to a personal account.

Does it makes sense or is it completely wrong and should I look at something different from the contracts?


texts: Support in Ethereum for PoWs algos other than Ethash

texts:
I read that Ethereum uses Ethash as proof of work algorithm. But since there are other PoWs like NeoScrypt (used by Phoenixcoin), scryptJane (used by LEOcoin).

Is it possible to use the above mentioned algorithms as PoWs.(Obviously it could be done but the gist of the question is how much effort (changes in source code) is required to do so). Does changes in only file replacing the algorithm will do or would it be herculean task.


texts:
I sent several times some transactions via a consortium established on ethereum (https://energyweb.org/), but none of are mined or confirmed (it is cheched from here : https://tobalaba.etherscan.com/). What might be the reason ?

When I check transaction hash by web3.eth.getTransactionReceipt(transaction hash), it retuns zero. I tried several times to deploy a contact in this way, however I did not get transaction hash.

Consensus mechanism is proof of authority.


texts: how to parse the Ethereum Blockchain and save the output to a file? geth console isn't node, right?

texts:
I'm trying to parse the Blockchain and extract to a txt file part of the transactions and Addresses to a specific contract (theDAO) for later analysis.
I'd like to save the output to a file (.txt) in order to reuse it later.

2 Methods

Hi, I've succeded in parsing the Ethereum Blockchain with Web3.js
both using simply the geth console

$ cd /path/to/file
$ geth --exec 'loadScript("myEthereumBlockchainParses.js")' attach

as well as connecting it to a Node.js instance with rpc

$ geth --rpc

$ node myEthereumBlockchainParses.js

Problems

I'm having 2 different problems:

if I use the geth console method I can't use the Node filesystem "fs" module to write to a text file

  err: Cannot find module 'fs'

if I use the Node.js method, I can save to a localfile, but the script is very slow and it freezes my computer after just a 1000 blocks approx (even if I minify the code and simplify it - bare in mind it's the same parsing code that works fine in the geth console

the first method, in the geth console, is way faster.

Questions

is there a faster/better way to do what I'm trying to do (parse and extract to filesystem part of the blockchain)?
is there a way to use node modules and that syntax in the geth console (which is faster than --rpc)?
is there a way to make the --rpc faster?
Initially I thought of saving to a simple.txt file but maybe is it better to store that amount of info in a db like MongoDB?

SOLUTION

after the excellent answers by @BoppyKooBah
here is some code https://github.com/lyricalpolymath/Ethereum_DaoExtraBalanceOwners/blob/master/extraBalanceRunScript


texts:
I'm trying to create an asset in a smart contract using MetaMask and web3.js:

contract AssetTracker {
    struct Asset {
        string name;
        string description;
        string manufacturer;
        uint price;
        uint id;
        address owner;
        bool initialized;
    }
    Asset[] public assets;
    mapping(address => mapping(uint => bool)) public walletStore;

    function createAsset(string _name, string _description, string _manufacture, uint _price, uint id) public {
        Asset memory newAsset = Asset(_name, _description, _manufacture, _price, id, msg.sender, true);
        assets.push(newAsset);
        walletStore[msg.sender][id] = true;
    }
}

I retrieve created assets and render all of them as a table:

const assets = await Promise.all(
    Array(parseInt(assetCount))
        .fill()
        .map((element, index) => {
            return tracker.methods.assets(index).call();
        })
    );

renderRows() {
    return this.props.assets.map((asset, index) => {
        return (
            <AssetRow
                key={index}
                id={index}
                asset={asset}
           />
        );
    });
}

The problem is that addresses are not shown properly. They are like 0x0000000000000000000000000000000000000001 or 0x0000000000000000000000000000000000000007.

The account which creates an asset will become as an owner of that asset. So, in the createAsset function I have msg.sender as the owner and I guess that caused the problem according to this link. However, solutions in the link were not useful for my case. Can somebody help me to solve the problem? To show addresses properly as they are in MetaMask.


texts: Is ethereumwallet.com generating the keys client-side?

texts:
Is ethereumwallet.com generating the all the keys, accounts and transactions client-side? Is it legit and safe to use?

Is it possible to confirm the javascript has no backdoors? Can it be trusted?


texts: Migration 2_deploycontract invalid or does not take any parameters

texts:
I am trying to create this token and for some reason, the second migration keeps giving me this
Migration 2_deploycontracts.js invalid or does not take in any parameters

1_initial_migrations.js seems to be working, I just don't know why the second one isn't.
So this is what I have got:
Migrations.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

contract Migrations {
  address public owner = msg.sender;
  uint public last_completed_migration;

  modifier restricted() {
    require(
      msg.sender == owner,
      "This function is restricted to the contract's owner"
    );
    _;
  }

  function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
  }
}

Rxctoken.sol
pragma solidity ^0.6.12;
// SPDX-License-Identifier: MIT

contract Rxctoken {

    uint256 public totalSupply;

    constructor () public {
        totalSupply = 1000000;
    }
}

1_initial_migration.js
const Migrations = artifacts.require("./Migrations.sol");

module.exports = function (deployer) {
  deployer.deploy(Migrations);
};

2_deploycontract.js
const Rxctoken = artifacts.require("./Rxctoken.sol");

module.exports = function (deployer) {
    deployer.deploy(Rxctoken);
};

Truffle version v5.1.66
I need help.


texts:
I created a contract which mints tokens when the msg.value is higher or equal to the token(ticket) price.
Unfortunately when I send a transaction to the contract fallback it gets reverted.
It's my fallback:

function() public payable {
    require(now < ticketExpiryDateTimestamp, "This sale has been completed");
    require(emitedTickets < maxTicketsSupply, "Sold out");
    uint _ticketsAmount = msg.value / ticketPrice;
    require(_ticketsAmount < maxTicketsSupply, "You can't buy more tickets than the emitted number");
    require(_ticketsAmount > 0, "You did not pay enough to buy any ticket");
    transfer(msg.sender, msg.value - _ticketsAmount * ticketPrice);
    mint(msg.sender, _ticketsAmount);
    emitedTickets += _ticketsAmount;
}

Thanks in advance


texts:
I'm trying to do a simple coin flip using WolframAlpha and Oraclize, this is my smart contract

pragma solidity ^0.4.18;
import './usingOraclize.sol';

contract CoinFlipOracle is usingOraclize {

  string public result;
  bytes32 public oraclizeID;

  event Log(string text);

  function CoinFlipOracle() {
    Log("Contract created");
  }

  function flipCoin() payable {
    Log("Oraclize query was sent, waiting for response");
    oraclizeID = oraclize_query("WolframAlpha", "flip a coin", 5000000);
  }

  function __callback(bytes32 _oraclizeID, string _result) {
    require(msg.sender == oraclize_cbAddress());
    Log(_result);
    result = _result;
  }

  function getResult() view returns(string) {
    return result;
  }
}

On my frontend, I deploy contract, then I call flipCoin(), and finally I call getResult()

async flipCoin() {
  let contractInstance = await CoinFlipContract.at(this.state.contractAddress);
  await contractInstance.flipCoin();
  let result = await contractInstance.getResult();
  console.log(result);
}

I'm trying to return either "heads" or "tails", but all it returns is the txhash plus some other info. Am I using Oraclize correctly?


texts: Geth light node contract call() Error: 'can't fetch trie key'

texts:
I am running geth --syncmode "light"

When I attempt to communicate with a smart contract already deployed on the mainnet I do the following in the geth console:

>var Contract = eth.contract(abi)
>var myContract = Contract.at(address)

However, when I try to execute a function I get the following:

>myContrant.func.call(3,5)
Error: can't fetch trie key b3658ad28c17c69b3cd0fc2dfebbc66b9223d1c01ec56751ea9dd000cd79b061: no suitable peers available
    at web3.js:3143:20
    at web3.js:6347:15
    at web3.js:5081:36
    at web3.js:4102:22
    at <anonymous>:1:1

Also:

>myContract.func.sendTransaction(3, 5, {from: eth.accounts[1]})
Error: no suitable peers available
    at web3.js:3143:20
    at web3.js:6347:15
    at web3.js:5081:36
    at web3.js:4137:16
    at <anonymous>:1:1

Is this a problem of the lightnode and its communication with the peers?

How can this problem be solved?


texts: Suppose I'm mining a block, and I still don't find the nonce. Suddenly I receive the mined block from another node. But when I try to validate it, I find it's not right. So I discard it. What happens next? I use the same transactions I start mining before, and I continue mining looking for nonces greater than the last I tried? Or, instead, I start all the process again?


texts: HTTP query create request error for oraclize

texts:
I have tried to deploy a sample contract having oraclizer query using truffle+ethereum bridge+solidity.  First ethereum bridge made up and got OAR address which is used in sample contract in constructor
OAR = OraclizeAddrResolverI(0xCea1D31BdDDF90EdfDac30ca18665117Eefa011f);

Now whenever a function is called (update)in sample contract log is showing in the bridge terminal as shown in the image.. The query made to oraclizer through ethereum bridge is not successful. What could be the reason?


texts: What is the problem in sellToken function? Transaction reverts whenever i call that function

texts:
This is my solidity
// SPDX-License-Identifier: none
pragma solidity ^0.8.0;

interface ERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 amount);
    event Approval(address indexed owner, address indexed spender, uint256 amount);
}

contract BuyAndSell {

    address public owner = msg.sender;
    address private contractAddr = address(this);
    // address payable private comissionAddr = payable(0x2cA90f6BE87cd46E9cF68Eb6DFD94825fa257956);
    uint buyPrice = 15;

    function buyToken(address _tokenAddress,address payable comissionAddr) public payable returns (bool success) {
        ERC20 token = ERC20(_tokenAddress);
        uint tokens = msg.value * buyPrice;
        require(token.balanceOf(contractAddr) >= tokens);
        uint comission = tokens * 5 / 100;
        token.transfer(comissionAddr, comission);
        tokens  = tokens - comission;
        token.transfer(msg.sender, tokens);
        return true;
    }

    function sellToken(address _tokenAddress, uint tokenAmount) public returns (bool success) {
        ERC20 token = ERC20(_tokenAddress);
        require(token.balanceOf(msg.sender) >= tokenAmount);
        uint allowance = token.allowance(msg.sender, contractAddr);
        require(allowance >= tokenAmount);
        token.transferFrom(msg.sender, contractAddr, tokenAmount);
        return true;
    }

    function withdrawERC20Token(address _tokenAddress, address _to, uint _amount) public returns (bool success) {
        require(owner == msg.sender);
        return ERC20(_tokenAddress).transfer(_to, _amount);

    }

    function withdrawETH(address payable _to, uint _amount) public returns (bool) {
        require(owner == msg.sender);
        _to.transfer(_amount);
        return true;
    }

    receive() external payable{}
}


texts: How to create a smartcontract for bounties on github?

texts:
To be able to directly set bounties for issues without middle-person that takes a margin with complete transparency and a high-degree of trust, I was wondering about the following: how one can write a smart-contract that automatically pays out to an ethereum address that is commented* in a github pull request for the following scenario:

A single Ethereum address is posted by the github account that submits the pull request.
A particular set of- (or all) tests in a CI (e.g. Travis-CI) result is used by a distributed oracle to determine when to pay-out.
The pull request and accompanying tests are passed before a certain date and time.
Otherwise no bounty is rewarded.

Which leads me to ask: how can one write a smart contract that pays out x Eth if a github pull request satisfies a predefined set of CI tests before a certain date and time?


texts: I'm mining Ethereum, but what am I doing?

texts:
I'm just stumbling for learning and hobby in some Ethereum mining and went on a site that explained me what to do.
And it looks I'm really mining in 20 minutes it was setup, but I have no idea how much I have done or where I can see this.

I have a Private key from Geth but that doesn't look like a wallet key I can use.
I have a Ethereum wallet for Ethereum's, I have bought for some time ago, they don't look alike.
I like to put my successful mined coins(cents) to be transferred to my wallet new or owned JAXX wallet.

I'm using what the website told me. Geth and Ethminer my OS is windows 10 and my cpu is AMD 1600X, gpu Gigabyte 1080 GTX.


texts: How do I "Buy" tokens on the Rinkeby (test) environment?

texts:
This is a noob question I presume. I just started with the Ethereum Wallet. No previous bitcoin experience. I have 0 ether.
Can I start "playing" with the test environment ("Rinkeby" network as I understand). Do I need to buy ether for that?


texts: How does Ethereum's Makerdao Dai stablecoin differ from EOS's Equilibrium EOSDT stable coin?

texts: What are the main differences from Ethereum's makerdao dai stablecoin to EOS's equilibrium EOSDT stablecoin? And are there other stablecoins like these two that are decentralized and issued via a smart contract?


texts: Computing matrix determinant in Solidity

texts:
I am trying to write a solidity contract to compute Matrix determinant.
I am following the C++ implementation from here:
https://www.tutorialspoint.com/cplusplus-program-to-compute-determinant-of-a-matrix

The following code works fine up to a square matrix of size 5. But when the size increases it fails to compute.
I have also increased the gas limit in Remix and tried to run but still, it fails.
(Also tried to run using Web3 provider - Ganache with an increased gas limit, but ganache crashed/failed to run.)
I am looking to implement it for Matrix sizes 12 to 15.

Any help is highly appreciated. Thanks.

I have attached my code below:

contract Determinant {
  uint [5][5] public matA = [[1,1,2,1,2],[3,0,0,5,4],[2,1,4,3,1],[1,0,5,0,7],[4,2,5,4,3]];
  uint public matrix_order;
  int256 public output = 0;
  uint [5] public temp_output;

function compute () public {
    matrix_order = matA.length;
    output = determinantOfMatrix(matA, matrix_order);
}

function determinantOfMatrix (uint[5][5] memory mat1, uint _order) private returns (int256) {
    uint [5][5] memory submatrix;
    int256 det = 0;
    uint256 sign = 1;
    int256 result;

    if (_order == 2)
        return int256((mat1[0][0] * mat1[1][1]) - (mat1[1][0] * mat1[0][1]));
    else {
        for (uint x = 0; x < _order; x++){
            uint subi = 0;
            for (uint i = 1; i< _order; i++){
                uint subj = 0;
                for(uint j = 0; j<_order; j++){
                    if (j != x){
                        submatrix[subi][subj] = mat1[i][j];
                        subj++;
                    }
                }
                subi++;
            }
            result = int256((-sign) ** x);
            temp_output[x] = mat1[0][x] * uint(determinantOfMatrix (submatrix, _order - 1 ));
            det = det + result * int256(temp_output[x]);
        }
        return det;
    }
}

}


texts: Does variables inside Event gets stored in blockchain?

texts:
Hey I have following event
event Submitted(bytes32 indexed docHash);

The event is called by a function
function submitHash(bytes32 docHash) public onlyOwner() {
        Submitted(docHash);
    }

It looks like docHash gets saved in the blockchain even though only the event is called. I have another code as
bytes32 docHash;
function submitHash(bytes32  docHash) public onlyOwner() {
        docHash = docHash;
    }

What I want is to store docHash in the blockchain so that there is a proof that docHash with the timestamp is present.
Will storing with event cost more? And is it possible to search for docHash as it has indexed in it?
Which would be better option?


texts: Can security tokens (ST-20) and utility tokens (ERC-20) exists on same blockchain?

texts:
I am trying to build a dApp in which the functionalities of the dApp can be accessed by utility token but in the same app I wish to tokenize the securities as well. Can my utility tokens and the tokens which I am creating for secuties exists on the same blockchain?

Thanks in advance.


texts: What is an ABI and why is it needed to interact with contracts?

texts: ABI is referenced in many places including the official Ethereum website. What is an ABI and why is it necessary to use?


texts: How much storage space does a fully synced node need?

texts: I'm planning on launching a virtual machine for Ethereum development, but I have no idea how much storage space to allocate to it. Can anyone tell me how much storage space a fully synced node uses?


texts:
I can not find what the problem is, someone can help me

Contract

pragma solidity ^0.5.9;

contract certificarProceso {

    address public creador;
    address emisor;
    string informacion;
    string informacionHashArchivo;

    function escribirInformacion(string memory informacion1, string memory informacionHashArchivo1) public {
        informacion = informacion1;
        informacionHashArchivo = informacionHashArchivo1;
    }

    function getInformacion() public view returns (string memory) {
        return informacion;
    }

    function getInformacionArchivoHash() public view returns (string memory) {
        return informacionHashArchivo;
    }
}

Error

> personal.unlockAccount(eth.accounts[0])
Unlock account 0x2fef34e4d5a83a7bd78b2b09eb3619046eb1eaa1
Passphrase:
true
> var abi= [{"constant":false,"inputs":[{"name":"informacion1","type":"string"},{"name":"informacionHashArchivo1","type":"string"}],"name":"escribirInformacion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"creador","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInformacion","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInformacionArchivoHash","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]
undefined
>
> var address ="0x93ba4ede5903c6656060c443255ed4ef569a5144"
undefined
> var contract=eth.contract(abi).at(address)
undefined
> contract.getInformacion()
Error: new BigNumber() not a base 16 number:
    at L (bignumber.js:3:2876)
    at bignumber.js:3:8435
    at a (bignumber.js:3:389)
    at web3.js:1110:23
    at web3.js:1634:20
    at web3.js:826:16
    at map (<native code>)
    at web3.js:825:12
    at web3.js:4080:18

>


texts: How to add my token to external exchange

texts:
I am planning to launch one ICO and before that I am checking how to list my coin in external exchange?
If anybody knows please help here
What are the mandatory things I have to consider


texts: Trouble with Mist wallet 0.8.7 and 0.8.8

texts:
When I tried to run my Ethereum Mist wallet yesterday I ran into two problems:

1.) When starting up version 0.8.7 I got a popup that said:

*"Couldn't connect to node? See the logs for more:*

*Node type: geth*

*Network: main*

*Platform: win32 (Architecure x64)*

*...flag provided but not defined: -support-dao-fork"*

And an error on the main screen saying:

*"Ethereum node connection error :'(*

*Checking network..."*

This problem wasn't there two days ago.

2.) So I tried installing 0.8.8 but I'm not sure what to do.

Is it enough to simply copy ethereum wallet.exe from the 'win-unpacked' folder and delete the rest of the files or do these files serve a new/update function as well? Last couple of releases were simply .exe files that I installed, after which I simply deleted the prior ethereum-wallet.exe file.

Don't want two versions running next to eachother and a computer with Ethereum files all over the place. With the basic .exe files that were offered before you didn't have to choose a location for installation or anything. So there's nothing in the 'program files' folder, only in the 'local' and 'roaming' folders under 'app data'.

Thanks in advance.


texts: Is there a way to save the deployed contract address into a variable. Something related to a constructor that save the deployed address into the variable?


texts:
I am trying to understand what expansion cost is.
We can see that there's this formula to count the memory cost -

Now, It's also said that this formula doesn't include the expansion cost.
Can anyone in simple terms explain what expansion cost means ?


texts: JSON-RPC commands not working: Unexpected identifier

texts:
I have Geth running locally, and for whatever reason the JSON-RPC api is not working. Web3.js is working fine.

I've tried to start the console several ways:

geth --rpc --rpcapi "eth,net,admin,web3" --verbosity 0 --unlock 0 console

I've also included the port and other combinations, such as starting RPC from within the console using admin.startRPC(addr,host).

Each time I make an RPC call, for example:

curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'

I get a variation of the following output:

(anonymous): Line 1:9 Unexpected identifier (and 1 more errors)

I've also tried RPC calls omitting -X POST or specifying rpcaddr:rpchost at the end.

I don't have any other connections, or other geth-attached windows.


texts:
I am using web3 with MetaMask. When injecting web3 I get the following warning:
MetaMask: We will stop injecting web3 in Q4 2020.
Please see this article for more information: https://medium.com/metamask/no-longer-injecting-web3-js-4a899ad6e59e

Is there a possibility to hide those warnings?


texts: How can I create a Dashboard for my Ethereum ICO investors to track their Tokens

texts:
We're launching an Initial Coin Offering (ICO) and I would like to create a user dashboard for investors to track their tokens and the progress of the crowdsale.

How can I do this? I'm a web developer with PHP skills and looking to build this dashboard on the back of the token website.

Is there a way to do this in Wordpress, Magento?


texts: What is the purpose of `internalType` now generated by the Solidity compiler in ABIs?

texts:
Newer Solidity 0.5.x compilers generate ABIs whose function and event parameters contain an internalType field as well as the usual type.

In the examples I've seen, type and internalType usually have the same value. But presumably that would not always be the case.

What is the meaning and purpose of this internalType field? When would it differ from the just-plain type field?

Thanks!


texts: What's the difference between node and peer?

texts:
I'm confused between the two objects.

As I know, peer is the object or node.

But when we create an Ethereum network, at each node, I have to add a peer.

So it means there is a difference between node and peer.

Please help me. Thanks.


texts: MakerDAO MKR Withdrawal. Continuous Approval Voting

texts:
When I want to vote on some proposals, I need to lock some MKR tokens. Does it mean that I withdraw my MKR tokens, then the result of voting may change even after it has finished?
Does Continuous Approval Voting mean endless voting?


texts:
In Ethereum Wallet (TEST-NET) on macOS, under the Develop menu there is an item "Start mining (Testnet only)".

After clicking on it, how do I know anything is happening? There is no visual feedback? Nothing changes in the UI, and the menu item does not switch to "stop mining ...".

I'm not sure if it's bad a design or a bug, I have no idea if it works.


texts: How to automatically identify which value is stored in specific location of transaction input , given a smart contract source code and ABI?

texts:
For example, a function's name and parameters are given as following:

function batchTransfer(address[] _receivers, uint256 _value) public returns (bool);

Then I want to get a python dictionary whose key is the first location of the value in transaction input, and value is the corresponding value, for example:

p {};

p["0"] = 0x34672534; // the function signature

p["4"] = 'offset'; // the offset of '_receivers' value

p["36"] = '_value';

p["4+offset"] = '_receivers.length'; // the length of '_receivers'

p["4+offset+1*32"] = '_receivers[1]'

p["4+offset+2*32"] = '_receivers[2]'

Note: since when reaching this stage, only contract source codes and ABI were given, and there are no concrete inputs, namely, I should derive this dictionary by statically analyzing source codes or ABI, so the location can be expressed by expressions as shown above.

So, is there any way to implement such a parser to get this map?

Or is there already an existing one?


texts: MEW says not a valid erc20 token but don't see errors

texts:
I created a token prior to this one that is fine. I used the same template, followed the same exact steps to create another token but getting the not valid erc20 error.

https://ropsten.etherscan.io/address/0x43e04ca6a9ce3556bfeb4a7e34da9828a65d073d#code

Any help would be greatly appreciated. Thanks!

UPDATE: Checking the same on MyCrypto.com it shows I have 3,000,000 HDM in the Ropsten network, but 0 in the Ethereum mainnet. Shouldn't that be the same?


texts: How can I call the permanent ENS registrar contract directly from sbt-ethereum?

texts:
I would like to register a name (e.g. 'somename' >= 7 characters) with the new ENS contract using sbt-ethereum and the .eth registrar controller, for one year.

I have confirmed that the code in the .eth ens-registrar-controller contract contains the correct code, and that the contract went live May 4th.

I am able to interact with the contract, for example to confirm that the owner is the ENS-Multisig
ethTransactionView ens-registrar-controller owner

The plan is to:

Make sure the somename is valid: ethTransactionView ens-registrar-controller valid somename

That somename is available: ethTransactionView ens-registrar-controller available somename
Calculate myrent in wei for one year worth of seconds (365*24*60*60): ethTransactionView ens-registrar-controller rentPrice somename 31536000
Generate and save mysecret 32 random bytes by stripping the whitespace and adding 0x. e.g. 0x92ad4989c7906ab2b2830e534e434179f6dfdb67012187741be3520ea1a204c5
Compute the secretmessage using the conveniently built in nested keccak256 function: ethTransactionView ens-registrar-controller makeCommitment somename default-sender mysecret
Send the secretmessage with ethTransactionInvoke ens-registrar-controller commit secretmessage
Wait >1min then register, noting that this transaction is payable in the quantity myrent, which I will tack on the end in wei: ethTransactionInvoke ens-registrar-controller register somename default-sender 31536000 mysecret myrent wei

However, calling these of the functions results in a common error, which for Step 1 is:

$NonthrowableFailureException: Failed: No matching function 'valid' for args 'somename' in ABI

Having the common error makes me suspicious I'm doing something basic wrong. Any ideas? I suspect that once I can do Step 1, Steps 2-7 will be doable.

I note that the contract code contains the controller code as a subset. Perhaps I'm not understanding how to call a function within a deployed contract that has multiple contract sections. For example the owner function I was able to call is within a contract Ownable section, separate from contract ETHRegistrarController is Ownable which contains the functions I am interested in.


texts: Who is msg.sender in contract 2 when one contract transfers ETH to contract 2 (causing some of contract 2's code to execute)?

texts:
Suppose there are 2 smart contracts and one human:

The human calls a function of Contract 1.
During processing the human's call, Contract 1 transfers some ETH to Contract 2.
Some of Contract 2's code gets executed because of receiving the ETH from Contract 1.

During (3) when Contract 2's code is executed who will msg.sender be?
My guess is that it will be Contract 1's address, but if someone can provide some reference that confirms this that would be much appreciated please .
This question relates to this one but I would like to confirm whether or not there is a difference in the resulting msg.sender between calling a function of Contract 2 and the transfer of ETH triggering Contract 2's code.


texts: Gnosis multisig wallet, Error in call method

texts:
This is an external function which will be called when a transaction have enough number of confirmations.

    function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {
        bool result;
        assembly {
            let x := mload(0x40)   // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
            let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
            result := call(
                sub(gas, 34710),   // 34710 is the value that solidity is currently emitting
                                   // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
                                   // callNewAccountGas (25000, in case the destination address does not exist and needs creating)
                destination,
                value,
                d,
                dataLength,        // Size of the input (in bytes) - this is what fixes the padding problem
                x,
                0                  // Output is ignored, therefore the output size is zero
            )
        }
        return result;
    }

this statement is giving me error

sub(gas, 34710),
Expected '(' but got ','
result := call(sub(gas, 34710), // 34710 is the value that solidity is currently emitting


texts: I want to forward any received ethereum, to another different ethereum address

texts:
For instance, i received 0.09 eth in address A
I want to automatically send it to address B in mini seconds.
Somebody help
How can i achieve this please?
I need the lines of codes for this.
Thank you


texts:
Do we have some open source tools where we can get call graphs for solidity smart contracts execution ? For ex: Suppose Function A in contract C calls some other function B so the graph should contain an edge from A-> B with the parameters that passed from A to B.
Also is there a way to get access  the exact parameter values that are passed between function calls during smart contract execution in a remix browser or truffle ?


texts: Get emitted events of a a smart contract function using infura

texts:
I have used infura in my App.js to connect to the kovan network. Then I am creating an instance of the smart contract deployed on that network. Then I am calling a function on that smart contract which emits an event.

This returns a transaction hash but I want to access the event details emitted by that smart contract function. I thought I might use that transaction hash on kovan etherscan site and get the event details emitted but it didnot work. How do I access them?

I have sent a signed transaction through infura:

    const Tx = require('ethereumjs-tx').Transaction

    // connect to Infura node
    const web3 = new Web3(new Web3.providers.HttpProvider("//kovan infura key"));

    // the address that will send the test transaction
    const addressFrom = '//myaccountaddress'
    const privKey = '//my key'

    // the destination address
    const addressTo = '//contractaddress'

    function sendSigned(txData,cb) {
      const privateKey = new Buffer.from("privateKey", 'hex')
      const transaction = new Tx(txData)
      transaction.sign(privateKey)
      const serializedTx = transaction.serialize().toString('hex')
      web3.eth.sendSignedTransaction('0x' + serializedTx,cb)
    }

    const contract = new web3.eth.Contract(Contract.abi,Contract.address, {from: addressFrom,gasLimit: 3000000});
    const contractFunction = contract.methods.getDetails(0);

    const functionAbi = contractFunction.encodeABI();

    // get the number of transactions sent so far so we can create a fresh nonce
    web3.eth.getTransactionCount(addressFrom).then(txCount => {

      // construct the transaction data
      const txData = {
        nonce: web3.utils.toHex(txCount),
        gasLimit: web3.utils.toHex(25000),
        gasPrice: web3.utils.toHex(10e12), // 10 Gwei
        to: addressTo,
        from: addressFrom,
        data: functionAbi
      }

      // fire away!
       sendSigned(txData, function(err, result) {
      if (err) return console.log('error', err)
      console.log('sent', result)
    })


texts: Contract deploys fine on Kovan, fails on Main Net. Gas too low or what?

texts:
I'm deploying a contract using its bytecode in wallet.ethereum.org.
I deployed it on Kovan and it went very smooth and fast, fee was 1782250 gas @ 4 Gwei price.

With the exact same bytecode, I tried deploying on Main Net with higher gas than recommended by wallet.ethereum.org, my last try was with a limit of 1982250 Gas @ 4 Gwei price.

But still, processing takes a long long time and ultimately fails.

What could be going wrong?

Edit: Also tried using Remix with the contract code itself (not bytecode) and same thing happens, deploys ok on Kovan, fails on Main Net. The contract is a standard BurnableToken from OpenZeppelin.


texts: Is it cheaper to delete or ignore obsolete mappings?

texts:
I have a timeout on a contract that locks down an account for a certain amount of time.

If transactions happen frequently, and lockouts happen infrequently, would it be cheaper to attempt delete obsolete lockouts every transaction, or just leave them in there.

for example - freeing mem whenever we realize lockout is passed

function transfer(...) {
    require(timeout[msg.sender] < now);  // Is this cheaper if less items in timeout mapping?
    ...
    delete timeout[msg.sender];  // Will this cost ETH if no timeout exists?
}


texts: How do we design identity management systems in Ethereum?

texts:
I’ve read Ethereum will make possible cryptographically verifiable identities that are integrated with the Ethereum client, and thus not requiring any password or logins.

Does this presuppose the the user is using the Mist browser? Are there any proposed design patterns we make apps for the regular web that leverage some of the cryptographic niceties that Ethereum offer (mappings, for instance).


texts: How to call ecrecover() in pure assembly?

texts:
If I do remember correctly, it’s a contract built‑in in the Ethereum Virtual machine, isn’t it?

if yes, what’s the address to call for it?


texts: Pancake/Uniswap: tell inside contract if a transfer is a buy or sell

texts:
I have a token contract that will exclusively use Pancakeswap as trading platform.
How can I tell in the contract if a transfer represents someone buying the token or someone selling it?


texts: "execution reverted" Error when deploying Safemoon fork on Rinkeby

texts:
I keep getting this error message when trying to deploy a Safemoon fork. There's no other information provided.
Code is here
https://bscscan.com/address/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3#code

I'm using remix with metamask
I also tried to deploy this on BSC test net and got the same error message


texts: Can the total supply of a token on Ethereum be increase?

texts:
I've noticed on coinmarketcap some ethereum tokens have a "max supply" value while others don't and from what I understand, correct me if I'm wrong, Tether is an ethereum token they're able to increase their total supply.

So my question, are companies able to increase their token supply whenever they want or is it a fixed number set at the ICO?