texts: Pointing to other contracts in solidity?

texts:
I'm doing the CryptoZombies tutorial to get a better handle on solidity and in one of the chapters it contains the following code

pragma solidity ^0.4.19;

import "./zombiefactory.sol";

contract KittyInterface {
  function getKitty(uint256 _id) external view returns (
    bool isGestating,
    bool isReady,
    uint256 cooldownIndex,
    uint256 nextActionAt,
    uint256 siringWithId,
    uint256 birthTime,
    uint256 matronId,
    uint256 sireId,
    uint256 generation,
    uint256 genes
  );
}

contract ZombieFeeding is ZombieFactory {

  address ckAddress = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;
  KittyInterface kittyContract = KittyInterface(ckAddress);

  function feedAndMultiply(uint _zombieId, uint _targetDna) public {
    require(msg.sender == zombieToOwner[_zombieId]);
    Zombie storage myZombie = zombies[_zombieId];
    _targetDna = _targetDna % dnaModulus;
    uint newDna = (myZombie.dna + _targetDna) / 2;
    _createZombie("NoName", newDna);
  }

  function feedOnKitty(uint _zombieId, uint _kittyId) public {
    uint kittyDna;
    (,,,,,,,,,kittyDna) = kittyContract.getKitty(_kittyId);
    feedAndMultiply(_zombieId, kittyDna);
  }

}

My question is in the KittyInterface kittyContract = KittyInterface(ckAddress) line.

In the local contract ZombieFeeding, there is no reference to KittyInterface, nor is there any context given on why the contract address is passed as a parameter to the contract.

I'm assuming that the address being passing into the contract is allowed because solidity uses this interface to point to some external contract, but it gives no explicit reason why I can reference KittyInterface in my ZombieFeeding contract.

My guess here is that KittyInterface is treated as a global variable, but again, I'm not sure.


texts: How to set constructor parameters before deploying in remix?

texts: I don’t understand how it works. I created a contract with a constructor with parameters. But I don’t understand where to pass these parameters to the constructor. Or I need to set params after deploying? Please, explain me


texts: How to handle events for testnet and mainnet?

texts: I know how to handle events using personalised blockchain using ganache, can anyone tell me how to handle events in Kovan,rinkeby testnets?


texts: Reliable way of listening to events on frontend

texts:
I make a web application, that needs the events from my contract to initialize it's state. I was using infura websocket provider, but it seems to lag a lot and close the connections unexpectedly during the last week. getPastEvents method does not work well.

I would like for my application to be accessible from smartphones (at least for read only mode). So I cannot rely only on the node or wallet running on same computer.

Is there a way to get all the events from some contract in a reliable way? For example, how does etherdelta achieve this? They run a server, with it's own private node, that generates static data every block?


texts:
When implementing ERC721, why it is necessary to use ERC165 standard?
pragma solidity ^0.6.6;

interface ERC165 {
    function supportsInterface(bytes4 interfaceID)
       external view returns (bool);
}


texts: When forking MainNet with ganache-cli and trying to interact with contract -> error thrown

texts:
Forked MainNet with Ganache-ClI
wrote script to interact with on-chain DAI contract to send some Dai to account
Unlocked the DAI contract
const Web3 = require('web3');
const daiAbi = require('/Users/GreyShadow/inbox/ganache-cli.Fork/daiABI.js');

const recipientAddress = "0x1418D9353E655d277009E08aD882442B6e23F07D";
const unlockedAddress = "0xd4405F0704621DBe9d4dEA60E128E0C3b26bddbD";
const daiAdress = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
const web3 = new Web3(`http://localhost:8545`);
const dai = new web3.eth.Contract(
  daiAbi,
  daiAdress
);

async function run() {
  let unlockedBalance, recipientBalance;
  ([unlockedBalance, recipientBalance] = await Promise.all
    ([
      dai.methods
        .balanceOf(unlockedAddress)
        .call (),
      dai.methods
        .balanceOf(recipientAddress)
        .call()
    ]));
    console.log('Balance unlocked: ${unlockedBalance}');
    console.log('Balance recipient: ${recipientBalance}');

    await dai.methods
      .transfer(recipientAddress, 1000)
      .send({from: unlockedAddress});

      ([unlockedBalance, recipientBalance] = await Promise.all ([
        dai.methods
          .balanceOf(unlockedAddress)
          .call()
      ]));
      console.log('Balance unlcoked: ${unlockedBalance}');
      console.log('Balance recipient: ${recipientBalance}');
}
run ();

when running node script.js following error is shown
/Users/GreyShadow/node_modules/web3-eth-contract/lib/index.js:61
        throw errors.ContractMissingABIError();
        ^

Error: You must provide the json interface of the contract when instantiating a contract object.

ABI is in that directory and should be required/recognized.
Any help would be much appreciated
P.S


texts: wallet.ethereum.org default tx fee is 1.05 ETH

texts:
This is the default tx fee set on wallet.ethereum.org, and the lowest I can drag the slider (why is this a slider? why can't I input the amount?) is 0.05 ETH which is currently around $40.

What's going on here?


texts:
I have this smart contract:

pragma solidity 0.5;
pragma experimental ABIEncoderV2;
contract TestStruct {

      struct User {
        string name;
        uint256 age;
     }

    mapping (bytes32 => User) users;

    function addUsers (User [] memory _users) public {

        for (uint i = 0; i < _users.length; i++) {

           bytes32 hash = keccak256(abi.encode(_users[i].name));
           users[hash] = _users[i];

        }
    }

    function getUser (string memory username) public view returns (User memory) {

        bytes32 hash = keccak256(abi.encode(username));

        return users[hash];
    }
}

I want to test it using remix IDE,
But I didn't find the write way to pass the array of struct in remix UI

I try this

And I got this error:

transact to TestStruct.addUsers errored: Error encoding arguments: SyntaxError: JSON.parse: expected property name or '}' at line 1 column 4 of the JSON data


texts: Transfer ERC-20 token from Token Contract to My Custom Contract

texts:
I know transferring ERC-20 token from my wallet to a custom contract. The smart contract has to call transferFrom() to enable withdraw.

ERC20 token = ERC20(_tokenAddress);
token.transferFrom(msg.sender, this, _amount);

But I need to first call approve function on the token contract to approve this contract to withraw funds on my behalf. I want to know is there any way to call the token.approve() method from this contract itself?


texts: Question about updating Ethereum Wallet 0.5.2 to latest version: Will this affect my ETH balance and DAO wallet address

texts:
I need to update my ethereum wallet from 0.5.2 to the latest version (OSX), because I wish to withdraw my DAO tokens that are attached to an address in the wallet.

The wallet contains ETH that were obtained prior to the fork.

Will the current ETH balance be affected by updating the wallet?

If I send that ETH (pre-fork) to an exchange like Poloniex, will they be recognized as ETH or ETC?

Will the address remain the same after updating the wallet?

thank you!


texts:
I am mining Ethereum, was using Mist wallet. Just purchased Ledger Nano S.
Is it possible to transfer Ether without paying transaction fee?

Is it possible to mine directly into Ledger Nano S? (Completely remove Mist)

Please give me some tips how to handle transactions properly and efficiently.


texts: What is wrong with this hand-made raw transaction?

texts:
Here are two RLP-encodings of two signings of the same transaction --- for Goerli.  Notice how the "Signed by" address is different.  This must be implying something is wrong with my signing procedure?  The private key with which I'm signing is 6e08[...]28d8.  The address relative to this private key is 3e21c651dfc21ee198bc2f735502eb82a2e8c4f0, so I was expecting to see "Signed by: 0x3e21c651dfc21ee198bc2f735502eb82a2e8c4f0".
%helpeth parseTx 0xf86d018612309ce5400082a4109479e4e5c6309eab8df0299973ef29ce2b001704a5880de0b6b3a7640000802ea02db2dc28cf1c6d049d773bd78c5fad9cca19e4e4e191e9ec80f5765c1a5739b8a0747602789e0b20eeca045e49260fc7382d937125178ea2e4a712326b7c0b8eb8
Signed by: 0xd07b876c0b06b6fea8de3df326518abc5a862c45
Nonce: 0x01
To: 0x79e4e5c6309eab8df0299973ef29ce2b001704a5
Value: 1000000000000000000 (1 ETH)
Data: 0x
Gas limit: 42000
Gas price: 20000000000000 (20000 Gwei)
Potential total transaction cost: 0.84 ETH
Minimum required account balance: 1.84 ETH

%helpeth parseTx 0xf86d018612309ce5400082a4109479e4e5c6309eab8df0299973ef29ce2b001704a5880de0b6b3a7640000802ea033f0f6603ce617e2bc67048c63ac7ee407b82517fb490e694030d43893c26b12a0725bb38fc835acc70290164eba994bfc144ef9151a7de5ea57880576f7895a65
Signed by: 0xe31621a692881e27467be5b22e3b15720fe1aa55
Nonce: 0x01
To: 0x79e4e5c6309eab8df0299973ef29ce2b001704a5
Value: 1000000000000000000 (1 ETH)
Data: 0x
Gas limit: 42000
Gas price: 20000000000000 (20000 Gwei)
Potential total transaction cost: 0.84 ETH
Minimum required account balance: 1.84 ETH
%


texts: Etherbase/coinbase managment from javascript or JSON-RPC-API

texts: Is there a way to set coinbase/etherbase from javascript using web3 or anything else? And how it is set in the first place?


texts:
I would like to ask how to correctly send ERC20 Token from a wallet to another wallet , followings are my codes :

public static void main(String[] args) throws Exception {
    Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/
    Web3ClientVersion web3ClientVersion = web3.web3ClientVersion().send();
    String clientVersion = web3ClientVersion.getWeb3ClientVersion();
    Credentials creds = WalletUtils.loadCredentials("password",
            "path/to/wallet");
    EthGetBalance ethGetBalance = web3.ethGetBalance(creds.getAddress(), DefaultBlockParameterName.LATEST)
            .sendAsync().get();

    BigInteger wei = ethGetBalance.getBalance();

    FixedSupplyToken_sol_FixedSupplyToken contract = FixedSupplyToken_sol_FixedSupplyToken
            .load("0x<CONTRACT_ADDRESS>", web3, creds, gasPrice, gasLimit);

    BigInteger tokenAmount = contract.balanceOf(creds.getAddress()).send();

    contract.transfer("0x<TO_ADDRESS>", new BigInteger("10000")).send();
}

When I tried to run this code, its working,the transaction is being submitted to my private network, but it return these errors.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" org.web3j.protocol.exceptions.TransactionException: Error processing request: unknown transaction
    at org.web3j.tx.response.TransactionReceiptProcessor.sendTransactionReceiptRequest(TransactionReceiptProcessor.java:32)
    at org.web3j.tx.response.PollingTransactionReceiptProcessor.getTransactionReceipt(PollingTransactionReceiptProcessor.java:37)
    at org.web3j.tx.response.PollingTransactionReceiptProcessor.waitForTransactionReceipt(PollingTransactionReceiptProcessor.java:29)
    at org.web3j.tx.TransactionManager.processResponse(TransactionManager.java:72)
    at org.web3j.tx.TransactionManager.executeTransaction(TransactionManager.java:51)
    at org.web3j.tx.ManagedTransaction.send(ManagedTransaction.java:70)
    at org.web3j.tx.Contract.executeTransaction(Contract.java:223)
    at org.web3j.tx.Contract.executeTransaction(Contract.java:207)
    at org.web3j.tx.Contract.executeTransaction(Contract.java:201)
    at org.web3j.tx.Contract.lambda$executeRemoteCallTransaction$3(Contract.java:240)
    at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:30)
    at com.gio.myapp.App.main(App.java:50)

Is there anything that I missed here ?


texts:
I'm using truffle with ganache GUI.
It worked fine at first, but now I am unable to start it. (I made it executable)

When I run ./ganache.AppImage
I get this message:

installed: X-AppImage-BuildId=b74a6d80-fbda-11a7-0d5d-97de34ed8487 image: X-AppImage-BuildId=b74a6d80-fbda-11a7-0d5d-97de34ed8487

then nothing happens.

PS: i can start ganache-cli with no problem


texts:
I know that the command to download Truffle is 'npm install -g truffle'. When I enter this command using the command prompt, which website does it download the packages from? Does it download from GitHub?

This is because, in my organisation, we get access to websites on demand basis. So I am not able to download Truffle using command prompt as the website is not whitelisted.

Also, is there any method to install Truffle without using command prompt?


texts: How to specify gas/value when making a call using abstract contracts?

texts:
How does one specify gas or value making a call this way:

contract AbstractB {
    function getX() returns(uint);
}

contract A {
    function makeCall(address addressB){
         AbstractB(addressB).getX();
    }
}

The following doesn't work(Error: Member "gas" not found...):

AbstractB(addressB).gas(0).getX();


texts:
Even though it might be a bit soon for use in production, but all I find about setting up a private blockchain seems to be for testing.

But the fact we have a genesis.json should mean that anyone has the freedom to make their own ethereum blockchain.

The only thing that is not clear, is how the chain will connect to others. As I understand it will look in the local network first, but how can I limit the first node from connection to just any node?

I understand that only nodes with the same genesis block will join in, but I would want at least some initial control over how it propagates.


texts: What is storage_location in terms of SSTORE?

texts:
I notice the gas table states:

((value != 0) && (storage_location == 0)) ? 20000 : 5000

for SSTORE. What does it mean by storage_location?


texts: Type error: function transfer(address recipient, uint256 amount) public override returns (bool) does not override anything

texts:
My smart contract defines an interface for transfer for an ERC20 token. Here is the definition of the transfer in ERC20 token contract:
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/token/ERC20/ERC20.sol"
contract ERC20Token is ERC20 {
     ...
    function transfer(address recipient, uint256 amount) public override returns (bool) {
            require(mustBeDude(msg.sender), "msg.sender must be on chain");
            require(mustBeDude(recipient), "Recipient must be on chain");
            super.transfer(recipient, amount);
        }
    ...
   }

The interface is defined as below:
interface ERC20Token {
    function transfer(address recipient, uint256 amount) public override returns (bool); //<<== cause error below
}

The definition of interface did not change anything. So what could cause the error?


texts:
How to add an authentication header for ChainLink API requests?
For example, this guide on connecting ChainLink to Twitter API to post a tweet doesn't implement anything of the sort, so how would it post the tweet?
Thank you.


texts: Why don't Ethereum increase the block gas limit? In my understand, it can increase total throughput(transactions per second), but also increase uncle block rates either. But i couldn't find any exact materials but only some comments. How does it increase the uncle block rate and why is it problem?


texts: How to backup POA based ethereum private blockchain and restore it in a fresh new environment

texts: Is there a way to backup the POA based ethereum private block-chain [created from microsoft azure POA template] and also restore it in a all new environment with out loosing any transactions & accounts?


texts: call to smart contract function from express project using web3

texts:
I'm trying to create a API fo my smart contract functions like following:

router.get('/',function (req,res) {
    var web3 = new Web3(new Web3.providers.HttpProvider('https://ropsten.infura.io/key'));
    var DataPassContract = web3.eth.contract(abi);
    var dataPass = DataPassContract.at('contract address');

    dataPass.add('myaddress','a','a','a',{
        from: 'other address'
    }, (err, result) => {
        if (err) throw err;
        if (result) {
                res.send('yes');
            }
    });
});

When executed i want this function to open Mtamask and ask the client to confirm the transaction but when calling it I get this error:

if (err) throw err;
                 ^

Error: Invalid JSON RPC response: ""

Any help would be appreciated.


texts: Allowing the contract owner to recover tokens

texts:
Say the contract owner sends some tokens to address A. Is there a way for the contract owner to later recover those tokens without involving A? What functions would be involved?

advise appreciated


texts: Are the functions in this code missing the payable modifier?

texts: These functions are transferring ether between balances, so why aren't they modified with payable?


texts: How can I transfer etherbase status to another account within mist?

texts: After importing a wallet from JAXX to Mist, I wish to have the JAXX account having Etherbase status, instead of the default Geth one. However, I see no visual indications on how to do this within Mist.. Can anyone offer an explanation?


texts: As the computation on Ethereum is expansive, I want do some matrix calculation off-chain. However, it is confused that how to transmit data between Ethereum and other software (like MATLAB)?. Is there any convenient solution?


texts:
Recently we ran into an issue where all the nodes of our ethereum consortium network are crashed at once, as all are in same data center.

In this crash, we lost the cached data of geth and so as a result we lost many blocks.

How can we write the geth cache data on to the disk?
I see that starting geth with gcmode archive is one option, but it takes huge amount of disk space.

Do we have any other mechanism to make geth write the data on to the disk.


texts: Gas estimation failed - remix (HELP ME PLEASE)

texts:
I'm having this error, and I can't solve it, could someone help me?

Gas estimation failed
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }


texts: Mist dont run when i run geth from command prompt IN MAC

texts:
I want to start rinkeby locally on network .......

When I run geth from command line, it uses datadir folder. While geth is running on I also want to start mist, but it give me error datadir is used by another process.

How I can run both simultaneously

Thanks in Advanced


texts: Provable/Oraclalize: How to get msg.sender in __callback

texts:
How do I get the msg.sender of the user who called randomNumber() in the __callback?

pragma solidity ^0.5.11;

import "github.com/provable-things/ethereum-api/provableAPI_0.4.25.sol";

contract ExampleContract is usingProvable {
 function __callback(bytes32 myid, string result) {
  if (msg.sender != provable_cbAddress()) revert();
  // how do i get the address of the user who called "randomNumber"?
 }

 function randomNumber() public {
  provable_query("WolframAlpha", "random number between 0 and 100");
 }
}

documentation: https://docs.provable.xyz/#ethereum-quick-start


texts:
I'm still learning Solidity and contract development. I have never used EtherDelta. I know it can be used for trading different tokens, but I would like to understand the following two things:

How can new tokens be added ?

Can all ERC20 standard tokens be traded using EtherDelta?


texts: function in smart contract to allow owner to burn all the tokens

texts:
I have tried this:

function burn(uint256 tokens) public returns(bool){
    require(balances[msg.sender] >= tokens);
    balances[msg.sender] = balances[msg.sender].sub(tokens);
    _totalSupply = _totalSupply.sub(tokens);
    Burn(msg.sender, tokens);
}

but this code will only burn the tokens by the address owner. I want the contract owner to be able to burn all the tokens and making totalSupply to be 0.


texts: How can I create a crowdsale for tokens already held in my wallet?

texts:
For example, I had an initial crowdsale with a specific end date. The end date passed and then the unsold tokens were forwarded to my wallet address.

How can a new crowdsale contract be created for these tokens? Is it possible for some kind of contract to be deployed where I send these tokens to it and it progresses with the crowdsale contract as the owner of the tokens who sells them (as my initial crowdsale contract does)?

Thanks in advance, I appreciate any help.


texts: send Ethereum to smart contact with web3.js [metamask]

texts:
this function :

  web3.eth.sendTransaction({from:myaddress,to:toaddress, value:web3.toWei(1, "ether")}, function(err, transactionHash) {
  if (!err)
    console.log(transactionHash);
  });

completely work for send ETH from ethereum-acount-address to ethereum-acount-address BUT when i set an
smartcontract address for toaddress meta mask return

Transaction Error. Exception thrown in contract code.

my solidity contract is

pragma solidity ^0.4.17;

contract mysmartContract{

        function whitdrawETH() payable public {

        }

        function getContactEthBalance() constant returns(uint) {

        return this.balance;
        }

    }


texts: Transfer eth coins from my desktop wallet to my coinbase exchange account

texts:
I started investing in ethereum using coinbase. I have a wallet which has some coins in it, and I want to move those to my coinbase account. So I tried to send them by getting the address that coinbase provides me, but apparently its not a valid address. I'm unsure whether this is even possible (as in only exchange user accounts can do this sort of transactions)

Anyone ever had a similar issue? Am I missing something?

PS: I know the address is not valid because when clicking on Send it highlights the field in red. The app gave me an address like 0x23uadhauetc and I removed the 0x part.

EDIT: Oddly enough, whether I remove the 0x or not its not valid - the address is not even copied fully


texts: Invalid JSON RPC response when calling a function

texts:
I've made a web3js script in a wordpress website, but when executing the following code, I get an invalid JSON RPC response.

var Web3 = require("web3");
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("https://ropsten.infura.io/xxxxxxxxxxx"));
var accounts = web3.eth.accounts;
var abi=[{"constant":false,"inputs":[{"name":"document","type":"string"},{"name":"timestamp","type":"uint256"}],"name":"notarize2","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"document","type":"string"}],"name":"checkDocument","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"proof","type":"bytes32"},{"name":"timestamp","type":"uint256"}],"name":"storeProof","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"source","type":"string"}],"name":"stringToBytes32","outputs":[{"name":"result","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"proof","type":"bytes32"}],"name":"hasProof","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}];
web3.eth.defaultAccount="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var poe = web3.eth.contract(abi).at("YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY");
console.log(poe.address);
result="test";
var today = new Date();
var todayI = today.getFullYear()*10000+ (today.getMonth()+1)*100+today.getDate();
console.log(todayI);
poe.notarize2(result,todayI,{gas:2000000});

The setup works perfect through testrpc (localhost) and through Remix / Metamask I could verify that the contract is correctly deployed on Ropsten and is working fine.

Any ideas? this is the first time I'm trying this.


texts: Solidity. Check if key has value in mapping. Operator != not compatible with types struct

texts:
I am new to solidity. I have a Person struct and mapping:

 struct Person{
        uint age;
        string gender;
    }

 Person[] players; // holds the 24 players

 mapping (string => Person) selectedPair;

I have to chose a boy and a girl.

function choosePair() public {
        // save the chosen person in selectedPair if its the correct gender
        for (uint i=0; i<players.length; i++) {
            Person storage chosenOne = players[pseudoRandom(0,23)];
            if(selectedPair[chosenOne.gender] != 0){ //error!
                // I want to know if there is a "girl" already in the selectedPair mapping.
            }
        }

I get the error:

  TypeError: Operator != not compatible with types struct


texts: Is it ok to build app with huge data in ethereum blockchain

texts:
I agree that the smart contract works well for small Apps. Is it ok to develop a app with huge data. For this let us take an example of building a huge patient database across hospitals (only with key values, and the images will be saved in IPFS/SWARM). The patient database will grow and grow and grow. Will the ethereum Smart contract for this app able to serve the purpose with such a large amount of data in smart contract ?

What should be the best way to approach this ? Please advice


texts:
So,
I was using Bitbuy to buy and send eth to the wallet of my friend.
I dont know how but that transaction finish as internal and it doesnt appear on friends wallet.
Does anyone know who needs to do what?
very frustrated


texts: Geth Providing error on its directory path

texts:
I have initilize my node1 with my genesis file which worked fine command is 'geth --datadir node1/ init genesis.json'. But with same geth when I try to run this command

geth --datadir node1/ --syncmode 'full' --port 30311 --rpc --rpcaddr '0.0.0.0' --rpcport 8501 --rpcapi 'personal,db,eth,net,web3,txpool,admin,miner' --ws --wsaddr '0.0.0.0' --wsport 8601 --wsapi 'personal,db,eth,net,web3,txpool,miner,admin' --wsorigins * --rpccorsdomain *  --bootnodes 'enode://f6efbe327b816a3988517795dab11555e3b4488df1a146d37c885eecb40549da4fed1878ecd9fab0XXXXXXXXXXXXXXXXXXX2072f553bb51862ad78f8b13948de7cf02@127.0.0.1:0?discport=30310' --networkid 9XXX65 --gasprice '1'

To run the node then it provides me following error

invalid command: "node1"

Can anyone let me what is problem is about and how to resolve it? I am running it on AWS ec2 instance.


texts: Incorrectly sent ERC20 (C20) token to a contract address

texts:
I mistakenly sent ERC20 (C20) tokens to a C20 contract address. There are two transaction hashes on the block. One shows that the C20 was sent (to a C20 contract wallet address) and is successful (0xf5e2374eee433fb7a8a6e3c32161ef6c15ed7ce99e6561be394fd7e95395f4c3), then one right after that has a "fail/reverted" status (0x63dd592448262f2823ac810a4fb10e99a8d14d53e747e040bcf59f19633fd1d0).
I'm hoping that the coins get "reverted" back to the sending address (my wallet), but the first transaction being "successful" and showing that the coins were successfully sent to a wallet address other than my own, has me concerned. Anyone ever heard of a scenario like this, and know how it plays out? Any suggestions on what to do? I sent a support email on etherscan so far. TIA


texts:
I am considering using ether.js instead of web3js. One of the factors I am considering is the integration with metamask.

Is there any support in ether.js to use metamask as wallet?
If there isn't, will a simple decorator pattern wrapping around browserside-metamask-injected-web3js do the trick?

One more question, is ether.js stable and well supported?


texts:
I have the following error when try to compile:
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol:5:1: ParserError: Source "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol" not found: Deferred import import "../utils/Context.sol"; ^----------------------------^

I use Remix IDE and error accords to the following line:
pragma solidity ^0.7.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";

what i do wrong?


texts: Why use throw in modifiers instead of conditional entrance?

texts:
Almost every tutorial advises a code like this for a permission modifier.

modifier isAdmin() {
    if(msg.sender != owner) {
        throw;
    }
    _
}

But wouldn't it be simpler to use it without throw statement (AFAIU it would also save user's gas):

modifier isAdmin() {
    if(msg.sender == owner) _
}

As it is described by ConsenSys in Ethereum Contract Security Techniques and Tips but only for these modifiers:

modifier stopInEmergency { if (!stopped) _ }
modifier onlyInEmergency { if (stopped) _ }


texts: Ethereum Mining: Do miners get a fee AND create new ether as a reward?

texts:
So far what I get is that when I send ether or any contract via the ethereum network that I then have to pay for this transaction by paying gas (which again has a price in ether and so on). So miners try to solve this transaction by building the next block and if they achieve it they broadcast this to the network. So I guess one miner will solve my transaction and this one miner will get the whole fee.

(This is kind of my first question: how many miners get my fee for this transaction? Since I think that only one will achieve to solve it, right?)

On the other hand I also know that within the bitcoin network miners get rewarded by mining bitcoins. Thus new bitcoins are created. But isn't that also true for the ethereum network? Aren't miners also creating new ether by mining?

So miners must get the fee plus they get rewarded with newly created ether?


texts:
According to ERC-721 interface the function safeTransferFrom seems to be overloaded:

function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data) public;

Why so? Any ideas? Thx!


texts: How to generate Smart Contracts on demand?

texts:
I want to build a Marketplace where people (seller and buyer) can meet and make a deal. After negotiating the contract, they want to ask our Marketplace to generate, deploy a Smart Contracts based on their terms and conditions.

One notable point here is: how can we design a friendly UI so that users can input their terms and conditions then generate a Smart Contract code (using Solidity) base on user's input, then deploy it onto Blockchain?

I think it's a very common idea but I cannot found the answer anywhere.
So please help. Many thanks!


texts: Temporarily ownership and Revokable ownership of NFT

texts:
Is NFTs(ERC721 or ERC1155) allow to "temporarily own by an address" and the issuer can "cancel ownership of NFT of the address" or "directly assign it to a new address without burn existing NFT"?
Like a seasonal trivia game app, will issue a Champion NFT badge to the top achiever, the ranking may change every moment someone achieves the highest points. So the Champion NFT badge is transferring between receivers frequently or maybe weekly which transfer action did by the game platform/token issuer.
Let's define entities here, Z is the issuer, minted the NFTs. A, B, C represent 3 different addresses. NFT is one and only one unique Champion NFTs.

Z Transfer the NFT to A at week 1
Z Transfer the NFT to B as new champion at week 2.
Z Transfer the NFT to c as the latest champion at week 3.


texts: Updating an instance of an already stored struct?

texts:
How can I update/change the values of a stored struct instance?

as an example: Let's say I've already deployed a chapter with the content written in a particular color. Later it turns out that I want to use a different color and therefore need to update the array of the already stored struct instance. How can I now modify the color of the existing stored struct instance to contain the new color?

contract NewBook {

    struct ChapterData {
        // string chapterID;
        string title;
        string color;
        uint pages;
    }

    struct BookData {
        // string bookID;
        ChapterData[] chapters;
    }

    mapping(bytes32 => BookData) books; // bookId => BookData

    function addChapter(bytes32 _bookID, string memory title, string color, uint pages) public {
        ChapterData memory c = ChapterData({
            title: title,
            color: color,
            pages: pages
        });
        books[_bookID].chapters.push(c);
    }


texts: ETH transfer to MultiSig contract keeps on getting reverted

texts:
I am creating a MultiSigWallet contract.

I compiled and deployed the MultiSigFactory contract to kovan network.

But when I transfer funds to the contract it gets reverted, as shown on Etherscan.


texts: Isn't the blockchain size going to be a huge problem in the future?

texts:
At the moment the blockchain is already quite large. And since the main idea behind the blockchain technology is to get away from services that provide the information and rather have the information on different nodes around the web, isn't this going to be a problem in the future?
Imagine Ethereum will be as successful as predicted and nearly everyone uses it. The size of the blockchain will then probably exceed terabytes pretty soon, which means that you have to use centralized services to provide functionality. Or am I completely wrong there?


texts: "The bigger the block size, the greater the computational power needed to mine a block" Does this make sense?

texts:
I was going through one of the papers and the authors in the paper mentioned this statement. I am not able to find the correlation as such.

I do understand that Larger blocks may propagate slower through the network. Also, Processing larger blocks would require more computation as more transactions will have to be validated. So I see an impact on validation level but not on mining (just adding transactions to the public ledger).

Am I missing something?


texts:
I have recently switched from geth to parity. I want to know how to mine using parity in testnet?
I am synched using parity --testnet and I have the web page but how to mine blocks?


texts: How to extract "runtime" bin from a EVM bin found on etherscan.io

texts:
I would like to extract the runtime bin from the EVM bin that can be found in the etherscan.io.

For instance for this famous contract (https://etherscan.io/address/0xecb4380189e22ed2abccff53a6ac1d1e02bd6981), when I use the online decompiler (https://ethervm.io/decompile?address=0xecb4380189e22ed2abccff53a6ac1d1e02bd6981&network=) to decompile, clearly it starts from a bytecode sequence 606060405236156100f8, which is not the very beginning of this EVM bytecode sequence.

I understood that I can do a pattern match to figure out a sequence of 606060405236, but I am a bit worried whether that's too "ad-hoc", and unable to handle all the cases. So could anyone shed some lights on a more principled approach here? Thank you.


texts: GasPrice: is dipendent by the moment of the call and/or the network?

texts:
I'm testing a system to store a small amount of data on the blockchain using a contract.

So I've some js using web3.js to make a call to a contract function that mutates states.

I obtained, using specific params, a cost of

  gasUsed: 85359

It's accetable, actually 0.000085359 eth are 0.013 euros (0.014 us dollars).

But I am on rinkeby.

Will the gasUsed be the same every day, every call, (using same params value of course) and, more important, will the gasUsed be same if I deploy the contract on main network and call the function to main network?


texts: Log data along with transactions on the blockchain

texts:
I have a smart contract and on my web interface I'd like to display the 5 latest transactions. Currently these include any ether being sent to my contract which are retrieved using web3.eth.getTransaction() and transaction hash.

However, I have a variable leaf which any address is allowed to buy, this is logged using an event function. Can the number of leaf purchased be logged and retrieved using the transaction hash?

EDIT: So, I've managed to retrieve all the events using the allEvents() functions. Unfortunately, it returns two different structured objects:

The first one, returns this, which contains the args variable - as expected:

Event:   event depositedFunds(uint amount, uint newBalance);
Returned object: {logIndex: 0, transactionIndex: 0, transactionHash: "0x82b69effb105ef1998fefdbf47d471c54c33a5b3b6b6462da33ecb790b2ce410", blockHash: "0xd16a7efac06f35725ae75bc3bca5a862a2847a94c2f2084c6a6f4d22c71958ec", blockNumber: 3, …}

The second, which is logged when the desired event is called returns this, which does not contain the args variable:

Event: event leafWasPicked(uint leavesLeft, uint numberTaken);
Returned object: {logIndex: "0x0", transactionIndex: "0x0", transactionHash: "0xbfd6a21c6d782e18f7636be9895849de8333678f5d7d28a0a406575988e7d653", blockHash: "0x765264a7c21d9c088adfc70a15a69a7b3f3c0408eb3758390bda2596d47aa48f", blockNumber: "0x5", …}

Why are both of these different?


texts: Not able to assign ethers to account in private chain

texts: I am running a testnet with init property for genesis block i am able to create an account and its working fine only problem is that i am not able to assign any pre ethers to an account which i was able to do in previous implementation of genesis flag while running. Any one can please tell how to do it in this implementation.


texts: How to transfer another erc20 token with a smart contract?

texts:
I want to send the'B(erc20)' token of msg.sender inside the function of'A' Smartcontract.
Create transaction that msg.sender approve B token
After that, the msg.sender creates a transaction transferred from inside the A Contract function through the A Contract function call.
Instead of the above method, I want msg.sender to process it as one transaction.
Does anyone know how?


texts: I have some problems with Mist and with withdrawing my ETH from The DAO. For my financial condition it is significant value of money and I would really appreciate your help here. I was about to execute the procedure of approving transfer from the DAO to the DAO Withdrawal through mist. I was using this instruction: How do I convert my The DAO tokens into ethers using the withdrawal contract after the hard fork? In point 3, after I have set all the data to execute "Approve", I have realised that I have might done some mistake putting numbers so I have stopped right there and I had deleted the contract before executing "Approve", hoping it would reset all data I have put so far and I could start from the beginning. When I have added The DAO contract to watch once again, it's balance was showing "0" and I could not see the contract menu , also my dao token preview in Mist was showing "0". I m afraid I could have lost all ETH. Is this possible to repair this situation and withdraw my eth properly? Is there something that can be done? Please help me!


texts: how to make the list of peers permanent on a private network

texts:
I have joined a private network and it works fine when I add the peers with admin.addPeer but I have to add the peers every time I launch geth.

How can I make the list of peers permanent?


texts: Tracking ERC20 token movement in the smart contract

texts:
I am writing a smart contract that allows users to stake ERC20 tokens and get a discount on a product they buy in the store.

At first, the user will transfer tokens to the contract and then based on the amount they transferred, the discount will be calculated and tokens will be staked for some time. I need to find a way to track token amount sent to the contract. Something like msg.tokenValue

How to do something like that?


texts: Creating several objects in the same transaction (data repetition)

texts:
I'm working with genetic algorithms and I need to create a population. Currently I have this function:
/// @notice Create a new individual
function createIndiv(uint _popSize) public{
    for(uint i = 0; i < _popSize; i++){
        Individual newIndiv = new Individual();
        newIndiv.createIndividual(agents.length);
        population.push(newIndiv);
    }
}

The point is... this way all my Individual objects have the same information (the same genes actually), but I have a function to create a random number:
function random(uint _interval) public returns (uint) {
    uint randomnumber = uint(keccak256(abi.encodePacked(now, msg.sender, nonce))) % _interval;
    nonce++;
    return randomnumber;
}

If I try to create all my individuals in the same transactions, then it seems all of them will have the same information. I tried to create those individuals using different transactions (I mean, in many calls) and it worked. So, can't I create all my population (individual' objetcs) using only one transaction?
P.S: is that a good way to generate random numbers between an interval?
Thanks in advance!


texts: trying to call solidity function but getting error: UnhandledPromiseRejectionWarning: Error: Transaction has been reverted by the EVM


texts: how to deploy derived smart contracts solidity

texts:
If i have a solidity code, which has 2 or 3 contract in it, which depends on each other, How do we deploy such contracts. As when we put this code in browser-solidity, we get different Bytecode and Interface for all the contracts separately. This might be a very stupid question. But how do we deploy these?

One by One ?
Or is there a way to deploy all at once ?

Example code which i picked from documentation.

pragma solidity ^0.4.11;

contract owned {
    function owned() { owner = msg.sender; }
    address owner;

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }
}

contract mortal is owned {

    function close() onlyOwner {
        selfdestruct(owner);
    }
}

contract priced {

    modifier costs(uint price) {
        if (msg.value >= price) {
            _;
        }
    }
}

contract Register is priced, owned {
    mapping (address => bool) registeredAddresses;
    uint price;

    function Register(uint initialPrice) { price = initialPrice; }

    function register() payable costs(price) {
        registeredAddresses[msg.sender] = true;
    }

    function changePrice(uint _price) onlyOwner {
        price = _price;
    }
}

contract Mutex {
    bool locked;
    modifier noReentrancy() {
        require(!locked);
        locked = true;
        _;
        locked = false;
    }

    function f() noReentrancy returns (uint) {
        require(msg.sender.call());
        return 7;
    }
}

The way i deploy the contract:

var myContract = web3.eth.contract(ABI);
var contractInstance = myContract.new(
{
    from: web3.eth.accounts[0],
    data: byteCode,
    gas: '4700000'
}, function (e, contract){
    console.log(e, contract);
    if (typeof contract.address !== 'undefined') {
        console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
    }
})

And In this i can put ABI and ByteCode for one one contract at once.


texts: Injecting a private key into web3.js execution context

texts:
I'm trying to achieve what seems like a simple goal but having trouble finding a simple solution to it. Here's my problem:

Given a private key, I would like the simplest way to "inject" this key into a web app context so that all subsequent usage of the web3 object uses this as web3.eth.defaultAccount.

Before someone brings up security issues, I would like to emphasize that we can ignore security implications for now. It's a special case and I have solutions to deal with the security issue as long as this is possible.

The only solution I've found so far has been to create a custom provider and instantiate the Web3 instance with this custom provider which overrides certain methods like sendTransaction, etc.--this is how MetaMask seems to work using https://github.com/MetaMask/provider-engine.

But setting up all these custom providers just for what I'm trying to achieve--take a private key string and turn it into web3.eth.defaultAccount--feels like an overkill.

Any help would be appreciated. Thank you!


texts:
I'm trying to concatenate two strings in solidity.

I tried with + or . but neither option works. There is not much documentation on string concatenation yet. Is it even possible?

If not, can I insert variables into strings?


texts:
ERC20 is a pre-designed token with some implemented functions and seems that it would be useful for exchanging "digital assets".
However, why the number of 20 has been considered as a part of its name? (why not for example, 30?)
And also when exactly do we need to use ERC20 token contract? I mean what is exactly its use case?


texts:
I attempted to withdraw and transfer my balance of OMG currency to my local Ledger S drive. It shows complete but I do not see anything on my Ledger and the address is correct. Is there any way to recover this? I really do not know why it did not transfer.

https://etherscan.io/tx/0x666f669a4c5d673350acad0278d7200dbd04dbd1bc27d337df34788bf1d45362

Any help is greatly appreciated.  Thanks


texts: In solidity, how can I hardcode bytes > 32 bytes

texts:
I want to create a contract with a hardcoded bytes variable.

contract Test(){
   function Test(){
      bytes x = 0x..... //greater than 32 bytes
   }
}

The above returns a Type int_const not implicitly convertible to expected type bytes storage pointer error.


texts: Should new tokens be developed using the ERC-777 token standard?

texts:
EIP-777 came out in late 2017 and yet many projects still use ERC20 token standard. The only one I've heard of using ERC777 was UNI which was hacked because the attacker was able to set how the tokensToSend function was called and by whom.
Anyway, I see the mint, burn, and send/receive hooks as rather useful and instead of trying to re-invent the wheel by developing this functionality in an ERC20 based Dapp was thinking that ERC777 should just be used rather than ERC20.
If you take a look at the Ethereum Token Standards, they simply list ERC20 as one of the most "popular" but never refer to it as "best practice".


texts: What mechanism to use to pay for viewing another users data on blockchain

texts: I am new to blockchain development and following some tutorials I have created a DApp that allows a user to save and view information. Now, i want to let another user view that saved information but for that new user have to pay some ether. Basically, I want the main user have the right to let a new user view their data. So, what can I do to implement this in Ethereum?


texts: Does Ethereum Suffer From Transaction Malleability?

texts:
Does Ethereum in its current form (Homestead, specifically Geth v1.3.6) have transaction malleability issues similar to Bitcoin? If so, is there a standard method for deriving a normalized hash for Ethereum transactions?

  Transaction Malleability = The ability for a node on the network to change a transaction in a way such that the hash is invalidated. This produces an identical transaction with a different hash, causing issues for nodes that store and query transactions by hash.

In the past it seems this was an issue/concern. I'm just wondering if it still is or if it has been addressed.

HISTORY

Vitalik mentions susceptibility to transaction malleability on reddit here: https://www.reddit.com/r/ethereum/comments/3o9ru0/transaction_malleability_does_ethereum_have_this/

EIP-2 (Homestead Fork) also involved transaction malleability fixes: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.mediawiki


texts: How to call web3.js functions synchronous

texts:
Installed web3.js 1.0.0-beta.26 on macOS
Running testrpc, Node.js based Ethereum client

After running node in my terminal and initiating the web3 object listening to port 8545:

> var Web3 = require("web3")
> web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")

I can only see my lists of accounts asynchronous like:

> web3.eth.getAccounts().then(console.log)

I want to do it synchronous like:

> web3.eth.accounts

Also for example web3.eth.getBalance() returns a promise. Where I before was able to run it synchronous.

I want to execute it like in this video: https://youtu.be/-5LhwoCcjp0?t=1m15s
Is this because I have installed the latest version or is there a possibility to run it synchronous.


texts: Metamask does not react on delivering gasPrice

texts:
I am using following code to generate a new transaction using web3.js & metamask:

var web3dictdata = {
  gasPrice: web3.toHex(10),
  gasLimit: web3.toHex(210000),
  to: "0x92EB887e5de9f2C73C08483831F47dc0CD8f7B0c",
  value: web3.toWei(0.01, "ether"),
}

web3dictdata.data = "0x7770334469734b58777148446a4d4f5177345f4370634b59777154436e634f52777148436e4d4b56777076446b4d4b657770374372384b66777072446b634b657771544371734b5877345f436f734f4a77706e436d634f5477707a446a384f4e";

web3.eth.sendTransaction(web3dictdata, function(error, receipt) {
  if (error)
  {
      console.log(error);
  } else {
    console.log(receipt)
  }
});

But whenever I am launching it, it ends up in generating a new transaction filled with the data, 'to' address along with the value of a transaction.
The missing points are:

gasPrice
gasLimit

User, in order to successfully send a transaction, has to fill the gas Price on his own, which totally destroys my vision of the application

Screenshots:


texts: Out of gas transaction using delegatecall

texts:
I'm currently trying to develop my knowledge further on lower level calls such as DELEGATECALL.

I am continiously running into when trying to use .delegatecall():

RunTime Error: out of gas
Gas Usage: 0xe07e44(Decimal = 14712388)

delegateCall contract:

 pragma solidity ^0.4.4;
 import "delegateReceiever.sol";

contract delegateCall{
uint public testInt;
address public sender;

function delegateCall(){
    testInt = 1;
}

function delegateCallC(address _c, uint _testInt){
if(_c.delegatecall(bytes4(sha3("setTestInt(uint")),_testInt ))
throw;
}
}

delegateReceiever contract:

pragma solidity ^0.4.4;
contract delegateReceiever{
uint public testInt;

function delegateReceiever(){
    testInt = 2;
}

function setTestInt(uint _testInt){
    testInt = _testInt;
}
}

Edited truffle deploy to increase gas like so:

deployer.deploy(contract,{gas:114712388})

Edited testrpc initial account balance to:

1e+167

Edited truffle.js file to include gas:

rpc:{
   host: "localhost",
   port: 8545,
   gas: 114712388
}

Is there any other method of ensuring gas will not run out? For example, is there a developer parameter that requires no gas etc..?


texts:
Is there some library like web3.js or ethers.js but in PHP to use with Laravel?
(Which code is hopefully maintained)
Or is PHP just the strongest choice possible I want to work with web3?


texts:
I run the geth on my server. But after days, the block number is behind the network thousands. I restart, but no use.

I need remove the block and re-sync from the beginning. But later it's behind again. Anyone knows why and how to solve?

Thanks


texts:
I'll be happy to get some clarifications on this function.
Some usage example can be found here:
https://github.com/Giveth/minime/blob/master/contracts/MiniMeToken.sol

Rows 31-31:

  contract ApproveAndCallFallBack {
      function receiveApproval(address from, uint256 _amount, address _token, bytes _data) public;
  }

Rows 247-266:

function approveAndCall(address _spender, uint256 _amount, bytes _extraData
) public returns (bool success) {
    require(approve(_spender, _amount));

    ApproveAndCallFallBack(_spender).receiveApproval(
        msg.sender,
        _amount,
        this,
        _extraData
    );

    return true;
}

I don't see an implementation of the function in the contracts code but just declaring and calling it.


texts: What happened in the anomalous transaction, where an account was deleted despite out of gas?

texts:
In the Byzantium Revision of the Yellow Paper, Appendix K:

Here is equation 195:

Here is the transaction, It was made during efforts to de-bloat the state post EIP-150. It appears that the txn was a call to a contract which called to the RIPEMD precompile (at address 0x03), with 0 gas, 0 value, and 0x0 for data:

{
"action": {
  "callType": "call",
  "from": "0x0e879ae28cdddeb31a405a9db354505a5560b0bd",
  "gas": "0x0",
  "input": "0x",
  "to": "0x0000000000000000000000000000000000000003",
  "value": "0x0"
},

^ taken from the parity trace

My rough understanding of what happened: the precompile was added to the list of 'touched addresses', and then it was removed from the state because it had no balance and no code. Then the transaction ran out of gas, but it seems the contract wasn't restored to the state. (Please correct any errors).

I'm very curious about what happened here! A few specific questions:

What does it mean to 'delete' account 0x03? (Presumably the precompile was still available after being deleted, since it's hard coded into the client).
How was there not a consensus failure? Did all clients correctly implement the exact same bug?
The same transaction also called to the precompiles at the addresses 0x01, 0x02, and 0x04. Why were they not affected?


texts: Storing multiple values in one key mapping (Solidity)

texts: Can I store multiple values in one key mapping in solidity? like I can retrieve all of the values if I use that one mapping key? Is this possible?


texts:
I have 2 macs and on one the new parity is working and running smoothly but on the other I continue to get "can’t establish a connection to the server at 127.0.0.1:8080."

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy,"

I have set the proxy and pac. in network, I should note that at home I have satellite connection and the office is cable otherwise both computers are the same running el capitan 11.6

neither parity.wallet nor http://127.0.0.1:8080/ will open


texts: In Casper, what is the incentive to store the entire chain?

texts: Do the validators need information from the blockchain to produce blocks, or is it enough just to store a few recent blocks? What is the incentive to use large amounts of storage to store the complete ledger (or when sharded, store the full shard)?


texts: Changed behaviour regarding web3.eth.accounts[0] in Metamask?

texts:
Some time ago, it was possible to get the selected account using sync methods on web3 0.2.
https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md

It always worked on our DAPP. But on Nov 8th in the middle  of afternoon it changed. I was testing my dapp locally (9545) and I noticed that I could not retrieve my accounts anymore. I was using a version of Metamask download before Nov 2th when the error happened.

I noticed that it was still possible to retrieve accounts when using the asyncronous methods. But sync is not working anymore. Is it the case? Does anyone knows why it happened? Is it related to that Metamask change of Nov 2th?

I was using web3-injected from metamask.

Thank you


texts: Geth 1.5 Extreamly Slow to Sync on Ubuntu 16.04 LTS (Will Never Catch Up)

texts:
I set out to do a full geth chaindata sync on a new Ubuntu 16.04 LTS machine, and after the first 80-90% of the blockchain downloaded quite fast, the sync speed dropped considerably, to the point where I don't think it will ever catch up.

My geth version is: 1.5.3-stable-978737f5

In the last ~20 minutes, I got just 13 blocks:

I1202 12:08:38.699611 core/blockchain.go:1042] imported 1 blocks,     8 txs (  3.520 Mg) in 14m1.531s ( 0.004 Mg/s). #2469603 [2e8fa979…]
I1202 12:08:40.108563 core/blockchain.go:1042] imported 2 blocks,    15 txs (  0.253 Mg) in    1.408s ( 0.180 Mg/s). #2469605 [2e8fa979… / 270b9d5e…]
I1202 12:15:49.759161 core/blockchain.go:1042] imported 4 blocks,    25 txs (  3.962 Mg) in  7m9.565s ( 0.009 Mg/s). #2469609 [7764d5e0… / a2ed5ef4…]
I1202 12:21:11.151912 core/blockchain.go:1042] imported 3 blocks,    31 txs (  3.879 Mg) in 5m21.392s ( 0.012 Mg/s). #2469612 [a2ed5ef4… / b7a71fbe…]
I1202 12:26:18.290481 core/blockchain.go:1042] imported 3 blocks,    18 txs (  3.562 Mg) in  5m7.138s ( 0.012 Mg/s). #2469615 [b7a71fbe… / e43f4673…]

It looks like I am on the main ETH chain: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000}

One thing that might be suspicious is that, in the same 20 minutes, geth has done this much IO ...

 PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>  COMMAND
2933  be/4  ethuser     2.28 G    561.04 M   0.00%   5.23%  ./geth --cache=2048

... and the disk is spinning constantly, which is strange, given that it only got 13 blocks.

Note: this is a rather powerful machine in terms of CPU/GPU/RAM, and the chain goes to a large HDD (not SSD).


texts: How to get meme tokens using MetaMask wallet cost effective

texts:
I have 0.0255 ETH (~100 USD) in my MetaMask wallet (I paid 0.007 ETH fee transferring this amount from Binance spot wallet).
My end goal was to buy some meme tokens like SHIB, $akita, $HOKK but once today I realized that gas price of conversion using services like uniswap is too high and it does not make any sense (I should pay 150-200 USD for gas just to swap 0.01 ETH to $akita). So swaps doesn't work for this purpose right now (gas price is too high).
I see one option with Poloniex exchange, but to transfer ETH from MetaMask there I need to pay around 60 USD, which is not seems efficient enough.
Any other suggestions how to get these meme tokens using my MetaMask wallet and do not waste more than 50% paying for gas?


texts: How to trigger contract fallback function from Javascript

texts:
For a simple contract:

pragma solidity ^0.4.11;

contract Test {
   uint private val;

   function getVal() constant returns(uint) {
       return val;
   }

   function setVal(uint newVal) payable {
       val = newVal;
   }

   function() {
       val++;
   }
}

getVal will be called from web3.js something like this:

contract.getVal.call(function(err, val) {
    //
});

setVal will be called from web3.js something like this:

contract.setVal.sendTransaction(newVal,
  {
     gas: gas,
     from: web3.eth.defaultAccount
  },
  function(err, result) {
      //
  });

How to trigger unnamed function from Javascript? Is it possible?


texts: Contract assembly algorithm in .data part of the object file

texts:
Hope you are doing well. We were running a simple contract and trying to analyse the assembly code generated by the browser compiler. In the .data part we found a section where the compiler executes a specific logic where it matches the method id of the methods, written in the code and generates the specific tags. But before it matches the method id it executes some logic which we could not figure out why it is required? May you please explain the algorithm behind this....

The contract

pragma solidity ^0.4.0;
contract Test
{
    uint x = 0;
    uint y = 8;

    function calculate()
    {
        uint z = x+y;
    }
}

-----------------.data section in the assembly code--------------------

PUSH1 0x60
PUSH1 0x40
MSTORE
PUSH1 0x0
CALLDATALOAD
PUSH29 0x100000000000000000000000000000000000000000000000000000000
SWAP1
DIV
PUSH4 0xFFFFFFFF
AND
DUP1
PUSH4 0xCA77AB65
EQ
PUSH1 0x3C
JUMPI

It will be immensely helpful if you can help us to understand this algorithm and why it does this.

Thank you in advance.

Thanks,
Shamik.


texts: So, Account A has Tokens that I want to transfer out but whenever I transfer ETH to Account A it automatically transfer my ETH out to another address and I know you can't change private key, any idea how I can get my ERC-20 Token out from Account A? Really appreciate if someone can help me out


texts: JSON RPC get this error "Request have return error: gas required exceeds allowance or always failing transaction"

texts:
i'm trying to do a simple transaction for a token but i keep getting following error for estimate gas limit :
"Request have return error: gas required exceeds allowance or always failing transaction"
here is the code for estimate gas limit:

 $eth_balance = $this->ethBallance($from);
    $erc20_balance = $this->tokenBallance($from, $token);

    $rpcUrl = env('ETHEREUM_RPC_URL');
    $jsonRpc = new JsonRPCClient($rpcUrl);
    $utility = new Utility();
    $amountHex = $utility->convertHex($amount, $this::ERC20_DECIMALS[$token]);
    $data = $this::ERC20_TRANSFER_HEX . str_pad(substr($to, 2), 64, "0", STR_PAD_LEFT) . str_pad($amountHex, 64, "0", STR_PAD_LEFT);

    $estimateGas = 0;
    $gasPrice = 0;
   try {
        $gasPrice = $jsonRpc->eth_gasPrice();

        $estimateGas = $jsonRpc->eth_estimateGas(array(
            'from' => $from,
            'to' => env($token . '_CONTRACT_ADDRESS'),
            'value' => '0x0',
            'data' => $data,
            'gasPrice' => '0x'.dechex(hexdec($gasPrice) * 2),
        ));
    } catch (\Exception $e) {
        // $tran->status = TransactionStatus::PENDING;
        // $tran->save();

        return response()->json([
            'success' => false,
            'error' => $e->getMessage()
        ]);
    }

    $hexEstimate = $estimateGas;
    $gasPrice = $jsonRpc->eth_gasPrice();

    $hexGas = $gasPrice;

    $estimateGas = hexdec($estimateGas);
    $gasPrice = hexdec($gasPrice) * $this::ETH_UNIT;

    if ($eth_balance > $estimateGas * $gasPrice * 2 && $erc20_balance->last_balance_token >= $amount) {
        try {
            $result = $jsonRpc->personal_sendTransaction(array(
                'from' => $from,
                'to' => env($token . '_CONTRACT_ADDRESS'),
                'value' => '0x0',
                'gas' => $hexEstimate,
                'gasPrice' => '0x'.dechex(hexdec($hexGas) * 1),
                'data' => $data
            ), $privateKey);
        } catch (\Exception $e) {
            //$tran->status = TransactionStatus::PENDING;
            //$tran->save();

            return response()->json([
                'success' => false,
                'error' => $e->getMessage()
            ]);
        }
    } else {
        $tran->status = TransactionStatus::PENDING;
        $tran->save();

        return response()->json([
            'success' => false,
            'error' => 'Balance is not enough'
        ]);
    }

    dd(respose());

    return response()->json([
        'success' => true,
    ]);
}

and here is the error that returns:

{"success":false,"error":"Request have return error: gas required exceeds allowance or always failing transaction; \nRequest: {\"jsonrpc\":\"2.0\",\"method\":\"eth_estimateGas\",\"params\":[{\"from\":\"0x19abe73861ec71fcb5d069a361bf5f96801a793e\",\"to\":\"0x0e8d6b471e332f140e7d9dbb99e5e3822f728da6\",\"value\":\"0x0\",\"data\":\"0xa9059cbb00000000000000000000000010D307Bfc6939B8857B93393456fa02E8D07d8c000000000000000000000000000000000000000000000001b1ae4d6e2ef500000\",\"gasPrice\":\"0x77359400\"}],\"id\":3}; "}

and here are the constants :

const ERC20_BALANCEOF_HEX = '0x70a08231';
const ERC20_DECIMALS = [
    'ABYSS' => 18,
    'B2BCoin' => 18,
    'TTENS' => 18,
    'CoinCrowd' => 18
];
const ERC20_TRANSFER_HEX = '0xa9059cbb';
const ETH_DECIMALS = 18;
const ETH_UNIT = 1 / 1000000000000000000;


texts: What needed for the deployment and approvement of smart contract creation transaction?

texts:
I attach the following image. Once a user creates a digital wallet (for example in MetaMask), then they receive a private key and a public address of their account as outputs.
Then, after having developed and compiled their smart contract they need to deploy it in the Ethereum blockchain. In order to do so they need to approve the transaction and pay for gas. For doing so, does the private key or their public address should "work" as an input to the "Deploy and approve transaction"?
In other words, in a visual way (as shown below), should a line from private key or from public address direct to the deploy and approve transaction?
My perspective is that the private key should be served as the input, since its like the means of signing a transaction.
But since I am relative new to the Ethereum and blockchain world, I would need your help.


texts: How to allow mobile wallets to sign and access to my dapp

texts: I'm building a dapp application on Ethereum using React & Web3js. As usual the dapp will get the injected provider from Window.web3 (MetaMask), perhaps. The problem that I'm facing now is how can I allow other mobile wallet to sign and access my dapp? For example, CryptoKitties & DDEX Exchange platform. Please advise


texts: How do I send multiple transactions from one wallet in Nodejs?

texts:
Hi I've been reading around and I came across Web3.js

It's not apparent to me how I can send Ether from one wallet to multiple recipients other than in a batch-style request (which inevitably takes a lot of time and is prone to failure)

I see people suggesting contracts but almost 9/10 of the posts I read were referring to ERC20 tokens but I am looking to send just plain ol' Ether.

I have a website where people are going to be earning Ethers and all types of cryptos and the amount they earn is stored in a MongoDB database,

For Monero, I just pull the values the earn from the MongoDB database and push them into an array. I wait for the array to be filled with Promises and then I execute the function with an array, and Monero Wallet RPC knows that its an array and sends all the transactions out as one big payment.

How do I do something similar in Ethereum?


texts: How can I test a consensus protocol that I created?

texts: Currently, I am designing my own blockchain consensus protocol and I want to test its performance. Is there any available tool or well-known framework that gives me this ability?


texts: keep records of who did send tokens , smart contract

texts:
I am trying to create a contract that only allow people who did send amount of wei to the token , to access a get function by keeping a record of all address & amount .
is it possible to do that ? and can i use the events for it ? if yes how the contract can get it's own events history . thanks


texts: How do I make a QR code for an ethereum address?

texts:
I am not super familiar with QR codes.

Is there a piece of open source software I can use o convert an address to a QR code?


texts: Can a token store funds like an escrow and still meet ERC standards?

texts:
In one of my contracts, a user creates an escrow that stores some important information. These escrows are bundled together and passed to another contract, which sends the user tokens. The tokens are actually identical to the escrow in that they store the same information - the one difference is that the tokens do not store funds (in ETH) whereas escrow does.

I was thinking, it'd be a lot more efficient if I didn't have to create the same thing twice, but the tokens need to be easily exchangeable, so it's important they meet an ERC standard.

As a small side note, it would be nice if the tokens could meet the ERC20 standard, but because the information they store is unique and very important, it doesn't seem possible. Are there good alternatives or solutions?


texts: How to retrieve all instances of a contract from a node using Web3.js with the ABI of the contract?

texts:
I am new to Solidity and Web3.js. I created a contract and tested it using Remix.
With Web3.js, I am able to get the contract instance if I know the address and query it and print the results on a web page.

But I want to query and get all the instances of a type of contract that is already created and list it on my HTML page. For this, I assume that I have to get the addresses of these instances. I will appreciate if anybody can provide pointers on how to go about doing this.

If this is not possible, I want to be able to create instances of contract from Web3.js without having to create it in Remix. Pointers for that will also be appreciated.


texts: Invalid sender address, failed to deploy a transaction to the blockchain network

texts:
Description

I'm trying to deploy a contract to rinkeby network, but everytime I like to deploy the contract it throwing error as invalid sender.

Compile code

const path = require('path');
const fs = require('fs');
const solc = require('solc');

const contractFile = 'xxx.sol';

const lotteryPath = path.resolve(__dirname, 'contracts', contractFile);
const source = fs.readFileSync(lotteryPath, 'utf8');

const input = {
    language: 'Solidity',
    sources: {
        [contractFile]: {
            content: source
        }
    },
    settings: {
        outputSelection: {
            '*': {
                '*': ['*']
            }
        }
    }
}

const compiled_contract = JSON.parse(solc.compile(JSON.stringify(input)));

const interface = compiled_contract.contracts[contractFile]['XXX'].abi;
const bytecode = compiled_contract.contracts[contractFile]['XXX'].evm.bytecode.object;

module.exports = { interface, bytecode };

Deploy Code

const HDWalletProvider = require('@truffle/hdwallet-provider');
const Web3 = require('web3');

const { interface, object: bytecode } = require('./compile');

const provider = new HDWalletProvider(
  'mnemonic phrases...',
  'https://rinkeby.infura.io/v3/bba91a6c349c44afbde264a1bda1af75'
);

const web3 = new Web3(provider);

(async () => {
  const accounts = await web3.eth.getAccounts();

  const result = await new web3.eth.Contract(interface)
    .deploy({ data: bytecode })
    .send({ from: accounts[0], gas: '1000000' });

  console.log('interface', interface);
  console.log('Contract deployed to', result.options.address);

})();

Versions

"@truffle/hdwallet-provider": "^1.0.19"
"web3": "^1.2.1"
"solc": "^0.5.11",

Deploy command:

"start": "node deploy.js"

Error logs

Attempting to deploy from account [ '0x.....' ]
Error: invalid sender
at D:\projects\blockchain\demo\node_modules\web3-provider-engine\subproviders\provider.js:18:36
at XMLHttpRequest.request.onreadystatechange (D:\projects\blockchain\demo\node_modules\web3-providers-http\src\index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request.js:318:14)
at IncomingMessage. (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request.js:289:61)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Error: invalid sender
at D:\projects\blockchain\demo\node_modules\web3-provider-engine\subproviders\provider.js:18:36
at XMLHttpRequest.request.onreadystatechange (D:\projects\blockchain\demo\node_modules\web3-providers-http\src\index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request.js:318:14)
at IncomingMessage. (D:\projects\blockchain\demo\node_modules\xhr2-cookies\dist\xml-http-request.js:289:61)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

BR, Igor


texts: Create multiple addresses under main wallet address

texts:
As in exchanges, They provide their users only deposit address but not private keys and our all funds exists under main exchange account.

How is it possible to setup ethereum in our own server?

Where all deposit to any address comes under main account and each address can view their balance only.


texts: Mineable Tokens? Is it possible? If so, how can I make one?

texts: Just wondering if you could make a ethereum token that is mineable. I saw this link, but don't really know about it and i dont know anything about solidity. Can someone please help me? Thanks, Crypthusiast


texts:
I would like to search the code (binary grep) of all deployed contracts. The goal is to search for vulnerabilities and other research.

How can I do this with geth, Parity or the like? And is this feasible, like will it take years to do a search?


texts:
If I am using the Web3 library, and I want to fetch a list of all tokens associated with my user account, would I be completely wrong in thinking that I need to use:
const myAccount = new web3.eth.Contract(..
Feeding in my public key and an ABI representing some 'createUserOnEthereum' contract?
Basically, my question here should probably be, when I create a wallet (and then make my first transaction), does the EVM create an 'instance' of my wallet on Ethereum using some kind of 'createUserBasedOnTheirGenereatedPublicKey()' function?
As far as I know, no wallet would ever be recognised if no transaction was ever made (and the EVM would never see my private keys anyway right?)
Thanks!


texts: How can I send tokens to large number of addresses?

texts:
I have to send 221,000 tokens (ERC20) to 6477 different addresses. Airdrop guy used some automatic sending app and that tells 1.94 ETH is needed as approx cost of operation to send all this.
Is there any app, which can help here and reduce cost. 1.94 ETH as gas cost is insane.

Thanks


texts:
I am wondering what am I doing wrong, this is my code:
 async function getAccount() {
           const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
       }

 $("#connect_ethereum").on("click", function(e){
           e.preventDefault();

           let return_value = getAccount().then((result) => {
               console.log("result:");
               console.log(result);
           }).catch((error) => {
               console.log(error)});

           console.log("return_value:");
           console.log(return_value);

       });

This logs the following:
return_value:
Promise { "pending" }
<state>: "fulfilled"
<value>: undefined

result:
undefined

As you can see, the value is undefined. How should I write the code in a way I can get the address value and asign it to a variable?


texts: Is it possible to check which RPC APIs are available?

texts:
Is it possible for a decentralized application to get details about the offered JSON-RPC APIs from the local ethereum node?

I want to check the following specs in the following order using web3.js:

Is the RPC port open and listening at :8545?
Is the RPC set to allow CORS requests from my domain (example.com)?
Which RPC APIs are availabe by the client (db,eth,net,web3)?

Is the 2nd step even possible if CORS is disabled for my remote domain? Will a disabled CORS RPC port be discoverable? If so, how?


texts: Are there any projects/applications using raiden network (or state channels in general) on ethereum?

texts:
http://raiden.network/ - This is a promising project leveraging off-chain state networks. Are there any early adopters for this technology ?
I couldn't find any examples or sample applications on their github page.


texts: How can I set the block number in Remix?

texts:
I am using Remix to write a smart contract. One of the functions checks the block number before paying out a user:

contract MyContract {
  uint lastBlockNumber;

  // ...

  function setLastBlockNumber(uint number) {
    lastBlockNumber = number;
  }

  function claim() public {
    if (block.number >= lastBlockNumber + 10) {
      msg.sender.transfer(this.balance);
    }
  }
}

I don't see a way to set the block number in Remix so that I can test that if 10 blocks have passed it will actually pay out the balance. Is this possible, and if so how?

(Background: I'm coming to Solidity from JavaScript. I have noticed a block number field in the Debugger tab, but as far as I can tell that's a way of selecting a transaction to debug. I don't see anything in the Remix documentation about incrementing or setting the block number.)


texts:
A checksum, similar to its use in Bitcoin addresses, can primarily prevent mistyped or invalid addresses from being used, before a transaction with an invalid address is constructed.

Why don't Ethereum addresses have checksums?  Was it an oversight that was overlooked by the designers, auditors, and the community until after Frontier was launched?  (This question is more about the history, than ongoing and future efforts to rectify.)


texts: Please Help! I have an big airdrop to claim but lost my

texts:
I lost my metamask seed but i have the wallet address to that account that will be able to make the claim.
Is there anyway possible to recover an account using the wallet address only?
Can it be found in old files from chrome on the laptop, or anyway to recover it?


texts: To transfer tokens from owner address to an address, if latter address moves some other tokens to a given particular address

texts: I am writing a contract for an ERC20 token (say ABC). Is it possible to airdrop some of these newly minted ABC tokens to those ERC20 addresses, every time, if they transfer a different token (named BCD) to a particular ERC20 address?


texts: Truffle test error: deducts the amount from the allowance

texts:
What i did first was watching at Dapp university tutorials, I manage to watch all 14 videos and run it with Ganache. But since everything is doing good at local, I created my own private network. Then.. this happens.

When I run truffle test --reset --network development

I think the error is happening in this area DappToken.js @ 116:

this is my network by the way truffle.js:


texts: I'm working with the OpenZeppelin solidity framework to run a crowdsale script, but would like to ask, is there is an existing open source solution for implementing time-based bonus payouts?


texts: Need to understand the use of super._mint in this 721 token contract

texts:
In this ERC721 implementation by 0xcert there is this _mint function:

function _mint(address _to, uint256 _tokenId) internal override virtual {
    super._mint(_to, _tokenId);
    tokens.push(_tokenId);
    idToIndex[_tokenId] = tokens.length - 1;
}

I need to understand the use of super._mint here, what is the logic behind this?


texts: Where is the state root being updated in Aleth CPP?

texts: Can someone point me to where the state root is updated after each transaction is executed in the block? This is for Aleth


texts: I have a huge ᴀʙɪ file in the ᴊꜱᴏɴ fomat but third party’s contract’s code is private. How to generate the list of function selectors?

texts:
I have an abi file with lot of functions for a large contract. It would really take a lot of time to generate by hand the hash of each functions/methods.

Since the source code isn’t public, how to automatically get the full list of function selectors for such file (with the aim of getting function name for each selector hash) ?


texts: which client produced the gasUsed on Etherscan?

texts: There are many EVM implementations, such as js-EVM, Py-EVM and geth. So I was wondering which EVM implementation generated the gasUsed on Etherscan (i.e., the gasUsed got by using web3) ?


texts: The current documentation does not go into detail about the structure of the result returned by an event. In this thread and this question, there are mentions about the fields of the result returned by an event listener but where is the documentation?


texts: Truffle: provide a different config file name via the CLI?

texts:
I've read through the Truffle docs on configuration, but I haven't found the option of providing a different file name other than truffle-config.js or truffle.js.

In my case, I need multiple files because I have different compiler settings when running coverage on my smart contracts.

Is there something I missed or this is not an available feature as of now?


texts: Infura web3 provider for Events (.get & .watch)

texts:
I am using infura for connecting to testnet/mainnet as my server side web3 provider.

This works for most requests and operations, but it does not seem to work for Events.

const allEvents = (event, callback) =>
  event({}, { fromBlock: 0, toBlock: 'latest' }).get((error, results) => {
  if (error) return callback(error);
  results.forEach(result => callback(null, result));
  event().watch(callback);
});

allEvents(contractInstance.Event, eventCallback);

The code above runs locally (connecting to a localhost:8545 provider / geth) but does not run if I use infura:

// THIS DOES NOT WORK:
const web3Url = `https://ropsten.infura.io/${infuraKey}`;
const web3 = new Web3(new Web3.providers.HttpProvider(web3Url));

// THIS WORKS:
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));

Any suggestions or alternatives for web3 providers?
Thanks.


texts:
I'm building a new smart contract but really can't figure out how to perform integer division. I know that fixed point numbers haven't been implemented yet but it should be possible to perform 100/3 = 33, at least.
I hope someone can help me. I have seen multiple examples where they talk about rounded integer division but can't seem to be able to perform it.
Cheers,
Hugo


texts:
I created a erc20 contract with a total supply of 40,000,000.
10 mil was sent to my wallet and 30 mil suppose to go to investors.

When someone invest, how can I send him tokens from my contract to his erc20 wallet?

Thanks.


texts: How to deploy Ethereum Alarm Clock contract on a private ethereum network?

texts:
Ethereum Alarm Clock:

  Schedule Contract Function Calls An ethereum contract that facilitates
  scheduling function calls for a specified  block in the future.
  Function calls can be scheduled to be executed against any contract
      Scheduling can be done by contracts or ethereum account holders.
      Fully contained within the ethereum network.

[Q] How could I use Ethereum Alarm Clock (mainly Scheduler.sol contract) on a private ethereum network? Manually I have tried to compile contracts/* libraries/* files that located inside source code using Solidity Browser, but I face with following errors that I was not able to fix.

On CallLib.sol file

Untitled:474:25: Error: Fallback function cannot return values.
    function () returns (bool) {
                        ^----^
Untitled:394:16: Error: Explicit type conversion not allowed.
        return State(CallLib.state(call));
               ^------------------------^

On SchedulerLib.Sol:

Untitled:191:20: Error: Member "value" not found or not visible after argument-dependent lookup in function (address,uint256,uint8,address,bytes4,bytes memory,uint256,uint256,uint16,uint256,uint256) returns (contract FutureBlockCall) - did you forget the "payable" modifier?
        var call = (new FutureBlockCall).value(callConfig.endowment)(
                   ^-------------------------^

Thank you for your valuable time and help.


texts: Web3.js function 'sign' - where does it obtain the private key from?

texts:
I'm reading Web3.js docs on function web3.eth.sign (here), which state:

  The address parameter can also be an address or index from the web3.eth.accounts.wallet. It will then sign locally using the private key of this account.

But how exactly does it obtain the private key of the given account?

Thank you!


texts: Error => invalid address, on passing arguments to function

texts:
so I created a function but then I needed to make it dynamic so that I will be able to call the same function body just bypassing the arguments on click of a button
I am fetching the values from HTML and can view them on the console

<button type="button" value="Bet" class="btn-primary" id="player1">
      Player 1 Bet </button>

<button type="button" value="Bet" class="btn-primary" id="player2" >
      Player 2 Bet </button>

app.js

function ready(){
document.getElementById("bet").addEventListener("click", function(e){
    e.preventDefault();

    var fromAddress1 = document.querySelector("#bet #fromAddress1").value;

    var fromAddress2 = document.querySelector("#bet #fromAddress2").value;

    console.log(fromAddress1) ----->> THIS WORKS i can fetch address

OraclizeContract.deployed().then(function(instance, fromAddressX) {
  console.log(fromAddressX)  -------------------->>UNDEFINED
  console.log("Initializing");
  instance.deposit({from: fromAddressX,
                    gas: 3000000,
                    value: web3.toWei(betAmount, 'ether')}) //betAmount is a input box and fetching its value into betamount variable and passing it over here
                               .then(function(v){
                                       console.log(v);
                                       console.log("Function Executed");

                                 });
                       }).then(function() {
                                              console.log("Testing");
                       }).catch(function(e) {
                                               console.log(e);
                       });

console.log(fromAddress2); ------------>>>>WORKS
document.getElementById("player2").addEventListener("click", function(e, fromAddress2){

  });
  document.getElementById("player1").addEventListener("click", function(e, fromAddress1){

  });

}) -->> ending event listener

} -->> ending ready function

HTML FILE

  <form id="bet">

            Player 1 - From address:
            <input type=" type" class="form-control" id="fromAddress1">

As you can see before passing the variable, if I print on the console it displays the correct address
But inside the function it prints undefined
My code already has default account setup, so I am confused about how to mitigate this issue
I think I am not passing the arguments correctly
Any help is highly appreciated
Thank you


texts:
I got a wallet from https://www.myetherwallet.com/ and then I downloaded all the files (keystore, qr.pdf and private key). Then I compressed (zip) these files using a password I can't remember (yes, that's stupid).

So basically I have the public key, the name of the keystore file and the password of the keystore file. What would you recommend to recover the private key ?

So far I tried fcrackzip with a dictionary of passwords I usually use. But no success... I wonder if there might be another way of recovering these files.


texts:
Is there a practical way (preferrably OSS library or implementation) to verify Ed25519 signatures in Solidity (compiled for and run on the EVM), in smart contracts?

Update: I've created EIP665


texts: Access Ethereum smart contract in Java application

texts: I have developed smart contract in solidity using truffle and ganache. Now, I want to access that smart contract using some API. So how to do it ? Should I need to use web3j compulsory or is there any other way to do that ?


texts: Wouldn't a 64bit-based EVM be more efficient on the Ethereum Ecosystem?

texts:
As the Ethereum Rationale design says:

  32 byte word size - the alternative is 4 or 8 byte words, as in most other architectures, or unlimited, as in Bitcoin. 4 or 8 byte words are too restrictive to store addresses and big values for crypto computations, and unlimited values are too hard to make a secure gas model around. 32 bytes is ideal because it is just large enough to store 32-byte values common in many crypto implementations, as well as addresses (and provides the ability to pack address and value into a single storage index as an optimization), but not so large as to be extremely inefficient.

But the thing is:

A 256 bit EVM implementation helps in order to work with addresses, and that's true. But as Ethereum isn't defined as a Cryptocurrency system, so the most important part of the data wouldn't be addresses, would be data used on smart contracts.
If the majority of the CPU's on the market actually are made with a 64-bit architecture, and a high percentage of the data which we work with on Ethereum Ecosystem is approximately the same (64 bit, 32 bit, 16 bit, 8 bit..). Do you think an EVM based on a 64-bit architecture or something like that wouldn't improve the performance of all of the system?

Think about it, if you have to iterate an array of 32 or 64 bit data and the EVM memory blocks are 256-bit, it's extra work for the CPU to do the calculations, and a lot of time is lost.

If you think this would be a possible improvement to do, is there any initiative or EIP open? I haven't seen anything.

Thanks.


texts: Why MyEtherWallet and ethjs-signer produce different signatures for the same transaction?


texts:
I tried solutions provided in ethereum stack, but nothing worked for me.

My smart contract file:

pragma solidity ^0.4.15;

contract Election {

    string public candidate;

    function Eletion () public {
        candidate = "Candidate 1";
    }
}

Migration file:

var Election = artifacts.require("./Election.sol");

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

Im getting the following Error

  Using network 'development'.

  Running migration: 2_deploy_contracts.js

  C:\Users\jeevastella\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:59973
  throw new Error("Could not find artifacts for " + import_path + " from
  any sources");
          ^ C:\Users\jeevastella\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:59973
  throw new Error("Could not find artifacts for " + import_path + " from
  any sources");   ^

  Error: Could not find artifacts for ./Election from any sources
      at Resolver.require (C:\Users\jeevastella\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:59973:9)
      at Object.require (C:\Users\jeevastella\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:69602:36)
      at ResolverIntercept.require (C:\Users\jeevastella\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:197047:32)
      at C:\Users\jeevastella\Desktop\election\migrations\2_deploy_contracts.js:1:26
      at Script.runInContext (vm.js:107:20)
      at Script.runInNewContext (vm.js:113:17)
      at C:\Users\jeevastella\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:101639:14
      at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)


texts: how to securely share digital asset in a fully decentralized DApp

texts:
I want to design a proof of concept of a fully decentralized secure asset sharing DApp. Seller uploads the asset they want to share with a price and buyer pays it with ether or a token. Frontend and asset file is hosted on Swarm, and hash address of the Swarm is stored in smart contract. Is it possible to make this buying process synchronous using a symmetric or asymmetric key cryptography?

The problem is:

Ethereum transactions and smart contract data/logic are all open.
I put the asset file to Swarm encrypted, but since its hash address of Swarm is visible

  it should be encrypted for buyer

  buyer should receive decryption key

Swarm frontend supports only static web pages with JavaScript and HTML
In order to synchronously encrypt the file for a buyer, the unencrypted file should be hosted somewhere.

Is there a scenario i could achieve this?
Possible solutions i found are:

use secret stores of Parity
decentralized Oracles?
use Enigma or zk-snarks for ethereum.
asynchronous secret sharing with Whisper
include a centralized party (webserver? this is the last resort)- asynchronous secret sharing with Whisper


texts: How to simulate time increase in Remix IDE?

texts:
In my JavaScript tests:
module.exports = {
    increaseTime: (duration) => {
      const id = Date.now();

      return new Promise((resolve, reject) => {
        web3.currentProvider.send({
          jsonrpc: '2.0',
          method: 'evm_increaseTime',
          params: [duration],
          id: id,
        }, err1 => {
          if (err1) return reject(err1);

          web3.currentProvider.send({
            jsonrpc: '2.0',
            method: 'evm_mine',
            id: id + 1,
          }, (err2, res) => {
            return err2 ? reject(err2) : resolve(res);
          });
        });
      });
    },

}

In the Remix IDE?
I'm doing some manual debugging and I really wish I knew how to fast-forward the time?


texts: Detecting dropped and replaced transactions web3.py

texts:
I am using web3.py. Given a transaction hash, is there any way to determine if a transaction was dropped and replaced by another transaction with the same nonce? Currently i am looping w3.eth.getTransactionReceipt(tx_hash) in a try/except to detect when the transaction has been confirmed.
while(True):
    try:
        tx = w3.eth.getTransactionReceipt(tx_hash)
    except:
        continue

    break

If the transaction is still pending, it returns an error and reloops, trying again. If it succeeds, the loop is exited. However, if the owner of the transaction sends a new transaction with the same nonce, the tx hash i have will never be confirmed and this loop will never exit. How can i detect if this occurs?


texts:
I'm trying to understand some of the finer points of NFTs. What makes NFTs traceable? Is it the transaction history stored on the ledger? Is there anything else to it?
Key to the NFT's traceability is the _tokenID mapping correct (linked to OwnerOf)? How is the tokenID expressed? (It's an integer, right? Who or what determines what the integer/string is?) If I purchase an NFT, would I be able to look "inside" to see the tokenID, and to look at the metadata on Etherscan, or would I only be able to see the info available to me by linking my Eth wallet to an exchange like Rarible, etc?


texts: I often see inline assembly in Solidity contracts. I consider this a bad practice because of the poor readability, however this is my opinion only and there must be valid reasons to use it. There are no other means to reach the same results in pure Solidity code? and if not, doesn't this show a lack in the language design?


texts: More questions about changing a smart contract state (variable)

texts:
Assume we have a smart contract that has a state variable as follows:

uint data=32;

The contract is stored in the blockchain.

We have two transactions tx1, and tx2 sent to the contract one after the other. tx1 sums the variable with 40:

 data +=40,

and tx2 multiplies "the new state" by 50:

data *=50

Question: Do the nodes who verify tx2, have to re-run tx1 as well to calculate state before tx2 (i.e. data +=40) again?


texts: Is there any API for sending and receiving Ethers?

texts:
Is there any API for send and receive Ethers? If not, i am trying to use web3.js in my own server;

What are the technical implications?
Major security concerns?
Can I use the same API for creating address for public?
Are there any trust issues?


texts: Get latest block info with gas price, block time etc., from etherscan.io

texts:
I am trying to collect information such as,
'fast': 140, 'fastest': 165, 'safeLow': 100, 'average': 120, 'block_time': 8.875, 'blockNum': 10021935, 'speed': 0.8993211072506393,....etc. on the latest Ethereum block.

There are bunch of API provided in https://etherscan.io/apis but I am unable to get what I want. Any clue is highly appreciated.

The above example is shown from https://ethgasstation.info/api/ethgasAPI.json


texts: `web3.eth.abi.decodeParameters()` not returning correct values


texts: Is there a way to burn tokens at a set schedule / interval?

texts:
There are a lot of erc-20 tokens that burn 1-2% on every Transfer. The coins burned are part of the transaction, i.e. if I were to send 100 coins, you would only get 99 because the smart contract burned 1% of the coins in the transaction by sending them to dead address.
Is there a way to make the contract burn 1% of tokens every month or year, rather than per transaction?


texts: Migrating solidity program testrpc+truffle - Error: Invalid JSON RPC response: "" at Object.InvalidResponse

texts:
I am trying to make a truffle application.

  truffle compile : working fine making a 'build' folder with .json files in it.
  truffle migrate : Gives the following error
  I am running testrpc in another powershell window.
  OS :  Windows 8.1

Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (C:\Users\RK\AppData\Roaming\npm\node_modules\truffle\node_modules\web3\lib\web3\errors.js
:35:16)
    at XMLHttpRequest.request.onreadystatechange (C:\Users\RK\AppData\Roaming\npm\node_modules\truffle\node_modules\web3
\lib\web3\httpprovider.js:116:32)
    at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\RK\AppData\Roaming\npm\node_modules\truffle\node_modules\xhr2\l
ib\xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (C:\Users\RK\AppData\Roaming\npm\node_modules\truffle\node_modules\xhr2\lib\xhr2.js
:354:12)
    at XMLHttpRequest._onHttpRequestError (C:\Users\RK\AppData\Roaming\npm\node_modules\truffle\node_modules\xhr2\lib\xh
r2.js:544:12)
    at ClientRequest.<anonymous> (C:\Users\RK\AppData\Roaming\npm\node_modules\truffle\node_modules\xhr2\lib\xhr2.js:414
:24)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1278:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)


texts: how much does using ethereum services cost

texts: Lets say im creating my own cryptocurrency and my own blockchain on ethereum, what would be the basic costs for setting all this up if i am developing on Ethereum


texts:
I'm currently using geth and ethminer to mine, I'm using version 1.2.2 of Ethereum. I'm trying to mine on pool Ethereumpool, using these instructions. So my command is ethminer -G -F http://ethereumpool.co/?miner=20@0xe425AFC9cC425E88f911Ba9d4E77Eef763bCef22

I get spammed by the error "Failed to submit hashrate". Does anyone have a solution?