texts: Truffle test deploys everytime a new contract with .deployed()

texts:
I want to test some contracts^^ And now Im wondering because like I understand .deployed() should take the contracts from the migration in truffle and dont deploy new ones?
My test.js:
const one = artifacts.require("One.sol");
 const two= artifacts.require("Two.sol");

 contract('One and Two', async (accounts) => {

    let instance;

    let deployAccount = accounts[1];

    before(async () => {
        ione= await one.deployed();
        itwo= await two.deployed();
    })
    it("Two: should return the owner", async ()=> {
        const value = await itwo.getOwner.call();

        assert.equal(value, deployAccount);
    });

In my ganache browser I can see that always I run truffle test there will be 3 contracts deployed... (the default contract Migration.sol is the 3rd) But I only see the contracts that get deployed with "truffle migration"
So my question is:
Is it possible to dont deploy by running "truffle test" without deploying contracts that allready in ganache? Or is it possible to update ganache to see the last contract in the writer "contracts" that have been deployed?


texts:
with this code not possible deposit. I don't get any special error, only:
id:6449ed342beaee3b82363f7ecafd8fead18e6bcc3c3ace01db679a48210ea403resMessage:REVERT opcode executed
but from shasta account I can money missing.
function deposit() public payable {
        uint256 amount = 520000; //msg.value;
        address payable addr = msg.sender;
        addr.transfer(amount);
}


texts: Ethereum mist wallet not synchronising, not showing Ethereum and folder

texts:
I am a beginner at setting this up and I used a youtube tutorial to download Mist. The problem is it's not syncing the blockchains. I've tried to debug this by going to users/appdata and inside the Ethereum folder but inside there is only a geth and keystore folder.

I have sent some Ethereum to my account but cannot see it I'm assuming this is because it hasn't attempted to sync with the blockchains.

Please can someone help me as I'm totally stuck :(

Thanks


texts: A reliable way to disable/block contract creation when using eth_sendRawTransaction

texts:
I am looking for a reliable way to disable/block contract creation when using eth_sendRawTransaction via the JSON RPC. Do you think it is possible without changing the source code of geth/parity/ethereumj?

Looking at the other similar questions, I understand that the field to: should be null for a transaction to be considered contractCreate. However, when an HD wallet sends a raw transaction via the REST RPC there is a single field data: which contains only bytecode and no to: field. My idea is to limit contract creation on the network level and I am looking for a pattern in the data byte array or a decoding function that can let me guess the transaction type directly from the data: value.

Thank you for your suggestions!


texts: How to fix 'Waiting for roots to load...' in react-devtools for a dApp?

texts:
I am building a Parity UI dApp from the Skeleton dApp at https://github.com/paritytech/skeleton

and I want to debug it with Facebook's react-devtools

Since Parity renders the dApp in an iframe, I can't see it with the
Chrome extension, so I installed the standalone Electron version.

So I added a line to the dApp's HTML to source a script for the dev tools:

--- a/dist/index.html
+++ b/dist/index.html
@@ -1,6 +1,7 @@
 <!doctype html>
 <html lang="us">
 <head>
+        <script src="http://127.0.0.1:8097"></script>
        <meta charset="utf-8">
        <title>Skeleton</title>
        <link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>

and I hacked the Content Security Policy in handlers/mod.rs in
Parity's web server, to persuade Chrome to load a script from
react_devtools. I re-compiled Parity:

--- a/dapps/src/handlers/mod.rs
+++ b/dapps/src/handlers/mod.rs
@@ -67,7 +67,7 @@ pub fn add_security_headers(headers: &mut header::Headers, embeddable_on: Embedd
                // Allow fonts from data: and HTTPS.
                b"font-src 'self' data: https:;".to_vec(),
                // Allow inline scripts and scripts eval (webpack/jsconsole)
-               b"script-src 'self' 'unsafe-inline' 'unsafe-eval';".to_vec(),
+               b"script-src 'self' http: 'unsafe-inline' 'unsafe-eval';".to_vec(),
                // Restrict everything else to the same origin.
                b"default-src 'self';".to_vec(),
                // Run in sandbox mode (although it's not fully safe since we allow same-origin and script)

Now the react-devtools main pane shows:

  Waiting for roots to load...

  to reload the inspector [click here]

How do I get the tool to display my React components?

Versions: I compiled parity from the master branch, Chrome is 59.0.3071.115 (Official Build) (64-bit), and react-devtools is 2.5.0 as far as I can tell.


texts: How to create another contract from another contract using web3

texts:
Well I have contract which creates another contract:

contractA{
    function myMethod(address contractbAddress) payable public{
        address contractcAddress = (new contractC).value(msg.value)(msg.sender,address(this),contractbAddress);
        contractB(contractbAddress).setContract(msg.sender,contractcAddress);
        confirmEvent(msg.sender,contractcAddress);
    }
}
contractB{
    function setContract(address sender,address contractcAddress){
        ....
    }
}
contractC{
    function contractC(address sender,address contractaAddress,address contractbAddress){
        ....
    }
}

I have contractB's address and contractA's address when I deployed them using truffle migrate.

Now when I will call function myMethod using web3, how will it get to know what is contractC because they no longer have the source code of it?


texts: Why solidity doesn't use " Null " and "undefined"?

texts: Like Python or any other language why does Solidity avoid having the Null and undefined properties?


texts: How to race condition attack where another party can make my transaction invalid?

texts:
I am working on a pub/sub contract. Publishing involves posting (on chain) a message encrypted to each paid subscriber. The publisher must publish a message for each subscriber or the transaction will revert, this is to make sure everyone gets a message they paid for.
That means if a new subscription sneaks in before a publish, the publish transaction will revert and the publisher will waste gas. My current solution is to let publishers freeze subscription, wait a few blocks, and then publish and unfreeze subscription.
Is there a more elegant solution to this kind of problem? Perhaps I can access the number of subscribers n blocks ago? Or even just at the start of the current block if I assume the publisher's client has reasonably fast access to the network?


texts: There is any open source for mnemonic (recovery) phrase can be used in react project?

texts:
I want to know how to implement 12 words or 24 words mnemonic(recovery) phrase screen as "Create Wallet" part in the ethereum, ERC20 token wallet project built with React Native like as coinomi wallet.
Teach me any open or paid source to refer, blog, or sample code.


texts: How the multisignature process working after completed the contract process

texts:
I completed a contract creation process using Ethereum Wallet source code.

How can I use this contract from a web3 client (not from Mist) ?

Can you give some example workflows for using multisignature process ?


texts: Simple solidity code not returning any value with remix ide

texts:
pragma solidity ^0.4.24;

contract practice {

   int a = 10;

   function trial() public returns (int) {
       return a;
   }

}


texts: Sample showing how to store and retrieve a list of IPFS hash on Ethereum

texts:
I want to store a list of IPFS hash on a smart contract's function exposing a bytes32[] array.

I'm using web3.js and Solidity.

I have used multi-hash and/or some examples using bs58, but the value I retrieved and converted from the smart contract gives me a hash different from IPFS.

Do you any tips to share with me?

Thanks

Said


texts: Add accounts to truffle test environment at run time

texts:
I would like to add the keys and unlock some additional addresses at runtime for my truffle tests.

Why?  I have the need to create address from a seed generated elsewhere in my test so the private keys don't exist until part of the test has run.

I'm hoping to do something like this:

EthereumBip44 = require('ethereum-bip44')
# create the hd wallet
wallet = EthereumBip44.fromPrivateSeed(tree.keccak);
confirms = [
  wallet.getAddress(0)
  wallet.getAddress(1)
  wallet.getAddress(2)
  wallet.getAddress(3)
  wallet.getAddress(4)
]

And then later I'll need to send some transactions from these accounts.  How can I add them so that I can call one of my truffle functions from them?

contractCompiledWithTruffle.myFunction('dosomething', from: confirms[1])


texts:
I was wondering if there were any coders or anyone that could help me with the code where there would be a fee on transfer, let's say 9% for example, and 4.5% goes to a charity wallet and the other 4.5% to a locked liquidity pool wallet, possibly even 3% charity wallet, 3% static reward for dev wallet (if I burn my tokens at beginning ensuring safety), and the last 3% back into that liquidity pool wallet.
Further questions:
-How would I even implement it into a code?
-Is there a website where I could have the coin generated then just add the fee on transfer code?
-I see other tokens using this model, is there way I could just use their code?


texts: Uniswap: How do I distinguish between selling tokens and providing liquidity?

texts:
I want to implement different behavior in the transfer function of an ERC20 token if the transaction is swapping the token for ETH on Uniswap. The straight forward approach is, to check whether the associated uniswap pool is the recipient of the transfer. But that would also hold true for liquidity providing, in which tokens get transfered to the same address (Uniswap pool) and I want to apply a different logic for liquidity providing. How can I achieve this?
One thing I thought of was an additional contract for liquidity providing that can act as a proxy. Users could call a function on said contract, which would do the liquidity providing. The transfer function could then check whether the sender of a transaction is that contract and apply different behavior. But I am not sure whether this would work out.

Edit:
To explain the aim more precisely: I want to burn tokens on sells but not when liquidity is provided. Therefore I reworked the transfer function in my token:
function myTransfer(address sender, address recipient, uint256 amount) internal {
        if (sender == uniswapPool)
        {
            _transfer(sender, recipient, amount); // no burn when buying
        }
        else if(recipient == uniswapPool) // burn 10% for selling
        {
            uint256 burn = amount.div(10);
            uint256 amountSent = amount.sub(burn);
            _transfer(sender, recipient, amountSent);
            _burnFrom(sender, burn);
        }
    }

But with this code in case of liquidity providing, tokens would also be burned.

Is there a way I can find out in my transfer function whether we are sending tokens to the pool for selling/swapping them or for liquidity providing?
If not: How can I work around the problem?


texts: Measuring transaction latency and throughput in a multi node local private network

texts:
I'm quite new to Ethereum. I'll give a bit of context of my setup.
I have created an Ethereum private network with Ethash (PoW) as the consensus algorithm. I’m aware of the resource consumption of this protocol (I need to analyze this protocol) .Each node (Geth) is deployed in a Docker container and all nodes are discoverable. I'd like to send some transactions to stress the system and measure transaction latency and throughput. What's the best way to do so? Are there any logs I can analyse after stressing the system?
I’m not looking for tools like ethstats, I need to collect these measurements and plot some graphs.


texts: Control structure with truffle (assert and require)

texts:
When I'm trying to deploy contracts that contain assert and require using truffle I receive

Error: Undeclared identifier.

e.g:

pragma solidity ^0.4.8;

contract Owned{

    address public owner = msg.sender;

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

    function kill() onlyOwner{
        require(msg.sender ==owner);
        suicide(owner);
    }
}

I know that in the past truffle created its own assert.sol but surely they've updated it to be consistent with Solidity, and it doesn't explain why require also fail.

I'll highly appreciate any thoughts on how to overcome this issue.


texts: Main use cases between Open Blockchain and Ethereum

texts:
Looking at Open Blockchain's use cases and it appears a lot of these can be done or are on Ethereum, examples: multi-sig contract activation, execution, atomicity of contract execution, reusable contracts, etc.

What are the main use cases of Open Blockchain (OBC), that are not supported by a combination of the Ethereum public blockchain, and private blockchains?  Or what might be more suitable to implement on OBC instead of Ethereum?


texts: Deploy contract with truffle, how to call in Nethereum?

texts:
I am currently deploying my ChangeManager contract in truffle and I want to call the contract later in Nethereum.
For this I need the contract address in Nethereum. I figured I could just create an event which is emitted in the constructor like so emit ChangeManagerEvent(address).
Currently I am testing this in a truffle testsuite but I can't seem to filter for the events triggered in the constructor of my ChangeManager contract.
How can I subscribe to events which have been emitted by the constructor in truffle?

contract('ChangeManager', function (accounts) {
it('should have emitted event with contract address', async function () {
    changemanager = await  ChangeManager.deployed();
    var event = changemanager.allEvents();

    event.watch(function (error, result) {
        if (!error)
            console.log("Result: ", result.event);
    });
});

The goal of this undertaking is to call the contract in Nethereum after I have received the constructor event there. Maybe you have a better suggestion how I could access a contract deployed by truffle in Nethereum.


texts: I'm working on a personal project which tracks data of BTC token pairs. I'd like to do the same with BNB and liquidity tokens but I'm very ignorant about this subject. I'd like to know what's a specific token liquidity so I'm able to track that data. Is there any source I can find this information?


texts:
I have a problem with development of the smart-contract for ICO: i need to  implement accounting of tokens, which will be sold outside the smart-contract (e.g. if somebody bye tokens with other crypto-currencies). I can't imagine, how it's possible?
How we can buy tokens without smart-contract?
How i can account it?
Tried


texts: How do two parties verify a transaction initially?

texts:
Sorry for the beginner question. Im trying to understand how a blockchain transaction is initially verified by both parties.
I think I understand the process of externally verifying a transaction but how do two people initially verify that they want to transfer money (for example).
For example, what stops person A from submitting a transaction saying person B is transferring them all their money?
Thanks for your help!


texts: Is it normal to have Invalid opcode in a contract?

texts:
I was debugging my smart contract, while I did not encounter an invalid opcode error, I saw a lot of invalid opcodes in my deployed contract. Screenshot is from remix debugger. Is it normal to have these invalid opcodes in your contract? I'm thinking it is probably because my contract didn't consider some edge cases that may cause a failure.

So, if in a perfect world, a perfectly written contract, does it mean that contract would not have any invalid opcodes in there?


texts: eth_gasPrice often returns 20,000 Babbages, but not always. Why?

texts:
According to https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gasprice rpc-json method eth_gasPrice returns the current price per gas in wei. But I have several questions:

What does exactly mean "current price per gas"?
What does define the price per gas?
Shouldn't gas price always be 20,000 Babbages for coin transfer transactions?
Why most of the times when calling eth_gasPrice method it returns 20,000 Babbages, but from time to time it returns 21,912 Babbages or 21,905 Babbages, just a few seconds later?
Why effective gas price on completed transactions is always 20,000 Babbages, but never those funny and sporadic values (21,912 Babbages or 21,905 Babbages).
So gas price on transactions seems to be constant and a round number, while gas price when querying eth_gasPrice() is very volatile. Is eth_gasPrice() a reliable function? Should I trust it?


texts: Where does metamask store the wallet seed? (file path)

texts:
I have a Windows installation that cannot be booted anymore.

I'd like to copy the file containing the Metamask wallet seed to another machine and have that Metamask installation use it.

The same Metamask accounts were installed on both Firefox and Chrome on that Windows installation.

Does anyone know where the Metamask plugin stores its keys or wallet seed?

(I do not have the wallet recovery phrase, I do have the password)


texts: Unable to generate Go Ethereum Bindings using abigen

texts:
Not sure what the heck is going on, but I'm unable to use abigen to generate Go Ethereum bindings any more, I get an error that says EvalSymlinks: too many links

solidity@pop-os:~/Documents/Code/RTrade/Mining-Stake/solidity$ abigen -abi TokenLockupV2.abi -bin TokenLockupV2.bin -out test.go -pkg Test
EvalSymlinks: too many links


texts: Invalid JSON response when using web3js in nodejs with infura provider

texts:
I am trying to build a simple Dapp. Tested already in local testnet (test rpc), next wanted to test it in rinkeby.

Since I used web3 in server side, unable to capture injected web3 from metamask, so I am trying to use infura api. It is able to get the contract details, but fails with an event that too with error "Invalid JSON Response".

Here is the route.js code I am trying to connnect to infura
https://gist.github.com/parthi2929/7af62a5e24576864146db2d9d5379a61

Please find the rest of project files here (working with testrpc)
https://github.com/parthi2929/my-second-dapp

Why the event fires in first place (as per contract should fire only when setInstructor called).
Why event has error response (Invalid JSON response).

Note: Some people might ask to deploy geth to load rinkeby blockchain and connect to that, but the point is, I want to avoid running localhost and test it. That is why trying infura api which is supposed to have all blockchain data, and it also seem to have as it could get my account balance and contract info properly. Somewhere in event handling we are failing.

Please help.


texts: Is the term "open execution" wrong in any way?

texts:
I read a post discussing Ethereum, and how it can be thought of as the next step of the "open source" movement of software, and he coined the term "open execution," and I rather liked it.

The real question is whether or not this misses the mark, or only grasps a portion of the whole picture.  If it does, is there a similar way of putting it that hits the nail on the head?


texts:
I'm configuring the new PoA chain and facing some issues; I have created three nodes but it was not working. From the second transaction, all the new transaction not being confirmed and logs shows signed recently must wait for others all three nodes were showing the same message.
Hence I have decided to run single node first, so I removed static-nodes.json file run the node. To remove other addresses from signer list I have tried
From node1
lique.propose("address2", false)

From node3
lique.propose("address2", false)

But it still it shows all three addresses when I run clique.getSigners().
Then connected to node2 and self propose to remove, but no luck so far!
Is there any way to forcefully remove the signer addresses?


texts: How to let a function know that a specific input parameter is of ether value?

texts:
I am currently trying to build a prototype for a simple Ethereum based Ebay - I know there are already solutions for it, it is just for learning purposes.

Currently I am lacking the understanding on how to pass in changing ether values into functions. For example when I want to post a new auction:

struct Auction{
    address owner;
    uint price;
    string describtion;
  }

  Auction[] public auctions;

  function createAuction(address _owner, uint256 _price, string _describtion) public{
    Auction memory _auction = Auction({
      owner: _owner,
      price: _price,
      describtion: _describtion
    });

    auctions.push(_auction);
  }

This is the output of an example auction in remix after calling the getter of the auctions array:

When I am now adding a new auction, I can only hand it uint256 values, which makes the prices non-ether values. My question is, how can I let the function know that the price variable is of type ether?

PS. I tried to create a static global variable, which is of type ether and it gives me back the ether value in wei. But I still can't adapt this on how to give the function different ether values with each call.

 uint256 public auctionStartPrice = 0.015 ether;

      struct Auction{
    address owner;
    uint256 price;
    string describtion;
  }

  Auction[] public auctions;

  function createAuction(address _owner, string _describtion) public{
    Auction memory _auction = Auction({
      owner: _owner,
      price: auctionStartPrice,
      describtion: _describtion
    });

    auctions.push(_auction);
  }

  function getVAlueOfAuction(uint256 x) public returns (uint256 value){
      value = auctions[x].price;
      return value;
  }

Here is the output with the global variable as starting price:


texts: I set up a private in my linux system and create a new account using personal.createAccount. After I start mining using miner.start() . But i found block number is not increasing. Then I found my miner address is 0x000000000000000000000 using the command eth.getBlock(eth.blockNumber).miner . I changed miner coinbase and everything but it still shows miner is 0. How can i mine some ethers in private network or is there any way to change miner address.


texts: How to send signed transaction to Ropsten through INFURA in Golang

texts:
I want to send and broadcast a signed transaction by sender to the Ropsten network through INFURA in Golang.

I was able to send a signed transaction and recieved a response from INFURA as per below, however, this transaction hash seems not to be in Ropsten network because this cannot be found in https://ropsten.etherscan.io/.

{"jsonrpc":"2.0","id":69,"result":"0x44814c40f6193cb73d6f7aa2d0109c57e4586730564e1b08c3477f1b4e33d45c"}

Much appreciate if someone give me advice how signed transaction can be sent to Ropsten through INFURA.

Please refer to below my sample code.

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "io/ioutil"
    "math/big"
    "net/http"
    "strings"
    "unsafe"

    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/core/types"
    "github.com/ethereum/go-ethereum/crypto"
)

func SendRawTransaction(amount int64) (address string) {
    url := "https://api.infura.io/v1/jsonrpc/ropsten" //According to  https://infura.io/docs/api/post/network

    from := "0x98263A537a237364E9e835Af210acDF90efC2223"
    to := "0xab60821b9894fF2787077E6d9ef6ee997b60e350"

    //Preparing sign method
    chainID := big.NewInt(3) //ropsten
    prvKey := "7a01f6905db8252701220775de0190636b8956672417776e66c04670388df799" //PrivateKey of "from"
    senderPrivKey, _ := crypto.HexToECDSA(prvKey)
    recipientAddr := common.HexToAddress(to)
    nonce := uint64(20)
    amount := big.NewInt(100000000000000000) //ETH0.1
    gasLimit := uint64(100000)
    gasPrice := big.NewInt(20000000000)

    /***** Preparing Data struct of request body for send_RawTransaction *****/

    type Data struct {
        Jsonrpc string   `json:"jsonrpc"`
        Method  string   `json:"method"`
        Params  []string `json:"params"`
        ID      int      `json:"id"`
    }

    data := Data{}
    data.Jsonrpc = "2.0"
    data.Method = "eth_sendRawTransaction"
    data.ID = 69

    /***** Preparing params struct for Data.Params *****/
    params := Params{}
    params.From = from
    params.To = to

    /***** Preparing signed transaction *****/
    tx := types.NewTransaction(nonce, recipientAddr, amount, gasLimit, gasPrice, nil)
    signer := types.NewEIP155Signer(chainID)
    signedTx, _ := types.SignTx(tx, signer, senderPrivKey)

    /***** Encoding signed transaction by RLP *****/
    var buff bytes.Buffer
    signedTx.EncodeRLP(&buff)
    tmp := fmt.Sprintf("0x%x", buff.Bytes())

    /***** Adding Params to data *****/
    data.Params = append(data.Params, tmp)

    /***** *****/
    jsonStrByte, err := json.Marshal(data)
    if err != nil {
        fmt.Println(err)
    }

    req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonStrByte))
    req.Header.Set("Content-Type", "application/json")
    client := &http.Client{}
    res, err := client.Do(req)
    defer func() {
        io.Copy(ioutil.Discard, res.Body)
        res.Body.Close()
    }()
    if err != nil {
        fmt.Println("err: ", err)
    }

    type Response struct {
        Jsonrpc string `json:"jsonrpc"`
        ID      int    `json:"id"`
        Result  string `json:"result"`
    }

    var response Response

    temp := json.NewDecoder(res.Body)
    err = temp.Decode(&response)
    if err != nil {
        fmt.Println("err: ", err)
        panic(err.Error)
    }

    defer res.Body.Close()
    fmt.Println(response)

    return response.Result
}


texts: What are variables defined as functions in the abi?

texts:
I was experimenting with this simple contract on a test network:
contract HelloWorld {

  string public message;

  constructor(string memory initMessage) public {
      message = initMessage;
  }

  function update(string memory newMessage) public {
      message = newMessage;
  }
}

The corresponding abi that is created lists message as a function
...
{
inputs: [],
name: "message",
outputs: [{
    internalType: "string",
    name: "",
    type: "string"
    }],
stateMutability: "view",
type: "function"
}
....

Why is message listed as function? It seems pointless. If one instantiates this contract and calls mySimpleContract.message() nothing happens, it seems to generate an empty transaction. Why not have the abi define message as type "variable" instead of function?


texts: Good centralized data storage for Solidity types?

texts:
I'm looking for a good database client that operates well on uint256 and bytes32 mainly.

I can hack around this in postgres, but I'm wondering if there are any more obvious solutions?


texts:
I install geth and ethminer.exe and start two exe via cmd

https://i.hizliresim.com/o6Vly9.png

is this enough for mining?If yes Where will I will get coin from mining?
Should I create wallet and sync with geth or ethminer?

I am newbie at the ether mining.I install it in windows server 2008.I am trying to learn it.If I success I will buy more better PC for that


texts:
Current digital identities, such as passports, rely mainly on a centralized process that involves a personal claim (individual assertion) backed up by a proof (a valid document) which is then validated by an external authority who stores or has a copy of your personal data on centralized servers.

How decentralized identities aim to achieve individual global uniqueness without the need for a central registration authority?


texts:
I'm using parity in ropsten testnet.

My account address is 0x00562e88274Ac44752913955EEEd4CAa939C6abB. On etherscan it says that account balance is 4 ether but on parity it says that "There are no balances associated with this account". any ideas of what could be?
Thanks!


texts: geth Fatal: Failed to unlock developer account

texts:
I'm trying to start geth 1.8.1-stable-1e67410e with the following command:

geth --datadir="/custom-folder-path" --rpccorsdomain "*" --rpc --dev --mine --minerthreads 2 --rpcapi="debug,db,eth,net,web3,personal,web3" --unlock "0x42d9fa1776d5041d78e13549f295601d496b297f,c5a3b476d3f0ac4ee02cc74a03e73c9bad186b32,0481de49674c6b122fcc64bcb16396b1ada47107,c682648c18cd05f46a6e927ee057f58f92e2ca7f" --password "dev-blockchain-1-pwd" --ipcpath "/custom-ipc-path"

with the file dev-blockchain-1-pwd containing the four passwords:

asdasdasdasdasdasd1
asdasdasdasdasdasd2
asdasdasdasdasdasd3
asdasdasdasdasdasd4

In the past this command successfully fired up a local blockchain, but now it outputs the following

INFO [02-19|14:55:44] Maximum peer count                       ETH=25 LES=0 total=25
Fatal: Failed to unlock developer account: could not decrypt key with given passphrase

I've successfully unlocked the JSON wallet files on myetherwallet.com with the passwords in the dev-blockchain-1-pwd.

Have you got any clue on how to deal with this? Thank you


texts: How was this contract created with empty code?

texts:
I don't understand what happened in this transaction:

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

The transaction created a contract, sent 1 ETH, supplied input data, and did not run out of gas, but the result was a contract with no code.

https://etherscan.io/address/0xd8253352f6044cfe55bcc0748c3fa37b7df81f98#code

What happened here?


texts: Error while passing values from web3 to solidity

texts:
I have an HTML front-end that calls a function in a contract to create/deploy another contract. The function works standalone in remix. I get an error "Uncaught Error: Invalid number of arguments to Solidity function" but I send the right number of elements. The javascript code is:

var borrowerAddress = '0x...';
$("#makeLoanButton").click(function() {
    $("#loader").show();
    myOriginator.makeLoan($("#loanID").val(), borrowerAddress, $("#loanAmount").val(), (err, res) => {
        if (!err) {
           $("#loader").hide();
        }
   });
});

the solidity code is:

    function addLoan(address _newLoan) public {
        // Add loan to originator
        Loan myLoan = Loan(_newLoan);
        loans.push(myLoan) -1;
        originatorLoanBalance += myLoan.getBalance();

    } // function addLoan(address _newLoan) public {

function makeLoan(bytes16 _loanID, address _borrower, uint _loanBalance) payable public {
    // Create new loan
    Loan myLoan = new Loan(_loanID, _borrower, address(this), _loanBalance);

    // Add loan to loans
    loans.push(myLoan) -1;

    // Now add new loan to array
    addLoan(address(myLoan));

    // Send loan balance to borrower
    if (!_borrower.send(_loanBalance)) {
        revert();
    }

} // function makeLoan(bytes16 _loanID, address _borrower, uint _loanBalance)

Any suggestions?

Thanks!


texts: Why is the totalSupply of this token statically initialized to 5500000000?

texts:
contract UnixERC20 is StandardToken {
    function() {
        throw;
    }

    string public name;
    uint8 public decimals;
    string public symbol;
    string public version = 'H1.0';

    function UnixERC20() {
        balances[msg.sender] = 5500000000;
        totalSupply = 5500000000;
        name = "UNIWORTH COIN";
        decimals = 0;
        symbol = "UNIX";
    }

    function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);

        if (!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) {
            throw;
        }
        return true;
    }
}

Why is the totalSupply initialised to 5500000000, and is there any reason to predefine this value? How is the UNIX token different or unique from other tokens?


texts: Scrypt npm install fails with error C compiler cannot create executable

texts:
Can you please help me with this error?

dhcp-rhodes-571:harberger-token kishorpatil$ sudo npm install scrypt

> scrypt@6.0.3 preinstall /Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt
> node node-scrypt-preinstall.js

Error: Error: Command failed: ./configure
configure: error: in `/Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details

> scrypt@6.0.3 install /Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt/build'
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/kishorpatil/blockchain/radical-markets/harberger-token/node_modules/scrypt
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/kishorpatil/blockchain/radical-markets/harberger-token/package.json'
npm WARN harberger-token No description
npm WARN harberger-token No repository field.
npm WARN harberger-token No README data
npm WARN harberger-token No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kishorpatil/.npm/_logs/2018-07-15T14_50_36_660Z-debug.log


texts:
Hey guys I am new to blockchain development and I have made my first project just messing around and I am currently trying to migrate the contracts to the BSC testnet. But I am getting the following error
I am using truffle
Any help would be much appreciated. I am not sure how to troubleshoot it well. So any additional details that are required let me know


texts: Unable to retreive transaction balance before / after transfer

texts:
I am trying to wrap my head around the go ethereum library and sending transactions.

The issue is that I want to be able to query the balance BEFORE the transaction and AFTER. The code below gives me the same value even after making a second call to retrieve the balance and print it.

I have cut out bits of code that I think are superfluous to the question :

func main() {
    client, err := ethclient.Dial("https://rinkeby.infura.io")
    if err != nil {
        log.Fatal(err)
    }

    privateKey, err := crypto.HexToECDSA("49be7f9b459942977f07f99653b5b042144baefa092c5ac833d6ec9893a5b8dd")
    if err != nil {
        log.Fatal(err)
    }

    publicKey := privateKey.Public()
    publicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)
    if !ok {
        log.Fatal("error casting public key to ECDSA")
    }

    fromAddress := crypto.PubkeyToAddress(*publicKeyECDSA) // Under stand where this goes *publicKeyECDSA

    balance, err := client.BalanceAt(context.Background(), fromAddress, nil)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Address: %d \nBalance:%s\n", fromAddress.Hex(), balance) // This is the first call to retrieve the balance

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

    value := big.NewInt(100000000000000) // Remember to read go docs for big.NewInt

    gasLimit := uint64(21000)

    gasPrice, err := client.SuggestGasPrice(context.Background()) // What's in SuggestGas Price??
    if err != nil {
        log.Fatal(err)
    }

    toAddress := common.HexToAddress("0x4592d8f8d7b001e72cb26a73e4fa1806a51ac79d")

    tx := types.NewTransaction(nonce, toAddress, value, gasLimit, gasPrice, nil) // All Parameters from Transactions in Whitepaper

    signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, privateKey)
    if err != nil {
        log.Fatal(err)
    }

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

    balanceAfterSend, err := client.BalanceAt(context.Background(), fromAddress, nil) // Second call to retrieve balance after transfer has been broadcasted
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("tx sent: %s\n", signedTx.Hash().Hex())
    fmt.Printf("Balance After Transfer : %d\n", balanceAfterSend) // This still gives the same value as the balance before.

}

When I run the program, I get the follow output in my terminal:

Balance:18749516000000000000
tx sent: 0x67a3b7f3d33253f2465ebc6d1cdf5b26cfac0b8d7a3c247ff184b06d46badfd2
Balance After Transfer : 18749516000000000000

I will appreciate any pointers on this.


texts:
I am trying to figure out how to have the balance of all players reset to (amount) when a certain condition happens. This is the function that will update a specific player balance. How do I make it reset the balance of all players at once?

mapping(address => uint256) investments;
mapping(address => uint256) joined;
mapping(address => uint256) withdrawals;
mapping(address => uint256) withdrawns;

// add deposit to curent deposit, and update joined timer
   investments[_customerAddress] = investments[_customerAddress].add(_incomingTronix);
   joined[_customerAddress] = block.timestamp;

   emit Invest(_customerAddress, _incomingTronix);
}


texts: API or any other method to gather list of all token holders for a large number of ERC-20 tokens

texts: I know Bloxy provides this, and a number of other services. However, they have a limit of 1 request per second. This does not work for me since I need to search for thousands of tokens. Any idea how to solve that issues. Etherscan seem to do a good job on it, but they don't provide API for that endpoint.


texts: Error while refreshing pending block on main: Post http://127.0.0.1:8545: dial tcp 127.0.0.1:8545: getsockopt: connection refused

texts:
i have this problem :

Error while refreshing block template on main: no mining work available yet

https://github.com/sammy007/open-ethereum-pool/issues/387

this dident help

https://github.com/sammy007/open-ethereum-pool/issues/76

any of the great developers here can help me

with all of respect for all of you guys

Features
This pool is being further developed to provide an easy to use pool for Ethereum miners. This software is functional however an optimised release of the pool is expected soon. Testing and bug submissions are welcome!

Support for HTTP and Stratum mining
Detailed block stats with luck percentage and full reward
Failover geth instances: geth high availability built in
Modern beautiful Ember.js frontend
Separate stats for workers: can highlight timed-out workers so miners can perform maintenance of rigs
JSON-API for stats
Proxies
Ether-Proxy HTTP proxy with web interface
Stratum Proxy for Ethereum
Building on Linux
Dependencies:

go >= 1.9
geth or parity
redis-server >= 2.8.0
nodejs >= 4 LTS
nginx
I highly recommend to use Ubuntu 16.04 LTS.

First install go-ethereum.

Clone & compile:

git config --global http.https://gopkg.in.followRedirects true
git clone https://github.com/sammy007/open-ethereum-pool.git
cd open-ethereum-pool
make
Install redis-server.


texts: Is it possible to self-define a public/private key pair for a wallet?

texts:
Specifically, if I had valid, secure keys stored in variables from somewhere else, could I use those to initialize a wallet? Or do keys have to be generated by the wallet software?

Thank you for your insight. Working on a project with friends to learn about Ethereum.


texts: Can one create a system with cryptocurrency and fiat on same platform?

texts: Is it possible to create a platform by writing smart contracts on the Ethereum blockchain in which anyone can transact using any cryptocurrency and/or fiat? Perhaps the fiat can be converted internally into ether.


texts:
to me ERC-20 tokens are a sub-class of Ether, yet they are referred to as "non-native tokens". Why would they be called non-native? What would be native in the Ethereum sense then?
Cardano-based tokens, on the other hand, to be released on Monday on the Cardano blockchain's Mary Hard Fork, are referred to as "native tokens". Why do Cardano tokens get to be called native tokens, whereas ERC-20 tokens are called non-native?


texts: How to validate information on the network?

texts:
This question details sending a message with Ethereum  :How do I send an arbitary message to an Ethereum address?. Say we have two parties P1 & P2 , if P1 sends a message to P2 how can P2 verify the message sent by P1 is what has been stored on the network/blockchain ?

Is this implicitly guaranteed by Ethereum ?


texts: Smart contract frameworks with different solidity versions

texts:
I have created a smart contract that relies on Openzeppelin (solidity >=0.6.0 <0.8.0) and Moneylegos (solidity ^0.5.0). I was wondering what version I should specify on truffle, in order to get the contract compiled. Now it is giving the following error:
Error: Truffle is currently using solc 0.7.4, but one or more of your contracts specify "pragma solidity ^0.5.0".
Please update your truffle config or pragma statement(s).


texts: What should be optimal gas limit and gas price for 80 addresses airdrop?

texts:
This is my airdrop function:

mapping (address => bool) public airdrops;
function airdropTokens(address[] _recipient, uint256[] _tokens) public onlyOwner{
uint airdropped;
for(uint256 i = 0; i< _recipient.length; i++)
{
      airdrops[_recipient[i]] = true;
      require(token.transferFrom(msg.sender, _recipient[i], _tokens[i] * decimalFactor));
      airdropped = airdropped.add(_tokens[i] * decimalFactor);
}

}

What should be optimal gas limit and gas price for this? I initially used, gasPrice = 50000000000 and gasLimit = 4500000, which works out at $47.27. Is this normal? I managed to successfully send a batch of 20 addresses at 3.5 GWEI / 2500000 Gas limit see: airdrop to 20 addresses transaction

But for other batch of 80 addresses, it failed at 4 GWEI / 4500000 Gas limit, see link here
Any ideas on how to manage the gas better? If I was to send out the 350 more batches at the recommended prices, it would cost me around £16k!!

P.S: Currently, each airdrop transaction is sending tokens to 80 addresses at once.


texts: I'm running a geth full node on ubuntu 16.4 server. Recently, I got multiple bandwidth usage notifications from my hosting. They told me that my server has consumed a couple hundred gb and the average consumption is more than 100gb per day. Initially, I thought that my server was under DDoS. However, later I discovered that Geth was causing the problem. After I set -maxpeers=0 my traffic went back normal. How to config Geth to use only reasonable bandwidth?


texts:
owner = msg.sender();

It gives me 2 errors

Type tuple() is not implicitly convertible to expected type address

and

Type is not callable

I'm just trying to do a simple ERC20

Compile with

        owner = msg.sender;

But I think I want to use the ().


texts: How to add a new node to a blockchain from my web interface

texts:
i want to create a new account(user) and add it to my private blockchain from my web interface ?

any exemple or idea please !

i work with eris platform


texts: How to check if geth node is running ,from web3j code

texts:
I am connecting to Geth using Web3j plugin.

web3j = Web3j.build(new HttpService("http://<ip>:<port>"));  // defaults to http://localhost:8545/

However, if the Geth node is not started, I need to throw an exception. How can I find if the Geth node is started or no using web3j java code ?


texts: Web3js events and their callback functions are not aware of component state?

texts:
I have problem with web3js 1.2.9
Events triggering works fine and data is alright but I cannot figure out how to use component state in this functions that are triggered by event.
I cannot access state of that component where watch event is initialized.
this.state.contract.events.NewUserCreated()
             .on("connected",function (subscriptionId) {console.log("SubscriptionId  ",subscriptionId)})
             .on("data",function (event) {
                 console.log("Event ",event)
                 console.log("Current users")
                 console.log(this.state.users)

             })


texts: Access contract by address, without knowing implementation

texts:
I want to access and interact with a deployed contract. My restriction: Knowing the API (functions, fields), but not the implementation.

I was looking at the Ethereum documentation "Accessing Contracts and Transactions" (http://ethdocs.org/en/latest/contracts-and-transactions/accessing-contracts-and-transactions.html).

They have this Web3.js

var source = 'contract Multiply7 { event Print(uint); function multiply(uint input) returns (uint) { Print(input * 7); return input * 7; } }';
var compiled = web3.eth.compile.solidity(source);
var Multiply7 = web3.eth.contract(compiled.Multiply7.info.abiDefinition);
var multi = Multiply7.at("0x0ab60714033847ad7f0677cc7514db48313976e2")
multi.multiply.sendTransaction(6, {from: "0xeb85a5557e5bdc18ee1934a89d8bb402398ee26a"})

However, this requires to know the implementation of the contract, which does not make sense to me.

Thanks for any help.


texts: Inspecting private variables of a contract

texts:
In the solidity documentation, it is written

  Everything that is inside a contract is visible to all external
  observers. Making something private only prevents other contracts from
  accessing and modifying the information, but it will still be visible
  to the whole world outside of the blockchain.

I also read this answer.
Can anyone suggest a step to step process of inspecting private variables of a smart contract using the Ethereum data I stored on my system?


texts: Why did the batchOverflow hack in the "BEC" contract work?

texts:
I am currently learning about how the current batch overflow happens. But there are some points I don't understand.
The article says following:

  The vulnerable function is located in batchTransfer and the code is
  shown in Figure 2. As indicated in line 257, the amount local variable
  is calculated as the product of cnt and _value. The second parameter,
  i.e., _value, can be an arbitrary 256 bits integer, say
  0x8000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000(63
  0’s). By having two _receivers passed into batchTransfer(), with that
  extremely large _value, we can overflow amount and make it zero. With
  amount zeroed, an attacker can then pass the sanity checks in lines
  258–259 and make the subtraction in line 261 irrelevant. Finally, here
  comes the interesting part: as shown in lines 262–265, the balance of
  the two receivers would be added by the extremely large _value without
  costing a dime in the the attacker’s pocket!

The image to the article:

So now, when the hacker enters the number, the number get's extremely huge. In the next step, the number even gets higher with multiplication with cnt which is the amount of receivers (let's say 2).

Why did the execution not stop in the line 259 as the amount the hacker transferred was way higher than his balance?

Can someone please explain to me what exactly happened here?


texts: How do I "Add Data" to a send transaction in Solidity

texts:
In myetherwallet, there is an +Advanced: Add Data Section where I can add data to the transaction.

How can I add this same data in a transaction I make in Solidity?


texts: what address(0) means? more specific where those token go?

texts:
I am trying to get balanceof an address but i dont know what i should input for address token.  I looked at some other answers. One answer said the tokens send to address(0) is burn. What does that mean? Does it mean no one receive the tokens?
function deposit() payable {
tokens[address(0)][msg.sender] = safeAdd(tokens[address(0)][msg.sender], msg.value);
lastActiveTransaction[msg.sender] = block.number;
Deposit(address(0), msg.sender, msg.value, tokens[address(0)][msg.sender]);
}

function balanceOf(address token, address user) constant returns (uint256) {
return tokens[token][user];
}


texts: Subscribe to eth3 transactions to a particular address

texts:
I'm trying to get a stream of all transactions being sent to a specific contract. Is there a way to add a filter to the below code to do that, or is it better to get all transactions and filter them as they come in?

As a followup, instead of using 'pendingTransactions' is there a way to get transactions that have been included on X blocks and can therefore be considered 'confirmed'?

subscription = web3.eth.subscribe('pendingTransactions', function (error, result) {
}).on("data", function (transactionHash) {
        web3.eth.getTransaction(transactionHash)
            .then(function (transaction) {
                console.log(transaction);
            });
    })


texts:
Why does warning appear with inheritance of constructor?

contract MyToken is ERC721Token{
function MyToken(string _name, string _symbol) ERC721Token(_name, _symbol) public {
}

The content of the warning is

  zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol:38:3: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use
   "constructor(...) { ... }" instead.
    function ERC721Token(string _name, string _symbol) public {
    ^ (Relevant source part starts here and spans across multiple lines).
  ,/C/twork/702_Ethereum/ERC-OPZ/myERC721/contracts/MyToken.sol:8:3: Warning: Defining constructors as functions with the same name as the contract is deprecated.
   Use "constructor(...) { ... }" instead.
    function MyToken(string _name, string _symbol) ERC721Token(_name, _symbol) public {
    ^ (Relevant source part starts here and spans across multiple lines).

I am using truffle v4.1.7
           solidity v0.4.23

Thanking you in advance


texts: Are gas fees higher when the Ether price is higher?

texts:
If someone wants to move 10 ETH from an exchange like Coinbase to their hardware wallet, will gas fees be higher when the ETH price is 1,200 or 1,500? In other words, would it be cheaper to move the crypto while the price of ETH is lower rather than wait when the price is higher?
I have no idea how Ethereum gas fees are calculated based on the number of ETH being transferred and would like to preview those fees before entering market orders on exchanges, who seem to just dream up what the gas cost will be on the spot. Could someone link the most reliable gas fee calculator that doesn't sit on an exchange?


texts: ICO for a startup I am planning to build but have some questions

texts:
I am an software developer with over 11 years of experience in industry and has worked as a software developer for some of the leading firms in vacation rental space. I recently started playing around with solidity and have a solid dapp idea but I am slightly confuse with certain things so hope you guys can help me understand this.

Background:

I have been working on a project and have created a tool which is a dream for online marketers. There are some tools out there like this for marketers and one of them did over 100 Million last year alone which charges roughly $100/month for subscription and the tool I created is much more sophisticated and better than what is currently available as a paid service. I want to create a lite version of this tool as a DApp so marketers can subscribe for it and pay with ethereum. The marketers will also be rewarded tokens for using the platform.

ICO Idea:

The ICO will start with a soft cap of 500000 tokens priced at $1 and a hard cap of 1000000 tokens as hard cap to raise maximum amount of $1 million . The total tokens will be 10000000. 50% tokens will be for investors but only 10% tokens will be dispersed to investors in the first ICO as I do not need a lot of money since most of the project is already built. 30% tokens will be reserved for users and 20% of the advisors, developers, team, bounty, airdrop etc.

Questions:

I am planning to make this a little more than investment for investors so I am thinking of rewarding the investors. For that I am thinking of giving the 50% of revenue of this DApp back to the token holders. The more tokens you have the more you earn as a investor. For example the startup made roughly $1 million as ether from subscriptions so $500000 worth of ether will be dispersed to all the token holders depending on the amount of token you hold. For example there are 500000 token holders that means each token will get $1 of ether back as return so an investor who invested in 100 tokens will get $100 worth of ether, 500 tokens will get $500 worth of ether and so on. Is there something wrong in this approach ?
Since the token holders will be rewarded for the investment that means the marketers who will use the platform are rewarded with tokens which means they will also get some return because of the tokens they earned by using the platform. You guys think this is the right approach ?
Since I created the tool and it is much extensive and I just need to take some of the pieces out and create a Lite DApp of the entire platform should I  do it before the ICO or should I demo it to investors after they have invested ?

P.S If there are any other things I am missing please ask and I would love to answer them. I am an experienced programmer but this will be first time  I will be creating something of this sort.

Thanks.


texts:
I have a keystore file from the original Ethereum wallet I created in 2018. I've been quite frustrated with the wallet and now I've discovered the software is no longer working. I need help with password recovery. Is there anyway to extract info about the pass from the keystore file?
Any advice, software or direction would be greatly appreciated!
Thank you!


texts: Store/retrieve data doesn't work using node

texts:
i trying something simple, store and retrieve a data in a smart contract, but when i want to retrieve the data, nothing is returned.

solc version is 0.4.24
web3 version is 1.2

Solidity code:

pragma solidity ^0.4.24;

contract tbdocs {

    address owner;

    string testData;

    constructor() public {
        owner = msg.sender;
    }

    function getOwner() public view returns (address) {
        return owner;
    }

    function setTestData(string data) public returns (string) {
        testData = data;
        return testData;
    }

    function getTestData() public view returns (string) {
        return testData;
    }

}

Node Js code:

const path = require('path');
const fs = require('fs');
const Web3 = require('web3');     // Version 1.2
const solc = require('solc');     // Version 0.4.24

async function compileAndDeplot() {

    const simplePath = path.resolve(__dirname, 'contracts', 'simpleStore.sol');
    const sourceSolidity = fs.readFileSync(simplePath, 'utf8');

    const contract = solc.compile(sourceSolidity, 1).contracts[':tbdocs']

    const byteCode = contract.bytecode;
    const abi = JSON.parse(contract.interface);

    console.log('Compiled.');

    const web3 = new Web3('http://localhost:8545');

    const accounts = await web3.eth.getAccounts();
    const address = accounts[0];
    console.log('Using account: ' + address);

    var myContract = new web3.eth.Contract(abi)

    var contractDeployed = await myContract.deploy({
        data: byteCode
    }).send({
        from: address,
        gas: '2900000'
    }, function (error, transactionHash) {
        console.log('Transaction hash: ' + transactionHash);
    });

    const contractAddress = contractDeployed.options.address;

    console.log('Contract deployed at: ' + contractAddress);

    console.log('\nCalling methods: ')

    var result = await contractDeployed.methods.getOwner().call();
    console.log('\tgetOwner: ' + result);       // Works

    contractDeployed.methods.setTestData('testing store data').call()
        .then(result => {
            console.log('\tSet: ' + result);

            contractDeployed.methods.getTestData().call()
                .then(data => {
                    console.log('\tGet: ' + data);
                });
        })
}

compileAndDeplot();

Right now and testing with ganache-cli, but the same result with geth.

ganache-cli -u 0 -l 1000000000

Example output:

Compiled.
Using account: 0xdf6c7a3c1d19DfEF9bae7fC1328f182D781f6631
Transaction hash: 0xad8d9f164d7ec16522eab2a17c8d2c4253f52d0b648a7921b63c6b8bb863f9de
Contract deployed at: 0x0Aa3916BD95B5C02E8ee44c4E9ccf5FAaa328a0a

Calling methods:
    getOwner: 0xdf6c7a3c1d19DfEF9bae7fC1328f182D781f6631
    Set: testing store data
    Get:

As can be seen, the get is empty.

The contract works fine, can be tested here:

Ethfiddle

Thank for any tips.


texts: I accidentally sent ETH in YoBit to an BTC wallet at blockchain [five days ago] YoBit has opened a support file, but no response yet. Is there a way to recover the ETH that is out in the ether somewhere?


texts:
I'm using metamask to connect to rinkeby network. I can see metamask injects web3 code just fine, still I get the Error: Provider not set or invalid. Here's the js script I wrote.

var Web3 = require('web3');
var web3 = new Web3();

if (typeof web3 !== 'undefined') {
    console.log("Using web3 detected from external source like Metamask");
    web3 = new Web3(web3.setProvider(web3.currentProvider));

} else {
    console.log("Using localhost");
    web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}

var account = web3.eth.accounts[0];

console.log(account);

Here's the error I'm getting

I'm using webpack, web3 0.20.4. How do I solve this?


texts:
If I calculate the following in Solidity 0.6.3:

bytes memory secretSalt = "abc";
hashedSecret = sha256(abi.encodePacked(secretSalt))

I get the result "0xba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" which matches what I get on two online SHA256 generators when I input "abc" (though, without the quotes, see here and here).

But if I try

uint secretNumber = 5;
hashedSecret = sha256(abi.encodePacked(secretNumber));

The result is "0x96de8fc8c256fa1e1556d41af431cace7dca68707c78dd88c3acab8b17164c47" which does not match those online SHA256 generators. I tried various hex representations of 5 on the online SHA256 generators and still cannot get "0x96de..."

Any thoughts on how Solidity is transforming the number "uint 5", relative to these common SHA256 implementations?


texts:
I have lost my mist wallet password (1 year ago)

i tried pyethrecover but... no error , no luck... i guess because i have mist .089 keysotre file... so i tried this one:

How to apply pyethrecover.py on v3 .json/transfor v3 .json to .v1

and i use pyethrecoverv3

i create new wallet with very simple password

password is: qwe

and i try to use this

  w = {
    "address": "a0d8b24364e6a0782741091e9a8afe51a3225758",
    "crypto": {
      "cipher": "aes-128-ctr",
      "ciphertext": "12972a53599542829e01f3a8170f4d40fa2b31505eed5851db631a064f50fea4",
      "cipherparams": {
        "iv": "5df8949e399b6aae58381a6f8b791c25"
      },
      "kdf": "scrypt",
      "kdfparams": {
        "dklen": 32,
        "n": 262144,
        "p": 1,
        "r": 8,
        "salt": "6e5ef6f1c6644fdd6bd18dd9cdcbafa26ca57a0da084e640a0b30791bdb66a9b"
      },
      "mac": "064b2575bc5a0a71295540870d88371a85af5bd237aac154e9dbaced50b756eb"
    },
    "id": "1dab3409-aec4-4591-b054-6e5971c746f4",
    "version": 3
  }

and i try to use this password "qwe" and i see "attempts" ... i see attempt with correct password but ... there is no luck showing it...

any help?


texts: Private blockchain vs traditional centralized DB

texts:
I am bit confused by the solutions claiming that their technology is based on blockchain.  However it is private blockchain.

To my understanding: biggest benefit of blockchain is being decentralized so no one party can control the write hence maintain the Integrity.

However if it is private blockchain then how it is better than traditional DB, albeit CRUD is replaced with read and write only.

What added benefits it offers and why it is superior-- if it is?


texts:
I have received an error that says so:

ParserError: Source file requires different compiler version (current
compiler is 0.8.3+commit.8d00100c.Emscripten.clang) - note that
nightly builds are considered to be strictly less than the released
version -->
https://github.com/ConsenSysMesh/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol:1:1:
| 1 | pragma solidity ^0.4.23; |

Also on the remix interface, on the solidity compiler page, I can see an "Include nightly builds" checkbox.
So what is  nightly build?


texts: Excel sheet of difficulty hash of Ethereum

texts:
I am trying to acquire an excel spreadsheet or csv file with the daily or weekly historical difficulty rate of ETH or ETC. Can you please make  a suggestion on how I can get that information?

Thanks in advance.


texts: I argue that Proof Of Stake will consolidate ether holdings rather than decentralize them. Am I wrong?

texts:
I am skeptical of the argument that proof-of-stake will decentralize ownership. The argument in favour of it is that POS has lower capital requirements, so easier entry to the market. That makes sense, but I think it is naive.

Suppose person A has 1,000ETH and persons B, C, D, ... have 1 ETH each. Under POS, if everyone participates in the mining, they will maintain these ratios.

Under POW, the new coins are allocated to participants in proportion to their hashpower. If person A has only 10x the hashpower of persons B, C, D ... then over time person A will have a shrinking proportion of the coins. I argue that this is the realistic scenario, for the following reason.

The richer you are, the greater opportunity you have to diversify -- to invest your capital elsewhere (person A will probably not buy 1000x the hashpower of the other players) -- creating market opportunities for smaller competition in the vacuum they leave behind. Under POS, the rich remain rich and the poor remain poor. (Also, persons B, C, D, ... being poorer, need to spend a greater proportion of their capital, rather than invest it.)

In other words, POS strikes me as being regressive.

Am I right, or is there an argument that, taking the above into account, POS will decentralize ETH holdings?


texts: I know when to use view and pure, but I dont know why we use it. Does EVM optimize anything When I use them?


texts: Does Ethereum 2.0 have privacy on state variables?

texts: I know in 1.x state values were visible to anyone on the network. With the release of 2.0, is there still no privacy? Also I understand 2.0 is being released in phases. Is there a timetable with the relevant points about privacy?


texts: Realistically how often can I iterate a loop?

texts:
I realise looping is an anti-pattern, but I can't see a way round it.

I'm maintaining an ordered list of addresses in a mapping. Separately there is a mapping of addresses to struct where I keep the information. I'm keeping price and quantity, these values can be changed by the users.

The address list is ordered by price. That's fine, I pass in a start_address with the contract call, so it doesn't have to work the whole list to find the position of the new addition.

However, I also need to know the price at a certain cumulative quantity. The only way as far as I can tell is to iterate down the list summing the quantity on each record until I hit the cumulative quantity.

If anyone can see a way round that I would sure like to hear it.

More generally however, how many loop iterations is reasonable in solidity?

I could set a limit on the number of entries, but I have no clue what is ok - 1000, ten thousand, a million?


texts: I want to know after I develop a smart contract in the explorer based solidity  compiler and get the binary code, how can I deploy it to the network and send transactions to it?


texts:
function nice(uint8 x) public  returns(uint8 z){
       uint8 z = 0;
       z = z + 240;
       require(z = z + x, "overflow");
   }

I have been using this code with the solidity versions, prior to 0.8 update. If there was an overflow, transaction would get reverted with the message overflow.
Now, I am moving to 0.8. If I use the same code, my test cases fail, because they don't get overfow revert message anymore. If I remove require and just leave z = z+x as the solidity suggests, then, I have no idea with what message it gets reverted. What I want to achieve is to use 0.8 and still get overflow revert message.
NOTE I don't want to use unchecked .


texts: I lost my eths? Error encountered during contract execution [Reverted]

texts:
https://etherscan.io/tx/0xf7c3d12137403f0b6794856fea92bc1665f4fd1c393b665ea0f485f9a5f8f16e
https://coinmarketcap.com/es/currencies/gyen/
Hi, I try to buy GYEN I got this error and they still haven't refunded my money to my wallet, what do I do? I try to do it with metamask btw


texts: Why did an ISP outage reset my blockchain to only 78MB?

texts:
I don't understand what happened, but after a week of waiting for Geth to complete the blockchain download using geth --rpc and reaching 31GB's of data downloaded so far. My ISP had an outage due to a storm yesterday morning, I lost service twice in one day. Now that my ISP is up again, I checked the Geth download and it hasn't moved since the first outage happened about 20 hours ago.

More then that I suddenly have an extra 30GB's of free space on my hard drive and Geth folder only has 78MB's of data in it. It's practically empty. I'm confused, why did the part of the blockchain I download suddenly disappear and start back at essentially 0 and Geth is currently just sitting there not doing anything.

I would really be grateful for advice on what's happening and how I can prevent it from happening again. Also, I'm doing this to mine ethereum, so I assume I need to download the full and complete blockchain. What is it currently at, about 60GB's? Which is fine.

Anyway, again I'm grateful for any advice.


texts:
Here is what i have read on this vyper official documentation:
https://vyper.readthedocs.io/en/stable/types.html#initial-values

int128   1

uint256  1

I have create this very basic smartcontract:
variable_test: int128

@external
@view
def myfunction() -> int128:
  return self.variable_test

The myfunction function should return 1 according to the documentation, but it returns 0...
Any idea ?
Thanks


texts: How can i `ecrecover` in solidity to verify the digest produced by `web3.utils.soliditySha3` in JS side?

texts:
Javascript side:

id = 128
uri = "xxx://xxx"
hash = web3.utils.soliditySha3(id,uri)
sign = web3.eth.accounts.sign(hash1, privateKey)

Solidity side:

function(uint256 id, string memory uri,bytes v, bytes32 r, bytes32 s){
  digest = keccak256(abi.encodePacked(id, uri));
  signer = ecrecover(digest, v, r, s);
}

signer always mismatch with the prviateKey i use to sign the message. What's the correct way to work with signature using soliditySha3?


texts: how to batch several swaps in a single tx (batch tx)?

texts:
Hi I wanna purchase several erc20 tokens to build a portofolio but gas prices are just exorbitant since several weeks, so I'd like to find a way to implement swapping mutliple assets in a single tx (uniswap, 1inch or any solution to get the best rates/save on slippage)
If you have any documentations about how to do it in javascript/python that would be great (learning solidity for the moment so surely for a v2 but I'll welcome any infos on it as well of course)
If you even have some working code example and kindly explain how it works under the hood would also be greatly appreciated
thanks


texts:
I have created a smart contract to issue an ERC20 token, but when I try to send the token from one address to another I get a "Warning! Error encountered during contract execution [Bad instruction]" message on etherscan.io. The token is already created and the contract is validated.

Also, I´m able to send tokens from the address holding the tokens but once I try to send from a receiver address, I get the error.

You can see the failed transactions here.


texts: With POS, will Ether stay be a necessary fuel to run the network?

texts:
I'm curious to understand, how necessary will Ether be after the Ethereum network moves to Proof of Stake?

I guess stake holders will be rewarded with Ether for voting on the correct next block. Would love to hear your thoughts on this.


texts: How to get Nodes on local Geth Private Network to Discover Peers OF THEIR PEERS

texts:
I am working on a private blockchain that consists of 4 nodes running on different ports.

I am trying to get each node to communicate its connections to its peers, so the network would be fully-connected (each Node has each other Node as its peer). However, nodes are not discovering the peers of their peers.

Node 1 is designated as the bootstrap node, and Nodes 2 & 3 connect to it upon starting. However, Node 1 will have Nodes 2 & 3 as its peers while they will each only have Node 1 as its own peer. I want Nodes 2 & 3 to discover each other.

Additionally, when I run admin.addPeer(node4's enode), from Node 1, it is not broadcasted to its peers.

My question: How can I enable a peer-discovery protocol wherein every Node communicates all of its peers to each of its peers?

I understand that there are some hacks to get around this. Per instance, I can simply pass in each of the 3 other nodes' enode address to every node's --bootnodes in Geth. Or I can just use admin.addPeer() on each of its peer's admin.peers. But I think Geth has this automated somehow and I'd like to use their solution.

StartNode Script:

geth --networkid 63261 --mine --minerthreads 1 --datadir . --rpc --rpcport "8547" --port "30305" --rpccorsdomain "*" --nat "any" --rpcapi eth,web3,personal,net --unlock 0 --password "./node3password.sec" --ipcdisable --bootnodes "node1enode" console 2>> geth.log

[Edit]:

I had already initialized each of my nodes to point at my Private Network's Genesis JSON (./BCNetworkName.json) before running the StartNode script. geth --datadir ./NodeN init BCNetworkName.json


texts: How large network traffic is expected for Ethereum 2.0 Staking node?

texts:
Would be interested what can be rough estimated network costs of running full staking client.
For staking it's currently required to run:

Eth1 node (Not counting initial sync which require initial transfer of more than ~200GB)
Eth2 Staking beacon chain
Eth2  Staking validator

How much daily/hourly networks traffic can we expect from those 3 components?


texts:
I've been working on building a contract that essentially creates a distributed mortgage as a means of fundraising to pull my parents small business out of probate.

I had started with modifying the ConsenSys until I came across the MiniMe token (I like the idea of restoring lost tokens et c) and found medium.com's 0FUCKS token, (c) Moritz Neto with BokkyPooBah / Bok Consulting Pty Ltd.  I quite like it for MiniMe incorporation and a lack of import.  I want to price it at .01 eth (a penny stock price) and not have to pay for gas after deploy.

I do not want to use a fundraising token tools, as this may be slow growth and does not include repayment with interest.  If another contract would fit my needs better that would be great, but I can't afford to do much in testing or deploy attempts.  My last attempt resulted in my receiving 0 tokens and losing .04 eth.  One of the reason I like the current contract is the address for totalsupply is explicit.

I'm not confident enough to take the abstract/meta example of payable from other answered questions, and I can't afford someone else to do this.


texts: How to return form data from an EthElements.Modal.question?

texts: I'm trying to process data from an EthElements.Modal.question, however no event is passed when OK is clicked and this just points to the model call data and not the Template content.


texts: Provider not set or invalid when using Web3 1.0

texts:
I'm trying to use Web3 1.0 to call the balanceOf function on my contract. The error I get during runtime is as follows: Error: Provider not set or invalid.

The code causing the problem is as follows:

var web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/XKEYX'));

Has anyone seen this and knows what I can do to overcome it?

Thanks


texts: How to point a domain registered with ENS to IPFS content?

texts: After securing a .eth domain, how do you point the domain to resolve to an IPFS hash?


texts: Understanding OpenZeppelin's Context contract

texts:
I'm new to solidity and trying to understand OpenZeppelin's Context contract. At the time of writing, the documentation says:

While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned).
This contract is only required for intermediate, library-like contracts.

I kind of understand at a high level that msg.sender can be different from the actual sender for a meta-transaction, but I do not understand how using Context's _msgSender() or _msgData() helps with that. Both functions are simply returning msg.sender and msg.data and they look no different from directly accessing msg.sender or msg.data.
OpenZeppelin's Ownable uses _msgSender() in its constructor and modifier onlyOwner() but I don't understand how that's different from hardcoding msg.sender.
A specific example where calling _msgSender() is different from msg.sender would be very helpful!


texts: How can I sign a transaction using c or c++(arduino)

texts: I want to create and sign transactions on arduino as offline.But I am not know this.Please help me.


texts:
I can see from this site - https://etherscan.io/chart/gasused - the amount of gas used on the Ethereum network daily.

What I cannot work out is how much ETH that corresponds to. Is there some other site that links gas-ether? Or is there a peg of gas->ether?

I mean, if i take avg Gwei as 2.5 - https://ethgasstation.info/

Do i just do

Eth = 2.5 * 10-9 * 35,819,000,000 = ~90 ETH

But then https://etherscan.io/chart/transactionfee has the transaction fee at 308 ETH. What am i missing?

Also, is that ETH "burnt" or lost, or does it get recycled back into use?


texts: Can I find constructor arguments from truffle artifact?

texts:
I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they are.

This is simplified reason why:
deployer.deploy(Contract, Date.now()/1000|0 + 36000)

I set the constructor argument to be a function of the current time, though I'm not quite sure when exact time was in seconds. At the moment, I currently have the truffle-generated artifact with me.

How can I get access to the constructor when the contract was deployed? Is there something in the truffle artifact file that could help? Because I know the rough time of when I launched the program, could I potentially brute force contracts to find the same bytecode?

Any help would be greatly appreciated.


texts:
I'm a developer that has recently started to dive into blockchain business use cases. What I'm failing to grasp is this:

I understand the distributed ledger concept
I understand how the blockchain is created/added to
I understand how mining works
I understand how coins are given for service of mining

My question comes to if I as a company, want to build my own blockchain to to smart contracts in real estate.

Who does the mining? How do they get compensated? Or as a business I would be doing the mining taking place of the public miners.


texts:
Lets say we have something like this as a given:

bytes20 b = bytes20(someAddress);
uint8[] memory array = new uint8[](b.length);
for (uint256 n = 0; n < b.length; n++) {
  array[n] = uint8(uint160(b) / (2 ** (8 * (19 - n))));
}

After performing operations on the array (which would change the casing) I would like to bring it back to an address with the correct checksum, without converting it to a string with a proper casing, and then the string to address. In other words, I am looking for a clean solution. Solidity version is 5.0


texts:
If I want to start a Plasma side chain for a project, do I need my own blockchain for it (with X amount of nodes etc) or is it run simply by those who participate in it?

If it's run solely by its participants I fail to understand how they can reach consensus with any degree of credibility. If for example only two nodes participate, how can they reach consensus?

Also, who decides on the side chain's details, such as consensus protocol? Is it the first node who joins/creates it?


texts:
I used to refer management APIs and Geth Wiki Page to check geth commands, their parameters, options and everything. But this link seems not updated.

I can see multiple commands in geth console, which are not there in wikki page, like

eth.resend
personal.openWallet
eth.namereg
personal.listWallets etc.

Where can I find documentaion of same?


texts:
I'm new to Ethereum and would like to make a company stock contract. shareholders would vote on company policies dividend can be distributed to shareholders and the shareholders can vote on a stock split or reverse split.

I have been reading all the Ethereum tutorials and can't find out how to get a map of all shareholders with the number of shares they own. When making votes, paying dividend and split/reverse split of stock would need to know the number of shares each shareholder has and for split and reverse split would need to change the number of shares each holder has.

My question is, how can a transaction get a list/map/array of the shareholders and corresponding shares so that it can be read and modified?


texts: Mist RPC node error: invalid address length

texts:
Upon launching Mist, I get the following error message:

Couldn't connect to RPC node Error: Invalid address length, expected 40 got 4 bytes

I can't think of something I did over the last week that could cause this. Has anyone got a clue of what went wrong?

Best

EDIT: I have geth 1.5.3, and am on Ropsten


texts: market.link market-sync for chainlink nodes returning connection error

texts:
I'm currently syncing my Chainlink infrastructure with Linkpool's market-sync tool. I have generated a key with their API, and now I'm running the command to sync my node with the market.
docker run linkpool/market-sync:v1.0.3 <all-flags-here-and-accounted-for>

However, I keep getting the following:
Post http://localhost:6688/sessions: dial tcp 127.0.0.1:6688: connect: connection refused
I am ssh tunneled into my node that is hosted on the cloud. Is there something that I'm missing here?


texts: How to identify the bytecode of a single function

texts:
I am trying to generate the bytecode for a single function. I need to avoid any setup/teardown that may occur in the contract as I am trying to get a precise measurement of the execution time in the EVM.

Is there anyway to compile solely a function (ie. no contract) or is there maybe someway to deduce the entry point from the ABI?


texts: Web3py how to save accounts (private keys) to databases

texts: I am wondering if there is a best practice when using web3py to generate an account, i.e private key, and save to to a database. Which format should I use to save it to a database? does web3py have some built in methods that can simplify this process?


texts: How can I retrieve ETH that was sent to my MetaMask wallet from coinbase and my Exodus wallet but were never deposited?

texts: I sent ETH from my coinbase and exodus wallets to my metamask wallet but the coins were not deposited. How can I trace and retrieve the coins?


texts: Why are log entries stored as both tuples and bloom filter in the Transaction Receipts Trie

texts:
Gavin Wood's Yellow paper describes the a transaction receipt (p5, sec 4.3.1):

  The transaction receipt is a tuple of four items com- prising the
  post-transaction state, R_sigma, the cumulative gas used in the block
  containing the transaction receipt as of immediately after the
  transaction has happened, Ru, the set of logs created through
  execution of the transaction, Rl and the Bloom filter composed from
  information in those logs, Rb:

R = (R_sigma;Ru;Rb;Rl)

Why is a Bloom filter used here for Rb?


texts: Web3 Ethereum log subscriptions - removed field?

texts:
I am trying to subscribe to Ethereum events (via Infura) but I'm a bit confused.

I am following this documentation: https://web3js.readthedocs.io/en/v1.2.0/web3-eth-subscribe.html#subscribe-logs

Here is my code:

const ep = 'wss://goerli.infura.io/ws/v3/<XXX>'
const Web3 = require('web3')
const address = '0xdf9E19BB25A200429511bE09892A9B6A4842d483'
const web3ws = new Web3(
  new Web3.providers.WebsocketProvider( ep )
)

web3ws.eth.subscribe( 'logs', {
  address: address,
}, function( error, result ) {
  if ( error ) {
    console.log("Subscription error: "+error)
  } else {
    console.log("Subscription result: %o",result)
  }
})

This seems to work, as I am getting logs (see below), however I don't understand it.

I assume log_id is unique entry, you can see log_7cc1f0b8 is added (removed: false), then later we see it again (removed: true). What does it mean removed? I thought blockchain was immutable? This id never come again, so it was removed forever? I don't get it.

Subscription result: {
  address: '0xdf9E19BB25A200429511bE09892A9B6A4842d483',
  topics: [
    '0x49fe0aa457994ea66f7777afb52c37e4e53ec3e74288aad4c0c45455e035ba88',
    '0xa0fb64729bbcc96db98b0fb392dba8df5abef85b4b257b702317fcc8eb8d249a',
    [length]: 2
  ],
  data: '0x000000000000000000000000000000000000000000000000000000005dde8e86',
  blockNumber: 1723000,
  transactionHash: '0xf96966ee7f407be553438afce506fdf2c8e85e27d9df6301db001259d3250775',
  transactionIndex: 0,
  blockHash: '0xc57affdb6705078567eb0a0a28985af18571b53210fff3e037c62a34495463e3',
  logIndex: 0,
  removed: false,
  id: 'log_7cc1f0b8'
}
Subscription result: {
  address: '0xdf9E19BB25A200429511bE09892A9B6A4842d483',
  topics: [
    '0x49fe0aa457994ea66f7777afb52c37e4e53ec3e74288aad4c0c45455e035ba88',
    '0xa0fb64729bbcc96db98b0fb392dba8df5abef85b4b257b702317fcc8eb8d249a',
    [length]: 2
  ],
  data: '0x000000000000000000000000000000000000000000000000000000005dde8e86',
  blockNumber: 1723000,
  transactionHash: '0xf96966ee7f407be553438afce506fdf2c8e85e27d9df6301db001259d3250775',
  transactionIndex: 1,
  blockHash: '0x1298bdb912230311e91d3bf061e7f81310ee37fc0bba6e33716d5cf65a0bcc63',
  logIndex: 1,
  removed: false,
  id: 'log_46cc14bd'
}
Subscription result: {
  address: '0xdf9E19BB25A200429511bE09892A9B6A4842d483',
  topics: [
    '0x49fe0aa457994ea66f7777afb52c37e4e53ec3e74288aad4c0c45455e035ba88',
    '0xa0fb64729bbcc96db98b0fb392dba8df5abef85b4b257b702317fcc8eb8d249a',
    [length]: 2
  ],
  data: '0x000000000000000000000000000000000000000000000000000000005dde8e86',
  blockNumber: 1723000,
  transactionHash: '0xf96966ee7f407be553438afce506fdf2c8e85e27d9df6301db001259d3250775',
  transactionIndex: 0,
  blockHash: '0xc57affdb6705078567eb0a0a28985af18571b53210fff3e037c62a34495463e3',
  logIndex: 0,
  removed: true,
  id: 'log_7cc1f0b8'
}


texts: How to See InputData of Transaction without ABI?

texts:
I have a contract (0x4ab57f1bfacfa668640ee7f464ae73af28810fb3 https://rinkeby.etherscan.io/address/0x4ab57f1bfacfa668640ee7f464ae73af28810fb3) in RinkeBy, with that source:
pragma solidity ^0.4.18;

contract TRRT {
    string private a="AAAAB3NzaC1yc2EAAAADAQABAAABAQDyAAB/ABtTlMBttlaKKQhjay2Cs5y79qWHpaJNYzS6oVQTN134a2JexiG5CumdETASFrQ8gZAeHxNyKz1qcLOxjonS5PJIBDpTkxE3yQm0gu9TBMFdA7Ni48l2QG1B5tO3D8mpxBWNDNXUE9ZpLzW3albmnW5+R4euWpsfpL1mRwNtrLJqGrE7vdGM8G79AscVjMkjHOfJV7AEp0rZ6Aq6vilY0lVLW+dJfbU5DNKvIM9s32nax8iDJBx3ld3YUsBJX7VL2T2xcp3DmrdctF3jYXvcYbyrwPFv1LJ3lf71Jx32Z+xprgkIliaORfZv48rXR/k2BfJJ6+f4Iim3L9X1";
    function ShowKey()public constant returns (string) {
        return a;
    }
}

How can i get Input Data, result of my function, without ABI, from another account?(I know, that i can copy it ath the rinkeby.etherscan.io, but i want to get it with geth/web3 or similar way.

Actually, i too don't need smart contract, i need just to publish data, that is contained in "a", mb you will help me to avoid excess hemorrhoids.

Ty.


texts:
I need to loop over an array (anti-pattern, I know) and delete elements if they satisfy a condition.

function withdraw(uint256 amount) external {

    WithdrawalRequest[] storage requests = withdrawalRequests[msg.sender];

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

        // See below for the error this line throws
        if (bytes(requests[i]).length == 0) { continue }

        if (block.timestamp >= requests[i].withdrawableAt) {

            // do some stuff...

            // Best approach?
            delete requests[i];

        }
    }

    // do some more stuff...
}

Per this answer on removing array elements, it seems like the "Delete and Leave Gaps" would be my best approach, since I don't have to mutate the array length in the middle of the loop by moving the current element to the end and chopping it. I'd just have to check the number of bytes of requests[i]:

if (bytes(requests[i]).length == 0) { continue }

But that's also throwing me the error TypeError: Explicit type conversion not allowed from "struct Contract.WithdrawalRequest storage ref" to "bytes storage pointer".

How would you recommend removing an array element in a for loop?


texts:
I am currently trying to build a simple Process in Solidity, but somehow I get the Error: Expected token LParen got Identifier for the function WaiterBringsPizza and CustomerReceivesPizza. I'd be very thankful if anyone could help!

pragma solidity ^0.4.16;
contract RestaurantMASTER{
event logStatus(uint orderNumber, bytes input, uint256 timestamp);

//Initialize State-variables(!)
function RestaurantMASTER(){
tokens[0]++;
CU = Customer(newCustomer());                       //[0] @contracts
WA = Waiter(newWaiter());                           //[1]
CH = Chef(newChef());                               //[2]
DB = dataBase(newDataBase());                       //[3]

}

    //Contract 'Objects'
    address[] public contracts;
    Customer CU;
    Waiter WA;
    Chef CH;
    dataBase DB;

    //Casual State-Variables
    int[] public tokens = new int[](7);
    uint public orderNumber = -1;

    function newCustomer() private returns(address newContract){
        CU = new Customer();
        contracts.push(CU);
        return (CU);
    }
      function newWaiter () private returns(address newContract) {
       WA = new Waiter();
        contracts.push(WA);
        return (WA);
    }
     function newChef () private returns(address newContract) {
        CH = new Chef();
        contracts.push(CH);
        return (CH);
    }
    function newDataBase() private returns(address newContract){
        DB = new dataBase();
        contracts.push(DB);
        return (DB);
    }
/*Function-Behavior:
1. Check if Token for function is available
2. Execute all possible automatic functions until further Manual/User-Tasks need to be done
3. Hand Token over to those Manual/User-Tasks
4. Remove own Token
*/
   function OrderPizza(){
        orderNumber++;
        if(tokens[0] == 1){
            tokens[0] = 0;
            tokens[2]++;
            logStatus(orderNumber,"Pizza ordered", now);
        } else {revert();}
    }

    function TakeTheOrder(){
        if(tokens[2] == 1){
            tokens[2] = 0;
            tokens[3]++;
            logStatus(orderNumber,"Order taken", now);
        } else {revert();}
    }

        function PreparePizza(){
        if(tokens[3] == 1){
            tokens[3] = 0;
            tokens[4]++;
            logStatus(orderNumber,"Pizza Prepared", now);
        } else {revert();}
    }
        function PokeTheWaiter(){
        if(tokens[4] == 1){
            tokens[4] = 0;
            tokens[6]++;
            logStatus(orderNumber,"Waiter has been poked", now);
        } else {revert();}

        function WaiterBringsPizza(){
        if(tokens[4] == 1){
            tokens[4] = 0;
            tokens[7]++;
            logStatus(orderNumber,"Waiter is bringing Pizza", now);
        } else {revert();}
    }
     function CustomerReceivesPizza(){
        if(tokens[7] == 1){
            tokens[7] = 0;
            logStatus(orderNumber,"Customer eats Pizza", now);
        } else {revert();}
    }

    }
}
contract Customer{
event logStatus(uint orderNumber, bytes input, uint256 timestamp);

}
contract Chef{
event logStatus(uint orderNumber, bytes input, uint256 timestamp);

}

contract Waiter{
event logStatus(uint orderNumber, bytes input, uint256 timestamp);

}

contract dataBase{
event logStatus(uint orderNumber, bytes input, uint256 timestamp);

}


texts:
I'm trying to write a contract that can take tokens of one type and send you the equivalent amount of the other. (two to one ratio) is there any way to do this with one transaction? as apposed to having the user approve the withdrawal from their wallet. my current code is showed below (still a noob to solidity).

function convertToUSD (uint _value ) external {
        uint bbdValue=_value*2;
        if (USDAddress.delegatecall(bytes32(keccak256("approve(address,value)")), this,_value)){
            if (USDToken.transferFrom(msg.sender,this,_value)){
                if (BBDToken.transfer(msg.sender,bbdValue)){}
                else {
                    revert();
                }
            }
            else{
                revert();
            }
        }
    }

    function convertToBBD (uint _value ) external {
        uint bbdValue=_value*2;
        if (BBDAddress.delegatecall(bytes32(keccak256("approve(address,value)")), this,bbdValue)){
            if (BBDToken.transferFrom(msg.sender,this,bbdValue)){
                if (USDToken.transfer(msg.sender,_value)){}
                else {
                    revert();
                }
            }
            else{
                revert();
            }
        }
    }


texts: Methods of attaching data to an ethereum address?

texts: I'm trying to setup a system where you can attach a name and website url to an ethereum address. Then have it get called back in an ethereum block explorer I'm building. What are some ways where a user can attach this data to their own account? And how would one call it back? I know you can attach data when you send out via the HEX values, but how would one do it in this scenario?


texts: How can i be sure a file is kept on IPFS

texts:
I want to understand how media files on NFT works.
If i store a media file as a blob in a smart-contract's storage value, i will be sure the file will be kept forever on Ethereum blockchain. But it will cost a lot of GAS (and GAS is very expensive !)
Some people are storing the media file on IPFS. Here is what i have understood about IPFS:

There are several IPFS nodes in the world. Everybody can create an IPFS node.
Ethereum nodes are ALL connected each others. This is not the case for IPFS nodes.
I can store a file on an IPFS node. The node will give me a hash which identifies the file.
I can ask the IPFS node with the hash. The node will give me my file.
The file will be automatically deleted if the hash is not often asked.
If a node doesn't know the hash, it will ask other nodes. But the nodes are not all connected. The file might be on another node which is unknowned.
If another node can give the file to the first node. This one will keep a copy of the file.

Am I true at this step ?
Do you agree about this system is not perfect because i have no warranty my file will be kept for years. I have learned how works NFT. And a lot of NFT are working with IPFS. Everybody says the media files will be kept safety but i think this is not true. Do you agree with that ?
I have read Filecoin is a crypto currency associated to IPFS. When i store a file on an IPFS node, i have to pay Filecoin. But how can i be sure the node won't be shutdowned after paying ? When a node keep a copy of a file provided by another node: Which node earns Filecoin in this case ?
Thanks


texts: Live demo of parsing data from external API's like twitter into an Ethereum smart contract

texts:
I'm looking to make a simple ethereum smart contract to just monitor a twitter weather feed for the word "sunny". And if its sunny, it would send coins to some account I specify.

Are there any live demo's out there that do something similar to this? And is there a step by step tutorial on how to do this?


texts: How to forcibly switch Geth to follow other chain and not the largest?

texts:
During the previous fork on Ropstan, my node seems to follow to the wrong chain if I understood correctly. As for now, it's on 6537730, it's the longest but major players are around 6523511. What are the necessary steps to follow in order to fix it?

How it's selected by default? and how should I override it if the criteria will point again to the wrong chain due to hash power or else?


texts: hitchhiker's guide to the galaxy joke in the genesis block

texts:
According to the Yellow Paper, the genesis block is specified by 15 items as follows:

Regarding KEC((42)), it goes on to say:

KEC (42) refers to the Keccak hash of a byte array
of length one whose first and only byte is of value 42,
used for the nonce.

The question is, does this have a practical purpose?

My conjecture is that it's a whimsical reference to Douglas Adams's 1978 novel <<The Hitchhiker's Guide to the Galaxy>>.


texts: Can one decentralize an existing app already using paypal as payment?

texts:
I am looking at decentralizing an existing app to a dapp using ethereum smart contact. the app uses Paypal for membership, advertising and affiliate payment  already but i dont want to use Paypal, I need an ERC20 Token as Payment.

I will need help to moveforward

thanks


texts: I am using Infura web3 provider to connect etherum but I want to use IPC provider(more secure), How to use IPC provider in ethereum web3.


texts: Parsing contract method output as an array of fields


texts:
For a test project, I need to write the etherdelta's contract. but "function EtherDelta (address admin_, address feeAccount_, address accountLevelsAddr_, uint feeMake_, uint feeTake_, uint feeRebate_) {
    admin = admin_;
    feeAccount = feeAccount_;
    accountLevelsAddr = accountLevelsAddr_;
    feeMake = feeMake_;
    feeTake = feeTake_;
    feeRebate = feeRebate_;
  }

function () {
    throw;
  } "I don't know how to fill this part. I'm getting an error because I can't fill this up, and I can't print the contract.


texts: How to creating multiple NFT tokens using ERC1115

texts:
I am new to solidity and ethereum network. I have knowledge of developing erc20 and erc721 tokens using openzepplin. But I am curious about erc1155. Also I have check the erc1155 documentation at
https://eips.ethereum.org/EIPS/eip-1155
What I want to achieve is to generate multiple erc-721 NFT tokens using erc1155

Token 1 with 100 supply
Token 2 with 500 supply
Token 3 with 1000 supply

and mint these tokens with 1 transaction to contract creator account while deploying the contract.
I couldn't find any resources regarding this. Any guidance or help would be appreciated.


texts: Parity -- How to delete DB and resync it?

texts:
[master][~/parity/target/release]$ ./parity import /tmp/avatar.rlp

Error Output: Database was created with newer client version. Upgrade your client or delete DB and resync.

I could not understand:
[Q]How could I delete the DB or resync it?, I couldn't find where the DB is stored?

Thank you for your valuable time.


texts: Any acc with eth is accessing my contrct restricted methods on rpstn ntwrk.It should give err but its not giving. On ganache its working as expected

texts:
I created one project, which is working perfectly on ganache.
But whenever I deploy it on ropsten it is doing anything.
I will explain in brief
after opening my web app on browser if i try to call any method of my contract through web3, with any ropsten address in metamask my functions are getting called
which they shouldn't
because I put such restrictions using require statements in functions.
and this thing working perfectly in local network
functions are throwing error
but here
in ropsten, functions are just throwing transaction confirm messeges.
what can i do to fix this?
help me
Im new here.
github repo link https://github.com/swapnil7895/AgriBlockchainTrade
here is link of github project where i deployed my app https://swapnil7895.github.io/AgriBlockchainTrade/


texts: getting the IP address of the miner who mined a block?

texts: How do I find out the IP address of the miner who mined the last block, using geth ?


texts: In Casper PoS, what is a finalised block?

texts:
Vitalik talks about block finalisation here, and Vlad also talks about it here.

What is a finalised block? How long does it take to finalise a block? What are the security guarantees of a finalised block?


texts: How to edit total supply after deployment? Parity

texts: I was playing around in parity and deployed my own token. However,in total supply calculation I have made a mistake of not multiplying desired_supply * 10^decimals and ended up with less coins. How can I edit this?


texts: How to calculate the token price of already deployed ERC20 tokens

texts: I am creating a smart contract, so inside that I have to pass the token in contract and the value of ether will be calculate on behalf of token price please help.


texts: How to print logs such as peer.Log().Debug("") in geth?

texts: I want to check logs such as peer.Log().Debug() in geth.But I haven't find it in my log.txt .It seems that Geth does not log this in log.txt.Only log.logger (), log.dubug ().... are logged in log.txt.So how can I print such logs as peer.log().Debug()？is there any docs that describes about this? Thanks


texts: Is "contact address" on etherscan.io 100% trustable?

texts:
Let's say I want to know if the token OMG or TRX is compatible with myetherwallet, metamask, and other ERC-20 compatible wallets. I go to the website https://etherscan.io/ and search for it, and I see their logo, number of token holders, number of transfers and so on.

Is the information shown here 100% trustable? Is it automatic, or is it manually handled? I'm guessing that number of transfers is automatic, but the "Contact Address", is that always correct? Can anyone change it?