texts: Is it possible to sync an archive node with HDD in 2020?

texts:
Many bloggers have pointed out that it is almost impossible to sync an ethereum archive node using a HDD.But most of those blogs were published in 2018.

I've seen several version updates of geth since then, and some improvements had been made to sync an archive nodes.

So I would like to ask if anyone has successfully synched an ethereum full archive node with HDD recently?Use either geth or parity.


texts: Why doesn't solidity have 'sizeof' keyword like python have?

texts:
I want to know how can I use sizeof keyword.

is it reserved keyword? i found it in the solidity documentation.


texts: When using delegatecall, data in parameters of type uint[] are left-shifted by 8 bits

texts:
progma solidity ^0.4.15;
contract Callee
{
    uint public result_;

    function foo (uint _length, uint[] _nums) public returns (uint)
    {
        result_ = 0;
        for ( uint i = 0; i < _length; ++i)
             result_ += _nums[i];
        return result_;
    }
}

contract Caller
{
    uint public result_;
    address public callee_ = <Address of deployed Callee>;

    function Call (uint[] _nums) public returns (bool)
    {    return callee_.delegatecall(bytes4(sha3("foo(uint256,uint256[])")), _nums.length, _nums); }
}

These are contracts I have defined. Deploy Callee first, then give its address to Caller contract, then invoke the Call function with parameter [1], however the result_ value is 256 after calling.
I tested several data, and find out that each data in the uint256[] param is left-shifted by 8 bits. But param 1, which has type uint256, is not shifted.

I want to know why.


texts: How to avoid transactions getting queued due to one low gas transaction?

texts:
When executing a smart contract through one owner account, and if one transaction gets stuck( due to low gas price), all the other transactions submitted after that becomes pending. Is there any well-known solution to this problem. My code looks like following,

myContract.methods.myMethod(fromWallet, toWallet, amount, companyName).send(txParams)
                .on('transactionHash', function (hash) {
                    console.log("transaction submited " + hash);
                })
                .on('receipt', receipt => {
                   //do something when get the reciept
                })
                .on('error', error => {
                    console.log('error', error);
                })

As my understanding receipt event happens only after the transaction is mined by miners. Is there any way that I can wait for sometime and if transaction still pending, cancel/resubmit to avoid the queue of transactions blocking my application. Appreciate any help.


texts: I have BEP20 token with total supply of 1000 tokens. i want to list it on pancake-swap and want to provide initial liquidity of 1000 tokens (all tokens) for 1 BNB. Since i have a burn function in my BEP20 token contract, does calling the burn function(For example if i burn 150 tokens by calling the burn function) will reduce the liquidity on pancakeswap automatically? and this is what the token burn actually is ? I mean would it increase the value of other remaining tokens?


texts: Can i store data, e.g. a string inside a token? If so, this data will follow the token around if I transfer it to someones wallet?


texts: how to set tokenid in erc721 openzeppelin?

texts:
First of all, sorry if I'm asking an obvious question.
In ERC721 openzeppelin API, to manage a token you always need to refer to a tokenId.
Are you supposed to define a global variable, or a mapping in the case of enumerable, in the contract to refer to tokenId? Is this the best way to go, or should you use any method to set tokenId?


texts:
I'm creating an ETH based crypto in Remix and I keep getting the error on line 60:

DeclarationError: Undeclared identifier. "_value" is not (or not yet) visible at this point.

I'm new to this type of coding so I'm entirely clueless, any help would be greatly appreciated!

pragma solidity >=0.4.22 <0.6.0;

contract AntiCoin {
    /* This creates an array with all balances */
    mapping (address => uint256) public balanceOf;

    string public name = "AntiCoin";
    string public symbol = "ANTI";
    uint256 public max_supply = 50000000000000;
    uint256 public unspent_supply = 0;
    uint256 public spendable_supply = 0;
    uint256 public circulating_supply = 0;
    uint256 public decimals = 6;
    uint256 public reward = 50000000;
    uint256 public timeOfLastHalving = now;
    uint public timeOfLastIncrease = now;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Mint(address indexed from, uint256 value);

    /* Initializes contract with initial supply tokens to the creator of the contract */
    function AntiCoinInit() public {
      timeOfLastHalving = now;
    }

    function updateSupply() internal returns (uint256) {

      if (now - timeOfLastHalving >= 2100000 minutes) {
        reward /= 2;
        timeOfLastHalving = now;
      }

      if (now - timeOfLastIncrease >= 150 seconds) {
        uint256 increaseAmount = ((now - timeOfLastIncrease) / 150 seconds) * reward;
        spendable_supply += increaseAmount;
        unspent_supply += increaseAmount;
        timeOfLastIncrease = now;
      }

      circulating_supply = spendable_supply - unspent_supply;

      return circulating_supply;
    }

    /* Send coins */
    function transfer(address _to, uint256 _value) public {
        require(balanceOf[msg.sender] >= _value);           // Check if the sender has enough
        require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
        balanceOf[msg.sender] -= _value;                    // Subtract from the sender
        balanceOf[_to] += _value;                           // Add the same to the recipient

        updateSupply();

        /* Notify anyone listening that the transfer took place */
        Transfer(msg.sender, _to, _value);

    }
    /* Mint new coins by sending ether */
    function mint() public payable {
        require(balanceOf[msg.sender] + _value >= balanceOf[msg.sender]); // Check for overflows
        uint256 _value = msg.value / 100000000;

        updateSupply();

        require(unspent_supply - _value <= unspent_supply);
        unspent_supply -= _value; // Remove from unspent supply
        balanceOf[msg.sender] += _value; // Add the same to the recipient

        updateSupply();

        /* Notify anyone listening that the minting took place */
        Mint(msg.sender, _value);

    }

    function withdraw(uint256 amountToWithdraw) public returns (bool) {

        // Balance given in ANTI

        require(balanceOf[msg.sender] >= amountToWithdraw);
        require(balanceOf[msg.sender] - amountToWithdraw <= balanceOf[msg.sender]);

        // Balance checked in ANTI, then converted into Wei
        balanceOf[msg.sender] -= amountToWithdraw;

        // Added back to supply in ANTI
        unspent_supply += amountToWithdraw;
        // Converted into Wei
        amountToWithdraw *= 100000000;

        // Transfered in Wei
        msg.sender.transfer(amountToWithdraw);

        updateSupply();

        return true;
    }
}


texts: I am using Embark , i wrote a command 'make geth' it throws the error

texts:
make: *** No rule to make target 'geth'.  Stop.
I don't know what does it mean .


texts: Trying to connect front-end application with smart contract

texts:
I am creating a simple registration and login forms in React.js and connecting it with smart contract in order to use it to store the data from the front and to the blockchain is there any method or command to connect the front end with the smart contract in order to use its functions?
Thank in advance


texts:
I am getting some errors related to bytes32. I tried to use the casting but it is not solving the proble.
My code is:
pragma solidity ^0.5.6.0;

    contract peInKSub{
      bytes32 [] m_pendingIndex ;
      struct pendingConfirmation{
         bytes32 index;
         uint yetNeeded;
         bytes32 pendingOp;
      }

      pendingConfirmation pending;

      function confirmAndCheck ( bytes32 _operation )public returns ( bool ) {
        pending.pendingOp = m_pendingIndex [ _operation ];
        // if we 're not yet working on this operation ,
        // switch over and reset the confirmation status .
        if ( pending . yetNeeded == 0) {
          pending . index =  m_pendingIndex[_operation] . length ++;
          //m_pendingIndex [ pending . index ] = _operation ;
        }//if
      }//fun
    }//contract

My error messages are:

solc prg46.sol prg46.sol:14:38: Error: Type bytes32 is not implicitly convertible to expected type uint256. pending.pendingOp =
m_pendingIndex [ _operation ];
^--------^ prg46.sol:18:35: Error: Type bytes32 is not implicitly convertible to expected type
uint256. pending . index =  m_pendingIndex[_operation] . length ++;
^--------^ prg46.sol:18:20: Error: Expression has to be an lvalue. pending . index =
m_pendingIndex[_operation] . length ++;
^---------------------------------^ prg46.sol:18:20: Error: Type uint8 is not implicitly convertible to
expected type bytes32. pending . index =  m_pendingIndex[_operation] .
length ++;
^------------------------------------^

Somebody please guide me.
Zulfi.


texts: Possible to get a contract/token's age using etherscan api?

texts: I want to programmatically get the age of a contract or token on the ethereum blockchain. Is there a reliable way to do this with the etherscan api?


texts:
Very new to this. following teething problems and multiple restarts I'm running a fast sync with max cache.

I'm starting to down load the block chain in fast syncmode, whats the current storage requirements of the block chain?

This is going on an M2 NVMe with about 420 gb beside the OS.

I started a light down load that didnt look like it was doing any thing. so I impatiently stopped and started the fast.

How much space would the current light sync consume?

TIA, Appologies if this is a repeat. I have searched.


texts: How to request tokens from msg.sender within contract function

texts:
transferring ethereum from the user of your smart contract is simple enough, you simply use msg.value and can use this within your contract's functions. But doing the same thing with tokens is a bit more tricky consider the following contract

pragma solidity ^0.4.24;
import "../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol";
import "../node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "../node_modules/zeppelin-solidity/contracts/token/ERC20/SafeERC20.sol";
contract TokenExchange{
  enum State {OPEN, FILLED, CLOSED, CANCELED}
  struct Order {
    uint id;
    State state;
    address buyer;
    address seller;
    uint antAmmount;
    uint daiAmmount;
  }
  ERC20 public token1;
  ERC20 public token2;
  mapping (uint => Order) public globalOrders;
  uint private nextOrderId;
  constructor () public {
      token1 = ERC20(0x1111111111111111111111111111111111111111);
      token2 = ERC20(0x2222222222222222222222222222222222222222);
  }
  function createBuyOrder(uint _buyAmmount, uint _sellAmmount) external payable {
    uint deposit = _buyAmmount.div(2);

    // How to transfer tokens from message sender to this contract

    Order memory newOrder = Order({
            id: 0,
            state: State.OPEN,
            buyer: msg.sender,
            seller: 0x0000000000000000000000000000000000000000,
            token1Ammount: _buyAmmount,
            token2Ammount: _sellAmmount
        });
    globalOrders[nextBuyOrderId] = newOrder;
    nextBuyOrderId++;
  }
}

if we were dealing with eth we could simply require msg.sender to equal the deposit vaue. Also we cant use token.aprove() and transferFrom() within the function as this would be aproving the contracts balance and not msg.sender

so my question is this:
how do I request the message sender to send the deposit to the contract and how do I test if the message sender has sent the required amount?


texts:
The following code snippet is designed to forward all funds to a single destination, but where multiple contract D's will exist, allowing differentiation of the original source of the funds.

pragma solidity ^0.4.11;

contract D {
  // (Deployed address of contract E)
  address public _e = 0x63636a7c969A0cF64395d302d3dA0C7CbcF37036;

  function () payable {
    _e.delegatecall.gas(50000)(bytes4(sha3("deposit(address)")),this);
  }
}

contract E {
  event DepositReceived(address receiverAddress, uint256 amount);
  address public destination = 0x14d06788090769f669427b6aea1c0240d2321f34;
  function deposit(address receiver) payable {
    destination.transfer(msg.value);
    DepositReceived(receiver, msg.value);
  }
}

Using delegatecall currently the transaction results in an error and any ETH sent to contract D remains trapped there, as seen here: https://kovan.etherscan.io/vmtrace?txhash=0x4f608dfca2ebed0c51423fb357d13f199f117ce38bcb5001e127c5162f2ae287&type=parity

I am assuming it is failing because any ETH sent to contract D remain there and cannot be forwarded on by contract E via delegatecall. Is this functionality possible using delegatecall at all - ideally i would add delegatecall.value(msg.value) or something similar but this does not seem to be supported.

(I am aware this could be done in other ways, but was hoping to use delegatecall partly to experiment with it and also because this will be part of a larger contract)

Thank you


texts: Is it Possible to Prove Who Sent Funds to Particular ETH Address?

texts:
I’m building a cryptocurrency marketplace where users mainly buy and sell small ticket items (worth $10 - $50) using cryptocurrency. Typically, the average user will deposit $100 at a time into a  personal/private/dedicated ETH address and we would then keep track of the user's balance internally.
However, since ETH uses account-based model to track transactions, when I try to consolidate all user deposits into a single ETH address I would pay a gas fee for each deposit. I'm trying to consolidate all of the deposits made by our users into a single ETH account without paying a separate miner/gas fees for each one.
TIME SLOT APPROACH
My approach to solve this problem is by using a "time slot" -- where every user of the site deposits funds to a single ETH address. In order to track which user to credit for a deposit I plan on dedicating a particular address to a single user for a period of time (“time slot”) and credit any incoming transaction to that user for that period of time.
My question is if a user sends funds to an address under someone else's "time slot" is it possible for him to prove that he was the sender the funds? Using publicly available information such as the amount sent obviously won't cut it because anyone has access to this info.
Is this possible?
Thanks


texts: On Etherscan, what is the difference between a failed transaction that says 'Reverted' and one that says 'Execution Reverted'?

texts:
On Etherscan, a failed transaction will provide a reason for failure. This can be Reverted, Out of Gas, Bad instruction, etc.

However, there seems to be an inconsistent message on different testnets. I deployed this contract on all the networks:

pragma solidity ^0.5.16;

contract FailedFallback {

    function () external payable {
        require(1==2, "Failed test");
    }
}

When calling the fallback function on Rinkeby, Etherscan says execution reverted, however any other network simply says Reverted.

Is this an inconsistency with Etherscan or the the VM of the network? At the VM level, are these reversions the exact same? Does this have something to do with a Geth vs. Parity trace?


texts: Truffle migration contract not found - but it's there!

texts:
I have a feeling this is going to be a forehead-slapper, but here goes...

I'm attempting to run Truffle's "Pet Shop" demo app on AWS.  The truffle compile command ran fine, with a few non-fatal warnings but nothing major. It completed with...

Writing artifacts to ./build/contracts

...as expected. But truffle migrate is failing, and it seems to be not seeing the contents of the file successfully created at contracts/Migrations.json.

$ truffle migrate
Using network 'development'.
Error: Could not find built Migrations contract: Unexpected token  in JSON at position 0

However, the file is there, and seems fine.  Any idea why this is failing?

Also worth noting: I've got two console windows running (both SSH'd into the same AWS EC2 instance), and the second of the two is running testrpc.  It is "listening" and does tell me...

Listening on localhost:8545
net_version
eth_accounts

...when I attempt the migration, but nothing beyond that.

Thanks for any nudge in the right direction!


texts: I there is way to burn ERC223 tokens like we do to ECR20 token?

texts: but as far as i know  alike ECR20, ECR223 token cant be send to an address without having tokenFallback() do we have another way around to burn the ERC223 tokens?


texts: Why is there a nonce and mixHash value in the genesis file?

texts:
I may not fully understand the genesis file.

Why is there a nonce and mixHash value in the file if nothing is being mined?
It was my impression the genesis file is used to bootstrap block 0, then that's it. If that's the case, why does these values exist at all?
Where can I find the mainnet genesis file in geth? What is the filepath?


texts: Is there any security risk in keccak256 stored data in solidity smart contract?

texts: I want to store some hashed data in my contract. Which is better, hashing on the backend(contract) or the frontend. Also, is there any security consideration to look at when doing this? Thank you.


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

texts: ERC721 says that NFTs can only be transferred by owners/authorized addresses. How are solidity marketplace contracts made to allow a third party address to transfer an NFT from your account to theirs since they would need to be authorized to transfer that NFT


texts: How do get every token transfer for a token?

texts:
I initially thought this would be trivial, just using the tokens transfer event but this misses transactions done by disperse, multisend and I am sure there could be a few more methods I don't know about done by services such as https://multisender.app/. Example of what these methods could look like:
https://etherscan.io/token/0xd46ba6d942050d489dbd938a2c909a5d5039a161?a=0xbb478118ed70800b160c9c06afd69324cedeafdc
If I didn't want to miss any token transfer no matter the method, how would I collate this?
The token I am interested in doing this for is Ampleforth. I am willing to go through every transaction in every block, but how would I identify Ampl transactions like this?


texts: How can I configure Mist to use a non-default IPC path?

texts: When using Mist, it always uses the default IPC path to my OS (In this case of OSX this is /Users/me/Library/Ethereum/geth.ipc). Is there a way to configure or specify a non-default IPC path for Mist? This would allow me to separate mainnet and testnet IPC connections.


texts: What are the transaction return object attributes "c," "e," and "s" in an integer / uint return type?

texts:
I have a counter in a Solidity contract:

uint8 public transactionCounter;
function ContractConstructor() public {
    transactionCounter = 0;
}

function getTransactionCounter() returns (uint8) {
    return transactionCounter;
}

function trns() {
    transactionCounter += 1;
}

When interacting with the contract, i get back the transactionCounter

App.contract.XYContract.deployed()then(function(instance){
    return instance.getTransactionCounter.call();
}).then(function(counter) {
    console.log(counter);
});

In the JavaScript console, I get:

e {s: 1, e: 0, c: Array(1)}

What are s, e and c and where is it documented?


texts: How do I spend ether from an internal transaction?

texts: Both etherscan.io and metamask report that the balance of my ethereum wallet does not include the value of any internal transactions. That being the case, how do I "spend" (or send ether) from an internal transaction?


texts: Testing a function in Solidity from Truffle test using Javascript

texts:
I have the following contract:

contract C {

  address owner;
  address bigboss;

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

  function C() {
    owner = msg.sender;
    bigboss = msg.sender;
  }

  function changeOwner(address _newAccount) onlyOwner {
    owner = _newAccount;
  }

}

So, I'm using truffle and Javascript to test creation of the contract, and testing of change of ownership.

const C = artifacts.require('C.sol');

var account_finance = 0x123456; // finance
var account_main = 0x7890abc; // main

contract('C', (accounts) => {
  payroll = new C({from: account_main});
  payroll.changeOwner({from: account_main}).call(account_finance);
});

I get this error:

TypeError: Cannot read property 'call' of undefined

What's wrong? Why couldn't I call changeOwner? Is my code correct?

Thank you.


texts: VM Exception while processing transaction: revert - buying transaction

texts:
Hey bit of a newbie to ethereum dev over here. I'm building a marketplace for ERC 721, currently, i've been getting this error when I called in buying method.
Contract code:
    function buyJam(uint256 tokenId) public payable {
    // If it has a price, it is up for sale
    require(jamsForSale[tokenId] > 0);

    uint256 jamCost = jamsForSale[tokenId];
    address payable jamOwner = address(uint160(this.ownerOf(tokenId)));
    require(msg.value >= jamCost);

    _transferFrom(this.ownerOf(tokenId), msg.sender, tokenId);
    jamOwner.transfer(jamCost);

    // If the value sent is more than the value of the star, we send the remaxining back
    if (msg.value > jamCost) {
      msg.sender.transfer(msg.value - jamCost);
    }

    // And since it was sold, we remove it from the mapping
    jamsForSale[tokenId] = 0;
  }

Frontend Connecting point:
const accounts = await eth.getAccounts()
                    const networkId = await eth.net.getId()
                    const deployedAddress =
                      JamRareContract.networks[networkId].address

                    const contract = new eth.Contract(
                      JamRareContract.abi,
                      deployedAddress
                    )

                    const price = web3.toWei(jam.price.toString(),'ether')

                    console.log(jam.nftid)
                    const sa = await contract.methods
                      .buyJam(jam.nftid)
                      .send({
                        from: accounts[0],
                        value: price,
                        gas: 100000,
                      })

Error Log from ganache:
{[15:43:03]  <     "id": 6934633043770,[15:43:03]  <     "jsonrpc": "2.0",[15:43:03]  <     "result": "0x6b113e45798411ff40fe6c25f045ce59162db48677059ed115444da3751f3a86",[15:43:03]  <     "error": {[15:43:03]  <       "message": "VM Exception while processing transaction: revert",[15:43:03]  <       "code": -32000,[15:43:03]  <       "data": {[15:43:03]  <         "0x6b113e45798411ff40fe6c25f045ce59162db48677059ed115444da3751f3a86": {[15:43:03]  <           "error": "revert",[15:43:03]  <           "program_counter": 8397,[15:43:03]  <           "return": "0x"[15:43:03]  <         },[15:43:03]  <         "stack": "RuntimeError: VM Exception while processing transaction: revert\n    at Function.RuntimeError.fromResults (/Applications/Ganache.app/Contents/Resources/static/node/node_modules/ganache-core/lib/utils/runtimeerror.js:94:13)\n    at BlockchainDouble.processBlock (/Applications/Ganache.app/Contents/Resources/static/node/node_modules/ganache-core/lib/blockchain_double.js:627:24)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)",[15:43:03]  <         "name": "RuntimeError"[15:43:03]  <       }[15:43:03]  <     }[15:43:03]  <   }

Been stuck here for a bit. Appriciate any help guys.


texts: What happens to my blockchain download if there is a sudden ISP outage?

texts:
I've been downloading the blockchain using Geth --rpc so that my computer can mine ethereum, however it's been downloading for 3 days and is at roughly 23GB's in size (yesterday it was 25GB's). Though I was curious what would happen to the blockchain I've already downloaded, if my internet experienced an outage before the blockchain completed?

I assume it would simply keep trying until the connection resumed, but this is new to me. If I may also ask, what is the current size of the blockchain? I don't mind the wait, I would just like an idea of where I'm at, if it's around 80% done, 50% done, or what. :)

Also if it helps my ISP speed is 50MB's download, my computer has 16GB's RAM, i5-3570K CPU, 1080TI FTW GPU, Windows 10Pro, and about 200GB's of free space on the hard drive.

Please let me know.

Thank you!


texts:
I am trying to build a Dapp and I need to send messages between any two users. The messages would be used to reach a sort of private agreement between them. The agreement then could be published on the blockchain. I want to avoid using smart contracts or transactions to reach the agreement as those would cost gas. I was looking into whisper and wondering if it is a good solution. Moreover, how much time would it take to send and receive a message in whisper?

I have read it is not really suited for real time communications, but how fast or slow can it be?


texts: Is Ethereum Contract Application Binary Interface (ABI) somewhat similar to WSDL in concept? To use an enterprise software term

texts: Is Ethereum Contract Application Binary Interface (ABI) somewhat similar to WSDL in concept? Is it an accurate approximate? To use an enterprise software glossary term which could be useful in explaining to the folks who are familiar with the SOA, etc.


texts: What does it mean by "msg.sender.call()"?

texts:
I'm reading the Function modifiers section of solidity doc.

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

/// This function is protected by a mutex, which means that
/// reentrant calls from within msg.sender.call cannot call f again.
/// The `return 7` statement assigns 7 to the return value but still
/// executes the statement `locked = false` in the modifier.
function f() noReentrancy returns (uint) {
    require(msg.sender.call());
    return 7;
}

}

From that example I'm confused that what it means by msg.sender.call()? What function does call() call exactly? The corresponding comment says

  reentrant calls from within msg.sender.call cannot call f again

does it mean call() is calling f() itself? If so why is that, is there any documentation clarify so? Thanks in advance!


texts: Getting Errors while syncing of blocks (Ropsten network)

texts:
Today the block sync with Ropsten network on my machine is giving me following error :-

ERROR[06-05|06:59:12]
########## BAD BLOCK #########
Chain config: {ChainID: 3 Homestead: 0 DAO: <nil> DAOSupport: true EIP150: 0 EIP155: 10 EIP158: 10 Byzantium: 1700000 Engine: ethash}

Number: 3376467
Hash: 0x64b63b97eb45e2e1c31636e9ad7aef3941f393a27dfdca409952992a7e0db60c

Error: invalid chain id for signer
##############################

What could be causing this error ? How can it be resolved?


texts: call a contract function which creates a new contract in web3.js makes an error VM Exception while processing transaction: revert

texts:
At first I'm developing with truffle v5.1.34, Node v10.16.0, Web3 v1.2.4
To make it simple, I have a Two contracts, DApp and User
What i'm doing is call a DApp contract function which creates a new User Contract like below
pragma solidity ^0.5.0;

contract User {
    string private _name;
    string private _publicKey;

    constructor (string memory name, string memory publicKey) public  {
        _name = name;
        _publicKey = publicKey;
    }

    function getName() public view returns(string memory) {
        return _name;
    }

    function getPublicKey() public view returns(string memory) {
        return _publicKey;
    }

}

This is a User SmartContract
pragma solidity ^0.5.0;

import "./domain/User.sol";
import "./common/Ownable.sol";

contract DApp is Ownable {
    address [] private _userList;

    constructor () public Ownable(msg.sender) {

    }

    function createUser(string memory name, string memory publicKey) public {
        User user = new User(name, publicKey);
        address userAddr = address(user);
        _userList.push(userAddr);
    }

    function getUserList() public view returns(address[] memory) {
        return _userList;
    }

}

This is a DAppContract which creates user contracts.
When I call this function in a truffle console, it doesn't make any errors and works well.
But when i call this function in a javascript with web3.js it makes an error like below

        // account and dapp is in another code
        await dapp.methods.createUser("Test", "Test").send({
            from: account
        });

As a i test this code by add new User code in constructor or in truffle console, getUserList returns well but only with web3 library makes an error
VM Exception while processing transaction: revert
Can anyone tell me how to fix this error?


texts: Why transfer function is implemented in constructor?

texts:
On ERC20 token implementation example on wiki they updated the code. And in constructor function of fixed token example they have used transfer function.

    function FixedSupplyToken() public {
    symbol = "FIXED";
    name = "Example Fixed Supply Token";
    decimals = 18;
    _totalSupply = 1000000 * 10**uint(decimals);
    balances[owner] = _totalSupply;
    Transfer(address(0), owner, _totalSupply);

}

Whats the significance of transfer function here and from where it is getting its parameters?


texts:
I installed Mist (geth v1.6.0-stable) on MacOs and the sync works just as normal. I'm trying to run geth and use --datadir to use a external HDD volume. This fails with the error message geth.ipc: bind: invalid argument.

geth --datadir /Volumes/extHDD/ - fails
geth --datadir /usr/name/tmp - just works.

Appreciate any pointers.


texts: Is there a way to prevent any client connected using web3.js to Quorum from deploying a contract?

texts: I am planning on using Quorum for a permissioned setup,Is it possible to prevent anyone having a web client and connected to any quorum node deployed in the network from deploying a contract?


texts: Using new Ethereum Provider to pay with Binance Chain custom Tokens

texts:
This is my very first question here.
Basicaly I need to do this:
var web3 = new Web3(new Web3.providers.HttpProvider("your ethereum node"));
ABI = "put here your contract ABI"
var Contract = web3.eth.contract(ABI);
var contractInstance = Contract.at('address of your contract')
contractInstance.transfer.("the_adress","the amount of tokens", {from:address},(function(err,result){
    if(!err){
        console.log(result)
    }
});

But using this fashion way since Metamask no longer use "WEB3" :
    $('#pay-button').click( function(){
        const paymentAddress = '<THE_ADDRESS>';
        const transactionHash = ethereum.request({
            method: 'eth_sendTransaction',
            params: [ { 'to': paymentAddress, 'value': val, 'from' : window.ethereum.selectedAddress } ],
        }).then((txHash) => console.log(txHash)).catch((error) => console.error);
    });

I'm using custom tokens added to Metamask using contract hash.


texts: geth 1.5 - static-nodes.json location for a private network ? File ignored?

texts:
Since upgrading to 1.5 the file static-nodes.json seems to be ignored, same deal with trusted-nodes.json

I am confused on what the location should now be.

The documentation states that

  You can configure permanent static nodes by putting something like the following into /static-nodes.json (this should be the same folder that your chaindata and keystore folders are in)

However keystore and chaindata are now in different directories for private a network in 1.5.

The peers run with the --nodiscover flag

Has anyone managed to get it working on 1.5 for a private net and how ?

Note: admin.addPeer still works just fine


texts: how can i count how many buyers made request to my smart contract and get earnedEther

texts:
I am using a factory contract for selling and buying goods.
how can retrieve how many buyers bought and calculate how much ether earned by selling goods? here is my source code. I am new on smart contracts

contract FactroyContract {
  address[] public contracts;
  address public lastContractAddresses;

  event newPurchaseContract (address contractAddress);

  function getContractcount() public view returns(uint ContracCount)
  {
    return contracts.length;
  }

  function newPurchase(uint value, string memory bookName, string memory description, string memory imageHash, string memory privHash, string memory dataHash)
    public
    payable
    returns(address NewContract)
  {
    Purchase c = new Purchase(address(msg.sender), value, bookName, description, imageHash, privHash, dataHash);
    contracts.push(c);
    lastContractAddresses = address(c);
    emit newPurchaseContract(c);
    return c;
  }

  function seePurchase(uint pos) public view returns(address contractAddress)
  {
    return address(contracts[pos]);
  }
}

contract Purchase
{
  uint public price;
  address public seller;
  address[] public buyers;
  address public buyer;
  string public ipfsHash;
  string public preview;
  string public cover;
  string public name;
  string public text;

  constructor(address contractSeller, uint value, string memory bookName, string memory description, string memory imageHash, string memory privHash, string memory dataHash) public payable
  {
    seller = contractSeller;
    name = bookName;
    text = description;
    cover = imageHash;
    preview = privHash;
    ipfsHash = dataHash;
    price = value * 1000000000000000000;
  }

  modifier condition(bool _condition)
  {
    require(_condition);
    _;
  }

  modifier onlyBuyer()
  {
    (msg.sender == buyer);
    _;
  }

  modifier onlySeller()
  {
    (msg.sender == seller);
    _;
  }

  event ItemReceived();

  function confrimReceived() public
    condition(msg.value == price)
    payable
  {
    emit ItemReceived();

    buyer = msg.sender;
    seller.transfer(address(this).balance);
  }
  function getBuyerCount() public view returns(address buyerAddresses)
  {
    return buyers.length;
  }

  function getEtherCount() public view return(uint earnedEather)
  {
    return price+= msg.value;
  }
}


texts: EVM grammar in ANTLR or something similar?

texts:
Where can I find a machine readable grammar for EVM? (and for Solidity)

Also, apart from Solidity, what other high-level languages currently exist that compile to EVM opcodes?

The reason I am asking is I'm looking for (or trying to create) some static analysis tools that look at EVM or Solidity and find exploits like TheDAO.


texts: Changing Account Password (using Parity)

texts:
This is such a silly question but my eyes are tired from searching and not finding the answer.  (I see some posts that say it is not possible with Parity but only with Geth and that does not seem likely.)

So: how do I change the passphrase for an account (in .../keys) in Parity using the command line,  RPC, and/or javascript console?

Thank you.


texts: web3.php - How to call a contract function that mutates states?

texts:
I'm creating web3 instance

            $web3 = new Web3(
                        new HttpProvider(
                            new HttpRequestManager(
                                config('infura.endpoint'),       // url
                                5.0                              // timeout
                            )
                        )
                    )
            ;

Then instance of my contract

$contract = new Contract($web3->provider, $abi);

I must call this function

    {
        "constant": false,
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_index",
                "type": "uint256"
            },
            {
                "internalType": "string",
                "name": "_data_to_store",
                "type": "string"
            }
        ],
        "name": "set",
        "outputs": [],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function"
    },

I am trying

$contract->at(config('infura.contract_address'))
    ->send('set', 22, 'hello world', function($error, $result) {
            // this is Laravel dump to screen and die command
            dd("error", $error, "result", $result);
        }
    )
;

The problem is that send throws an Exception. The Exception's message is

  "Wrong type of eth_sendTransaction method argument 0."

Could you please explain me how to use the send method?

EDIT 1:

I tried a different syntax

$contract->at(config('infura.contract_address'))
    ->send('set', 22, 'hello world', [ 'from' => config('infura.wallet_address') ], function($error, $result) {
            dd("error", $error, "result", $result);
        }
    )
;

But I got a more fun differenct exception

  The method eth_sendTransaction does not exist/is not available
  at web3.php\src\RequestManagers\HttpRequestManager.php


texts: Is every Ethereum user already familiar with Bitcoin?

texts:
What can be done to make Ethereum more approachable for those new to blockchain technology? I know a lot of people who are now interested in Ethereum but they had no idea what it was all about until they learned about Bitcoin first.

Is Bitcoin still a necessary stepping stone for learning due to its relative simplicity?


texts: Can data in an old contract still be accessed?

texts:
What happens if data is created via a contract address and then a new contract is used? Can all the old data be accessed still?

I saw this - Upgradeable smart contracts - which outlines ideas from 2016, is that still the best advice for contract management?


texts: Why wasn't this contract deployed fully?

texts:
Here is this (example) contract:

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

As you can see in 'Read Contract' and 'Write Contract' tabs, only methods available are these:

isFinalizeAgent
isSane
crowdsale
distributedReservedTokensDestinationsLen
reservedTokensAreDistributed
token
finalizeCrowdsale
distributeReservedTokens

But if you check contract's source, you will see 1,634 code lines, and it contains much more methods and members.

So, my questions are:

Why wasn't this contract fully deployed? (the majority of functions aren't present in Etherscan)
What command arguments to solc did the developer use to only compile part of the contract?
Is it possible to detect what methods/members are going to be compiled as the end result, only by looking at the source of the contract?
I am correct in my assumption that only part of contract was compiled or, was it compiled fully, but it is just the ABI that was reduced and this is why Etherscan isn't showing all the functions?
I also see that SafeMath functions are linked against an external contract,  how do you tell the solc compiler that all the calls to Safe Math have to be made through an external contract?


texts: Gas usage difference between Remix and Ganache/public networks

texts:
I'm trying to integrate a contract into a front end with MetaMask and getting different gas amounts depending on the network and compile options I use.

Remix ("Enable Optimization" checked): 90,410
Ganache/Rinkeby (no optimization): 112,500
Ganache/Rinkeby (with optimization): 101,431

I actually got the optimization settings from the Remix GitHub page here: https://github.com/ethereum/remix-ide/blob/14c22658ef5b6aa49ee31d5c92882c8a3c9e42fe/src/app/compiler/compiler-input.js

My solc configuration looks like this.  The only change I'm making to optimize is to add the optimizer setting below.

let jsonContractSource = JSON.stringify({
    language: 'Solidity',
    sources: {
      'Task': {
          content: source,
       },
    },
    settings: {
      optimizer: {
        enabled: true,
        runs: 200
      },
      outputSelection: {
          '*': {
              '*': ['abi',"evm.bytecode"],
          },
      },
    },
});

module.exports = JSON.parse(solc.compile(jsonContractSource)).contracts.Task.MyContract;

I spent a decent amount of time trying to optimize the gas consumption of the function itself in Remix, but I think I must be missing something in terms of solc configuration.

As an additional question, are there any risks associated with using solc's optimizer?


texts: Why transaction to ERC20 token smart contract causes error?

texts:
I pushed this contract

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

I want to issue test ERC20 token. But when I try to send ETH to my contract I see error.

What I missed?


texts: Can't deposit from Etherdelta wallet or Metamask to Etherdelta site

texts:
I've tried 2 ways to deposit Eth on Etherdelta site and both failed.  What am I doing wrong?

Way #1 - Moved Eth to my Metamask.  I can see the amount on Etherdelta under wallet.  I click deposit to move from Metamask to Etherdelta.  I get a popup saying sent with a link to check progress.  Click link and it says transaction can't be found.  (it does say if just submitted wait 30 seconds but I've waited hours).  My money still just shows on the Metamask and wallet area.

Way #2 - I disabled Metamask this morning, also switched out of Chrome to Firefox.  I moved more Eth from my Gdax to the Etherdelta wallet on site.  Again this money now shows in my wallet.  Click deposit to move from wallet to site itself and I get the same popup saying sent but then saying transaction can't be found.  This was about 2 hours ago.  My money still just shows on the wallet.

What am I doing wrong??  Thanks.


texts: Anyway to tell what Vyper can and cannot accomplish compared to Solidity?

texts:
After studying both Solidity and Vyper, I really like Vyper's strong security and simplicity. However one thing got me somehow worried, is that unlike Solidity, Vyper is not a Turing Complete language. Now from what I learned back in the school days, any single Turing Complete language is mathematically proven to be able to do everything that any other Turing Complete language can do. That means I know that at least in theory, anything that C, C++, Java, JavaScript can accomplish, Solidity can accomplish too. The only limit is the block gas limit (which is kind of a resource limit that all computer programs need to work with anyway), the language itself is not limited, just like Brainfuck is mathematically proven to be able to accomplish anything that C/C++/Java can accomplish despite it being an extremely barebone language.

However, since Vyper is not Turing Complete, that means that there are things that cannot be accomplished with Vyper, for example, a loop of indefinite size for the most obvious case. The indefinite-sized loop may not be something too useful or cannot be worked around with, however, I wonder if there's some way to tell if Vyper can or cannot work for a certain scenario so that when faced with certain project requirements, I will be able to tell whether I can accomplish them with Vyper or not. I'd rather not take the risk to develop with Vyper and only halfway into the project find out that there is something in the language itself that prevent me from fulfilling certain critical project requirements.

For Turing Complete languages, I have the guarantee that I can accomplish anything that any other mainstream language can accomplish, but for non-Turing Complete languages, how do I tell whether there's something in the requirements of a project that are not supported by the design of the language itself?


texts: Receive ether from one address and transfer tokens to another

texts:
I am starting a crowdsale and I want to add a custom function to my crowdsale contract. Basically I want users to be able to purchase tokens for fiat and bitcoins.

In order to make that work I will create a wallet with some ether and once a user purchase my tokens with a fiat transaction I want to send the equivalent amount of ether to my contract from my wallet address, convert the amount to the equivalent number of tokens, then transfer the tokens to the investor's address.

Is there a way to do that?


texts: networkIds: what happens if two unrelated parties create a network with same ID?

texts: Is the network ID truly unique? It's hard to believe this, as it's just an integer.


texts: How do I define a public function in a Solidity interface?

texts:
It seems all function definitions in an interface must be external. However is it okay to define a public function in its interface as external? If so, how can I define a public function that takes a bytes memory?

for example, How could I write an interface for this contract:

contract C {
  function a(bytes memory b) public view returns (bool) {
    return true;
  }
}


texts: Strange Ropsten Bug - transactionsRoot and recieptsRoot has same value

texts:
I'm testing some stuff on Ropsten network and I've found strange block:

4138624
When I run (using web3 injected in Metamask):

web3.eth.getBlock(4138624,function(err,res){

console.log(res);

})

I'm getting strange result

transactionsRoot and recieptsRoot has same value

I've posted question also on reddit
https://www.reddit.com/r/ethdev/comments/9jz5cm/strange_ropsten_bug/

I've noticed them, because for those

                    data = [];
                    data.push(res.parentHash);
                    data.push(res.sha3Uncles);
                    data.push(res.miner);
                    data.push(res.stateRoot);
                    data.push(res.transactionsRoot);
                    data.push(res.receiptsRoot);
                    data.push(res.logsBloom);
                    data.push(addPrefix(parseInt(res.difficulty).toString(16)));
                    data.push(addPrefix(res.number.toString(16)));
                    data.push(addPrefix(res.gasLimit.toString(16)));
                    data.push(addPrefix(res.gasUsed.toString(16)));
                    data.push(addPrefix(res.timestamp.toString(16)));
                    data.push(res.extraData);
                    data.push(res.mixHash);
                    data.push(res.nonce);

if(res.hash==="0x"+utils.keccak256(rlp.encode(data)){
   // OK
}else{
//Something wrong
}

returns incorrect hash (while for most works just fine)


texts: Who will execute the smart contract for us?

texts:
I want to know who will help us execute when we call the functions in the smart contract. Is it the miner who put this transaction in the block?
Hope you can give me some help, Thanks!


texts: Governance voting option for a platform similar to compound that is dynamic and people can make their own options apart from yes/no

texts:
it should just read the voting power and let people vote between different options. the result needs to be logged,
how can I create a simple smart contract for the 3rd choice or option for people voting?
They can input their own options.
Example : if someone proposes a higher price for the token.
This choice can be YES / No
or a third option for users to input a new price suggestion.


texts: How to get test coin for Rinkeby Metamask

texts: I create a wallet on metamask and i would like to play with rinkeby test net. I can't get the coins through the twitter procedure. I attach already that I come out, can someone help me? thanks


texts: what does call stack of 1024 mean in solidity?

texts:
Assumption 1:
If we create a local variable, call stack increases by 1, because we put this new local variable on the stack. if I create another local variable, it again increases by 1. So, with this logic, i shouldn't be able to create more than 1024 local variables ?
Assumption 2:
maybe solidity means 1024 of external calls . but as you can see, it justs says this:
External function calls can fail any time because they exceed the maximum call stack of 1024
It doesn't concrete and just say call stack of 1024 .
So, what does it mean exactly ? call stack increases even for local variables.


texts: Get Data In Mapping From Another Contract

texts:
mapping(address => uint256) public something;

I would like to copy the data in the mapping above into a new mapping in a new contract. Kinda like exporting the data. Any ideas?


texts: Truffle returning balances from a function

texts:
This maybe just a simple Javascript issue, but it's in the context of running under Truffle. I can't seem to access my object variables coming back from my function; thus the tests are failing with error about the toString being undefined.  So I added console.log code to show the values...

To avoid rewriting repetitive, code, I created this function:

async function GetAndShowUserBalances(description, userName, userAddr)
{
  let balanceTokens, balanceEth
  balanceTokens= await exchange.balanceOf(token.address, userAddr);
  balanceEth  = await exchange.balanceOf(ETHER_ADDRESS, userAddr);
  console.log("ShowUserBalances: " + description + " " + userName +
                 " Ether=" + tokensRev(balanceEth) +
                 " Tokens=" + tokensRev(balanceTokens));
   var result = {};
   result.Ether = balanceEth;
   result.Tokens = balanceTokens;
         console.log('============================================ START result ')
         console.log(JSON.stringify(result))
         console.log('============================================ END  result ')

   return result;

}

The results look good as JSON in the above console.log.

Then I call it like this:

describe('depositing tokens', async () => {
  let result, user1Balances
  const numTokensToDeposit = 8

   describe('success', async () => {

      beforeEach(async() => {
          //approve this smart contract as the exchange address
          user1Balances = GetAndShowUserBalances("before  depositToken", "user1", user1Addr)
          await token.approve(exchange.address, tokens(numTokensToDeposit), { from: user1Addr})
          result = await exchange.depositToken(
                         token.address, tokens(numTokensToDeposit), { from: user1Addr})
          console.log("DepositTokens completed: numTokensToDeposit=" + numTokensToDeposit)
      })

      it('tracks the token deposit',async() => {
         user1Balances = GetAndShowUserBalances("after depositToken", "user1", user1Addr)
         // check exchange token balance
         //balance1 = await token.balanceOf(exchange.address);
         console.log('============================================ START user1Balances ')
         console.log(JSON.stringify(user1Balances))
         console.log('============================================ END  user1Balances ')
         user1Balances.Tokens.toString().should.equal(tokens(numTokensToDeposit).toString())
         //check tokens on exchange for the user
         //balance2 = await exchange.tokens(token.address, user1Addr)
         user1Balances.Ether.toString().should.equal(tokens(numTokensToDeposit).toString())
      })

Console display:

depositing tokens
      success
ShowUserBalances: before  depositToken user1 Ether=0 Tokens=0
============================================ START result
{"Ether":"0","Tokens":"0"}
============================================ END  result
DepositTokens completed: numTokensToDeposit=8
============================================ START user1Balances
{}
============================================ END  user1Balances


texts: interact with a solidity contract through contract's address

texts:
i have contract factory which looks like following

pragma solidity ^0.4.8;
import './RentalContract.sol';

contract contractFactory {
  address[] public contracts;

  function getContractCount() public constant returns(uint contractCount) {
    return contracts.length;
  }

  function newContract(uint _rent, uint _security_deposit, string _house, address _owner, address _tenant)
  public constant returns(address) {
    Rental c = new Rental(_rent, _security_deposit, _house, _owner, _tenant);
    contracts.push(c);
    return c;
  }
}

this contract has a function called newContract which creates an object of another contract called RentalContract and returns the address of the newly created object. Now i want to interact with this newly created instance of Rental contract through this address using web3js. How can I achieve this?

EDIT

here is my rental contract

pragma solidity ^0.4.8;

contract Rental {
    struct PaidRent {
        uint id;
        uint value;
    }
    PaidRent[] public paidrents;

    uint public createdTimestamp;
    uint public rent;
    uint public security_deposit;
    string public house;
    address public owner;
    address public tenant;

    enum State {Created, Started, Terminated}
    State public state;
    function Rental(uint _rent, uint _security_deposit, string _house, address _owner, address _tenant) {
        createdTimestamp = block.timestamp;
        rent = _rent;
        security_deposit = _security_deposit;
        house = _house;
        owner = _owner;
        tenant = _tenant;
    }
    modifier require(bool _condition) {
        if(!_condition) throw;
        _;
    }
    modifier ownerOnly() {
        if(msg.sender != owner) throw;
        _;
    }
    modifier TenantOnly() {
        if(msg.sender != tenant) throw;
        _;
    }
    modifier inState(State _state){
        if(_state != state) throw;
        _;
    }

    function getPaidRents() internal returns (PaidRent[]) {
        return paidrents;
    }

    function getHouse() constant returns (string) {
        return house;
    }
    function getowner() constant returns (address) {
        return owner;
    }
    function getTenant() constant returns (address) {
        return tenant;
    }
    function getRent() constant returns (uint) {
        return rent;
    }
    function getDeposit() constant returns (uint) {
        return security_deposit;
    }
    function getContractCreated() constant returns (uint) {
        return createdTimestamp;
    }
    function getContractAddress() constant returns (address) {
        return this;
    }
    function getState() returns (State) {
        return state;
    }
    function CollectEth() payable  {}

    function payRent() TenantOnly inState(State.Started) require(msg.value == rent) {
        owner.transfer(msg.value);
        paidrents.push(PaidRent({
            id : paidrents.length + 1,
            value : msg.value
        }));
    }

    function terminateContract(address deposit_to) inState(State.Started) require(this.balance == security_deposit) {
        deposit_to.transfer(security_deposit);
        state = State.Terminated;
    }

}

i am able to create a new instance of this rental contract thorugh contractFactory's function called newContract. i can interact with this new rental contract by var c2 = Rental.at('0x0109b453ea7734c2c32c3fc73b80de42d6e81f8e') on truffle console. but i don't know how to do this in my angular's service using web3js. if i try to use it in the same way as truffle console it says cannot find name Rental.


texts:
I am wondering if the following code will produce the transaction with two actions:
pragma solidity ^0.7.1
import "https://github.com/bla-bla-bla/contractA.sol";
import "https://github.com/bla-bla-bla/contractB.sol";

contract contractC {

  constructor() {
    contarct_a = contractA(contractA_address);
    contarct_b = contractB(contractB_address);
  }

  function foo(
     // interaction with contractA
     param1
     param2
     param3

     // interaction with contractB
     param4
     param5
     param6
  )
  contract_a.function1{ value: msg.value }(param1, param2, param3);
  contract_b.function2{ value: msg.value }(param4, param5, param6);
}


texts: How connect to my geth from Remix? IPC is always \\\.\\pipe\\geth.ipc

texts:
I am trying to develop smart contract & dapp with Window 10.

I made my own accounts in local testnet in geth.

And I'd like to make smart contracts and deploy them on the Remix.

so I need to approach to my geth from Remix.

I switch environment option from Javascript Vm/Injected Wev3 to Web3 provider!

then it required "Web3 Provider Endpoint".

Default was http://localhost:8545. (it doesn't work)

I heard that 8545 is RPC port, and localhost is IPC.

when I run my geth, I can check my RPC port.

<< HTTP endpoint opened url = hrrp://0.0.0.0:9797 >>

However, I can't know my geth IP

it is always indicated like below

<< IPC endpoint opened url= \.\pipe\geth.ipc

I can't refer my IP

How can I control my geth on Remix?


texts:
I have tried to run Oracalize as 1:1 of the example provided on their site. During the creation of the contract, I am also sending 1 ether to it (so it is not empty). Still even 30 minutes after this, there appears to be no callback to the contract.

Contract address: 0xbedb1be6c46ac0bc708bc93e3b17edc7751b1187

There are 0 incoming transactions: https://ropsten.etherscan.io/address/0x4e3ffaca2ea2a0afd838116493adcb6d714f5963


texts: How does (current block number - block number of a given transaction) gives the confirmation count?

texts:
I found a discussion here How do I get the number of confirmations on a transaction in geth or any other tool? that give the solution as:

web3.eth.blockNumber-web3.eth.getTransaction(<txhash>).blockNumber

I tried this formula and compared the value with the confirmation count returned by http://testnet.etherscan.io/api?module=account&action=txlist&address=0x4c... Both seems to match.

My question is how can this number be considered as confirmation? Is it the case of "longer it stays, bigger the confidence that it is genuine"?


texts:
Yesterday I decided to move my Ethereum coins to my coinbase account from my PC based Ether wallet from Ethereum.org . I had 107ish coins. I sent 1.2 to my coinbase address as a test and they arrived with no issues.

I then repeated the same process with the remaining 105 and the coins left my wallet but never arrived at my coinbase wallet. I have looked at the blockchain to try to find my transaction but the blockchain says the transactions never happened and my wallet still has a balance of 104 coins however my wallet on my pc shows my balance as 0.0.

Need help please.

https://etherscan.io/address/0x108091B54A547e9334FEAA72F59ec47272654dea

Thanks


texts: Recommended way to add and remove funds from an account

texts:
I am trying to create a simple contract which adds the amount (passed as a parameter) to contract owner and reduces the equivalent amount from an account (account address passed as a parameter).

In the contract, I have created a second function 'getBalance' to inquire account balances.
After executing the transferamount function when I inquire the account balances of contract owner and the passed account, they remain same with no increase or decrease of ethers. But when I verified the balances in the account balance mapping 'balanceOf' that I created in the code, I can see changes in amounts via the events that I set to watch balances before and after the transaction.

Pardon me for my noob status in solidity coding and kindly suggest what is an optimal way to implement requirement wherein we have to add or subtract a definite amount from user accounts and contract accounts.
Also, please highlight errors in my code that can fix the issue.

Below is the logic of the code that I created.

pragma solidity ^0.4.0;

import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";

/*
 * @title Testing Oraclize
 * Test contract to understand the basics of leveraging the Oraclize service.
 */

contract Betting is usingOraclize {

    address public owner = msg.sender;
    uint accountbalance;

/*Events*/
    event Log(string);
    event error(string error_);
    event beforebetbalanceplayer(uint256);
    event beforebetbalanceowner(uint256);
    event afterbetbalanceplayer(uint256);
    event afterbetbalanceowner(uint256);
    event betamount(uint256);

/*Modifier*/
        modifier onlyOwner {
            require(msg.sender == owner);
            _;
        }
/*Constructor*/

/*Array*/
mapping (address => uint256) private balanceOf;

/*Put Bet*/
        function transferamount (address _player, uint256 _amount) public payable {

                balanceOf[_player] = _player.balance;
                balanceOf[owner] = owner.balance;

                beforebetbalanceplayer(balanceOf[_player]);
                beforebetbalanceowner(balanceOf[owner]);

                Log("Reducing amount from player's account");
                balanceOf[_player] -= _amount;
                afterbetbalanceplayer(balanceOf[_player]);

                Log("Adding amount to owner's account");
                balanceOf[owner] += _amount;
                afterbetbalanceowner(balanceOf[owner]);

                afterbetbalanceplayer(_player.balance);
                afterbetbalanceowner(owner.balance);

            }

/*Get Balance*/

        function getBalance (address _account) constant returns(uint256){
                return _account.balance;

        }

/*Payable Fallback function*/

        function()  payable{

            }
}


texts: How much liquidity is needed to introduce new ERC20 on uniswap?

texts:
How much liquidity is needed to introduce a new ERC20 on uniswap?
For example for 250 billion tokens of new ERC20 contract "X" how much it would cost to create a pool so the 1 "X" Token value would be approx 0.01 or less. Or maybe it's recommended to provide a smaller pool for the first exchange pool?
So far I did create an example pool for 5000 "X" Tokens, it cost me like $40, but to publish the pool they asked for 1.8K USD. Is there a chance I will get this money back or it's the price for adding a new token for the first time?
And as far as I understand for new tokens, when you create a pool for the first time it costs a lot more than after. Why it's like that?
And last but not least, if I will create a liquidity pool for the new token "x" for:
5000 "X" Tokens + 0.2ETH (801.151956 USD), means the 1 "X" Token price will be approx:
0.16 cents per "X" Token. If someone buys 1 "X" Token, i will get 0.16cents + 3.6%?


texts: Blockchain applications possible without intense mining?

texts:
I Continually hear about how many different applications there are for blockchain. I also continuely hear how hard it is to mine blockchain (both power consumption and complexity).

It makes complete sense why bitcoin mining works, miners get paid (rewarded bitcoin) when they successfully mine a transaction and add to the chain. Thus (hopefully) the money they spent in power mining the coin is offset by the reward.

Question: So how is it feasible to apply block chain technology to other applications (product tracking, advertising tracking, anything that could benefit from an immutable ledger) if those applications don’t have some sort of reward or payment? The cost to mine the chain wouldn’t be worth it to anyone, right? Or am I missing something.


texts: web3.eth methods in remix console don't work

texts:
I was working with one of my contracts in remix, running in javascript vm environment.

And i just had to check the balance of my contract.
when i tried this in the console

  web3.eth.getBalance("0x0fdf4894a3b7c5a101686829063be52ad45bcfb7")

it says

  this.provider[(intermediate value)] is not a function

I tried async method with callback.. same response.
none of the methods seem to be working..
what is the correct way to do so..

i know i can connect to injected web3/web3 provider and run commands in terminal. but i want to be able to do it in Javascript vm as it is faster while testing..


texts:
First of all, sorry for the code in Portuguese, this was a choice of the team and I had no saying on that.

I'm writing a Billet Manager, the code is as follows:

contract GerenciadorBoletos {

     struct Boleto {
         uint codigoBarra;
         uint codigoBarraDigitavel;
         uint cpfOuCnpjBeneficiario;
         uint cpfOuCnpjPagador;
         uint valorOriginal;
         uint dataVencimento;
     }

     mapping(uint => Boleto) registroBoletos;

     function inserirBoleto(
         uint codigoBarra,
         uint codigoBarraDigitavel,
         uint cpfOuCnpjBeneficiario,
         uint cpfOuCnpjPagador,
         uint valorOriginal,
         uint dataVencimento
     ) {
         Boleto memory b = Boleto(
             codigoBarra,
             codigoBarraDigitavel,
             cpfOuCnpjBeneficiario,
             cpfOuCnpjPagador,
             valorOriginal,
             dataVencimento
         );

         // I need to do some validations before store it, but there is no code yet

         registroBoletos[b.codigoBarra] = b;
     }
}

I'm testing it with TestRPC and Mocha:

 describe('1. Inserção', function(){
     it('Deve ter inserido um boleto com os dados válidos com sucesso', function(done){
         var boletoParaInserir = gerarBoletoValido();
         console.log(boletoParaInserir);

         gerenciadorBoleto.inserirBoleto.sendTransaction(
             9872387128, 987128382, 91289312, 81273818, 50, Date.now() + 3*24*3600,
             {
                 from: web3.eth.accounts[0],
                 gas: 3000000,
             },
             function(e, result) {
                 expect(e).to.not.exist;

                 expect(result).to.exist;
                 result.should.be.above(0);
             }
         );
     });
 });

I'm getting the following error:

Uncaught AssertionError: expected [Error: Error: VM Exception while
    executing transaction: invalid opcode

Edit

This seems to be an issue with TestRPC.

I've opened an issue on github.


texts: Why does ethereum creates a new block,without even a single transaction?

texts: I'm running a private Ethereum blockchain. When I set one of the nodes to mine, that node continuously creates blocks, even if there are no transactions inside of it. What is the purpose of this?


texts: Instrumenting GETH: breakpoints on evm never hits

texts:
I'm trying to instrument the GETH virtual machine, and in order to do so I'm studying the geth code running it on debug.
I expected that, during syncing, EVM is used to compute state of each single contract, and I put a breakpoint in the function NewEVM in /vm/eth.go. I expect some time this to be hit when GETH create an instance of the vm, but it never happen, so I'm surely getting wrong somewhere, can anybody help?
I'm using VSCode and Delve debugger.


texts:
I have the following code:

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.7.0;
pragma experimental ABIEncoderV2;

contract VenueRegistry{
    struct Queue{
        uint head;
        uint tail;
        mapping(uint => address) queue;
    }

    struct Venue{
        uint id;
        Queue queue;
    }

    mapping (uint => Venue) public venues;

}

I get the following error:

  TypeError: Internal or recursive type is not allowed for public state variables.
  mapping (uint => Venue) public venues;

So I made the venues private and wrote a getter:

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.7.0;
pragma experimental ABIEncoderV2;

contract VenueRegistry{
    struct Queue{
        uint head;
        uint tail;
        mapping(uint => address) queue;
    }

    struct Venue{
        uint id;
        Queue queue;
    }

    mapping (uint => Venue) venues;

    function getVenue(uint _index) public view returns(Venue memory){
        return venues[_index];
    }
}

Then I get the following error:

  Only libraries are allowed to use the mapping type in public or external functions.

The problem seems to be with the mapping inside of struct Queue. When I remove the mapping it works. Is there a way to have nested structs with mappings inside them?


texts: How can I connect my company with Ethereum?

texts: Hello Im very excited about the cryptocurrency revolution and believe strongly in its benefits. But could anyone give me some examples of how to connect your company with cryptocurrency? Greetings Robin


texts: Can i receive/use an already existing ERC 20 token in a new smart contract?

texts: If i already have an ERC20 tokens created and has basic functionalities of a token sat at contract address A, can i start to develop a new smart contract which can make use of the ERC20 token at contract address A.


texts:
please help, I have 1 transaction stuck 7 days,  I have sent 1 transaction with 0 ETH and nonce to the same address, to cancel the stuck transaction but all the nonce too low error, looking forward to help help, thanks
i.stack.imgur.com/Kuh7a.png


texts: chrome is stuck on the old last contract that I deployed

texts:
when I deploy a contract (on the local net )with truffle, I can't interact with it on the browser, on the browser I see an old contract that I deployed in the past.
when I go to the console and do
console.log(contractInstance.methods)

I get the methods of the old contract , and when I do this
console.log(contractInstance._address)

I get the address of the current smart contract.
I tried rebooting the PC, testing on another browser, rebuilding the .json file, deploying a different smart contract .... but I still get that old smart contract in the browser.
TIP:
on ganache in the contract section I see that the current smart contract has been deployed successfully, the address is the same as the address of the smart contract that I just deployed
the contractInstance is created like this
$(document).ready(function() {
    window.ethereum.enable().then(function(accounts){
      contractInstance = new web3.eth.Contract(window.abi, "0x9fDc28ffAd66B8BA9dBC883524A8E4F0309cD25c", {from: accounts[0]});
    });
});


texts: Can I pass addresses as parameters in the constructor of the contract?

texts:
Well I know that in theory the obvious answer is yes, as the constructor is a function like the others, but have its own characteristics. But, I want to be sure, because let's suppose that I pass an address that was already assigned to another contract in the blockchain, what happen in that situation? There is an option (a kind of alert) to avoid this situation? or just this didn't and will not happen never?

Maybe is 99.9% impossible, but I want to be sure. Is not better that this kind of addresses are generated by the network? I so, how can I do this in the deployment process?

Here a code, to be clear:

contract SimpleContract {
  address public personalAddress;

  function SimpleContract(address givenAddress) {
    personalAddress = givenAddress;
  }

}


texts: Is there any GUI to see the chain from ldb database: view blocks, wallets, etc?

texts:
Is that true: files with *.ldb = LevelDB files?

So i looked for LevelDB GUI managers and launched some of them to look through my local test chain:

levelui (can't launch)
Keylord (launch but get strange ureadable
view of chain)
DB Browser for Sqlite (not for this, but also open
ldb with answering me for db password, where it get - didn't know)

All solutions which i tried - bad.
Also i look at ganache, but this is not that i need.

I want to find a way to look readable raw blocks in local test chain, to understand how wallets, contracts, blocks look. Maybe anyone know how it do much better - give some advice please. I found so-so example which more closest to my problem: block 911516 in etherchain, but with maybe some info, not with all.

thx a lot.


texts: TransferFrom ERC20 token to burn address from another Contract

texts:
I am working on a migration contract and the flow is as follows:
Contract function calculates balance of XXX coin
-> Contract sends amount XXX of OLD token to burn address
-> Contract sends xxx of new token to msg.sender
I am having issues with the middle part and the transferFrom() call is giving me the below error:

transact to DeadTokenMigration.migrate errored: VM error: revert. revert The transaction has been reverted to the initial state. Note: The called function should be payable if you send value and the value you send should be less than your current balance. Debug the transaction to get more information.

I realize this is quite a common error, but I cannot figure out which account is actually at fault here
Here is the code of the function:
 function migrate() public virtual{

// gets Dead CoinBalance for a user.
XXXBalance = DeadToken(CoinToBeConverted).balanceOf(_msgSender());

//For TRansparency, old coins are sent to the Burn Address
require(XXXXBalance > 0, "Balance too small to migrate!");
DeadToken(CoinToBeConverted).transferFrom(_msgSender(), address(0), XXXXBalance);

// Transfer from RCVR Migration contract to msg.sender
XXXX(XXXXAddress).transfer(_msgSender(),XXXXBalance);

}
}
The First and last functions work so getting the balance and transferring the new tokens across
Any help would be amazing!


texts: Error received saying Provider is not set, when trying to call a function, after deploying a contract

texts:
Should we set provider for contract instances separately or am I missing something. Is there any problem setting it to current provider instance?
I am using the "1.0.0-beta.26" web3.

The error is received after I deploy the contract (successfully) and try to call the offerBet function.

Here is the code

var Web3 = require("Web3");
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
web3.eth.getAccounts().then((accounts)=>{
    web3.eth.defaultAccount = accounts[0];
    console.log("Default Account", web3.eth.defaultAccount);
    //To be used from the console
    module.exports.web3   = web3;
    module.exports.party1 = accounts[1];
    module.exports.party2 = accounts[2];
})

var solc = require("solc");
var src = `pragma solidity ^0.4.19;
contract coinFlipper{
    mapping(uint=>address) parties;
    mapping(address=>uint) bets;

    enum GameState { betOpen, betWaiting, betClosed}
    GameState public coinFlip;

    function coinFlipper() public{
        coinFlip = GameState.betOpen;
    }

    function offerBet(uint _amount) public payable {
        require(coinFlip == GameState.betOpen);
        coinFlip = GameState.betWaiting;
        parties[0] = msg.sender;
        bets[msg.sender] = _amount;
    }

    function meetBet(uint _amount) public payable {
        require(coinFlip == GameState.betWaiting);
        require(_amount >= bets[parties[0]]);
        coinFlip = GameState.betClosed;
        parties[1] = msg.sender;
        bets[msg.sender] = _amount;
    }

}`;

//Helper functions to play around in the console
module.exports = {
    //Prepares the contract deploy transaction
    deployCoinFlipper : function(){

        var compiled            = solc.compile(src);
        //console.log("compiled", compiled);
        var compiledContract    = compiled.contracts[":coinFlipper"];
        var abi                 = JSON.parse(compiledContract.interface);
        var coinFlipper         = new web3.eth.Contract(abi, '', {
            from: web3.eth.defaultAccount
        });

        coinFlipper.options = {
            jsonInterface: abi,
            from : web3.eth.defaultAccount,
            data : '0x' + compiledContract.bytecode,
            gas : 4700000,
            gasPrice : 10
        };

        var deployed = coinFlipper.deploy(coinFlipper.options);
        return deployed;
    },

    //Calls the contract offerBet function
    offerBet : function(contract, party, amount){
        contract.methods.offerBet(amount).send({from:party})
        .then(receipt => console.log(receipt));
    },

    //Calls the contract meetBet function
    meetBet : function(contract, party, amount){
        contract.methods.meetBet(amount).send({from:party})
        .then(receipt => console.log(receipt));
    },
}


texts: Contract deploy error with Cannot create property 'from' on string


texts: How to fix a deployed contract that was hit by a 'breaking change'

texts:
A developer of Remix told me that if a deployed contract suffers from a breaking change, then it may become a "dead" contract. Which means that it has become unaccessible in its runtime environment.

If that is true: What can I do as a Solidity programmer to prepare for a breaking change so that I port and preserve my existing contract of a past version?

To focus my question: It is a general question about backwards compatibility of an existing contract in the case of a hard fork.


texts: Question about how to have interacting contracts

texts:
Let's say I'm doing a crowdsale, but instead of selling a set amount of tokens I'm just giving tokens away at a pre-set price. In other words, my token has the following functoin:

function give(address giveToAddress,uint amount)onlyPermittedContracts{
    balanceOf[giveToAddress]+= amount;
}

Now I only want permitted contracts to execute this function. So I add the following modifier:

modifier onlyPermittedContracts{
    if(permissibleContracts[msg.sender]!=true){
        throw;
    }
    else if(permissibleContracts[msg.sender]==true){
        _;
    }
    throw;
}

And a way for the owner to add permitted contracts:

function setPermissibleContract(address _contactAddress)onlyOwner{
    if (permissibleContracts[_contactAddress] == true){
        permissibleContracts[_contactAddress]==false;
    }
    else{
        permissibleContracts[_contactAddress]==true;
    }
}

Then, in my crowdsale contract I add the following code:

token public rewardToken = myTokenAddress; //(this is set in constructor)
function () payable{
    if (saleClosed)
        {throw;}
    else{
        uint amount = msg.value;
        balanceOf[msg.sender] = amount;
        amountRaised += amount;
        rewardToken.give(msg.sender, amount / tokenPriceInEther)
    }
}

My question is whether this is the proper way to interact between tokens and contracts.

Additionally, when I create "token public tokenReward" how does ethereum know that my token is a token as opposed to any other type of contract?


texts: How to create batch of accounts by using geth?

texts:
To create on account&keystore using:
geth --datadir node1/ account new

How to create 100 account&keystore in one time?


texts: how to send my precrowdsale funds to crowdsale contract?

texts:
I'm having a precrowdsale and a crowdsale, How can I send the ether from the first to the second once the precrowdsale is over? this is the script I have:

//send to crowdsale

if(receiver_address.send(amount_in_Wei)){

//sending is successful

} else {

// sending failed
}
}

but Ethereum Wallet compiler says:
 Could not compile source code.

Expected import directive or contract definition.
    if(receiver_address.send(amount_in_Wei)){
    ^

What's wrong? Thank you!!!!


texts:
Within seconds of starting the console, my machine goes into overdrive with the fan kicking in and everything. How can I tell geth to take it easy?

I am running a quad core i5-3317U CPU @ 1.70GHz via Ubuntu.


texts: Issues with converting UINT to STRING - strange character

texts:
I am trying to use the  uintToString method to convert a uint to string but I keep getting a weird square character in front of the resulting string.

How do I remove this character, or better yet how do I prevent it from appearing in the first place?

function uintToString(uint v) constant returns (string str) {
    uint maxlength = 100;
    bytes memory reversed = new bytes(maxlength);
    uint i = 0;
    while (v != 0) {
        uint remainder = v % 10;
        v = v / 10;
        reversed[i++] = byte(48 + remainder);
    }
    bytes memory s = new bytes(i + 1);
    for (uint j = 0; j <= i; j++) {
        s[j] = reversed[i - j];
    }
    str = string(s);
}


texts: Where can I find test-ether for the Kovan Test Network?

texts: I have tried getting some using my github account but my account got flagged immediately and the program wasn't recognizing my account (Since it wasn't public due to being flagged). Are there any alternatives? Thanks in advance!


texts: Inline assembly function parameter has same name with local variable

texts:
contract Test {
    function f() public returns(uint r) {
        uint x = 100;
        assembly {
            function f(x) -> y { y := add(x, 1) }
            r := f(100)
        }
    }
}

Use the latest compiler to compile this Test contract, got a error:
DeclarationError: Cannot access local Solidity variables from inside an inline assembly function.

Is it right or bug?


texts: How to install eth on debian? (symbol lookup error)

texts:
I installed from the ubuntu ppa and got this error.

➜  ~  eth
eth: symbol lookup error: eth: undefined symbol: _ZN3dev3eth14EthashGPUMiner14s_numInstancesE

What can I do / check?

I'm on debian testing so maybe something conflicts.


texts: Is it possible to use a multisig wallet without downloading the whole blockchain?

texts:
Related:

What are the Ethereum disk space needs?
Is there a way to set up an Ethereum wallet without downloading the whole blockchain?

Is it possible to have it installed and use some clever features (multisig) without downloading (syncing) the blockchain?


texts: What is the name of the minor unit of USDT (Tether)?

texts:
Is there a name given to the smallest unit of USDT or Tether? For example:

1 Bitcoin = 100000000 satoshi
1 Ether = 1000000000000000000 wei
1 USDT = 1000000 ??

If there is no such name, I would accept this as an answer as well.


texts: Problems calling sendTransaction from within an event handler

texts:
I'm having problems with Error: Invalid number of arguments to Solidity function. Basically, the problem comes when I call sendTransaction with an event handler. i.e. here's the code after hooking up a Solidity event:

// premisObject was setup earlier to point at the Abi at the contract's deployed address
const premisObject = this.premisObject
// rightsSetRights has been hooked up to the required event
const rightsSetRights = this.rightsSetRights
rightsSetRights.watch(function (error, result) {
  if (!error) {
    const index = result.args._index
    const hash = result.args._hash
    premisObject._setRights(hash,index, {gas: 200000}))
  } else {
    console.error(result)
  }
})

That call to premisObject._setRights(hash,index, {gas: 200000})) fires the error. If I make the same call outside of the event handler:

premisObject._setRights(this.state.hash, 0, {gas: 200000})

....works just fine. I need to call premisObject._setRights inside that event handler, somehow, because that's when I know the value of the required index. Any ideas what's going on? Or perhaps you've got a cunning plan which means I can circumvent the issue?


texts: How to start ethereum classic (ETC) testnet/morden node?

texts:
I want to be able to start a node that will sync to the ETC testnet (is that morden?) network and allow me to query over web3 (or other) interface.

I tried all tutorials and documentations, I tried using geth and using parity.  It never manages to connect to any node on the network and syncs nothing....

I tried using bootnodes from other (OLD) answers but without success. If I try to start the main ETC network it works.


texts:
could the metadata inn ERC721 be altered after issuing a token ?
    I want to create an contract allowing people changing the Token metadata content (on the tokens purchased in ICO).


texts:
Is it safe to store the only copy of your Keystore/JSON file on a flash drive?
 I am currently using this method


texts: how to get array that contain certain value

texts:
I'm new in solidity, I want to ask, in my case I want to store a data that may contain the same user ID but different value inside it each transaction, here is my smart contract:
pragma solidity 0.5;
contract userID{
  struct User {
        uint256 uid;
        bytes32 item;
      }
  mapping (uint256 => User) public  users;
  uint counter = 0;
  function sendReview(uint256 _uid, bytes32 _item) public{
      User storage useritem = users[counter];
      useritem.uid= _uid;
      useritem.item= item;
      counter++;
  }
   function getitem(**uint256 _uid**) public view returns( uint256, bytes32){
       **User storage users._uid**;
      return(users.uid, users.item);
  }
}

I want to get the item based on the uid that inserted into the function, how can I do it? I've tried a several way in 'User storage users._uid' but didn't work at all, or is there any better way to do it?
EDIT:
I want store the data like:
user[0] = ["1","apple"]
user[1] = ["1","orange"]
user[2] = ["2", "grape"]

so the get function if I set the value of uid into 1 then the result will be:
["1","apple"],
["1","orange"]


texts: How tokens in Crowdfunding gain their value?

texts: From my understanding, if the crowdfunding is successful, all of the gathered ether is sent into the ICO wallet, meaning the contract is left without any ether. Doesn't that mean the token becomes worthless, since people can't exchange it back to ether since the contract can't give any ether.


texts: out of gas error by assembly delegatecall

texts:
I want to get a return value from current contract call other contract by delegatecall, but got a error of out-of-gas. I try to add gas limit to 3000000000, but it doesn't work. please help me. And i consulted How can I get delegatecall to return data, delegatecall and function return values, but can't find problem. My contract as follows:

pragma solidity ^0.4.13;

contract Core {

    uint balance = 10;

    function getBalance() constant returns (uint){
        return balance;
    }

}

contract CoreAPI {

    function getBalance() constant returns (uint);

}

contract Shell is CoreAPI{

      CoreAPI core;
      address creator;

      function Shell () {
          creator = msg.sender;
      }

      function upgrade(address _core){
          if (msg.sender != creator) {
              revert();
          }
          core = CoreAPI(_core);
      }

      function getBalance() constant returns (uint response){
          address dest = core;
          bytes4 calldata = bytes4(sha3("getBalance()"));
          assembly {
               let status := delegatecall(gas, dest, add(calldata, 0x20), mload(calldata), 0, 32)
               response := mload(0)
          }
      }

  }


texts: Invoking events without "emit" prefix is deprecated

texts: I have read a similar answer to this question. But, I don't understand why events without the 'emit' keyword are not working now. It was working a few days ago. Now, all my contracts are breaking! Can someone explain it to me?


texts: Exchange wallets, hardware wallets and web wallets: Why don't they all have a seed recovery phrase?

texts:
Here's what I think is going on

Exchange wallets for ether have no seed recovery phrase. Only one's log-in and password to their account on the exchange grants access to their wallet.
Hardware wallets for ether have no seed recovery phrase, but the
hardware device itself does. Meaning that losing the device, and recovering crypto on a new identical hardware device using their device seed phrase grants access to their wallet many times over.
Web wallets like MetaMask do have a seed recovery phrase.

What explains the difference in the fact that, all the above are by nature Ether wallets, no more no less, yet only web wallets require the owner to set up a recovery seed phrase for the wallet itself?
Is the owner more or less in control of their private keys for one of the options in the list than the others?


texts: Why can't I create contracts using example code?

texts: I am a noob when it comes to creating contracts. Every contract I try to deploy using the example code for new coin creation seems to have failed even though I paid for it, what am I doing wrong? Did I run out of "gas", if so how do I pay enough for it?


texts: How can Uniswap instance ERC20 tokens without importing code?

texts:
I was checking Uniswap contracts github repo and I don't understand exactly how can they dynamically use any ERC20 tokens without importing the code or having the ERC20 token smart contract address.
I know that the magic is in this function, specially in assembly create2 function, but cannot understand it properly.
function createPair(address tokenA, address tokenB) external returns (address pair) {
    require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES');
    (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
    require(token0 != address(0), 'UniswapV2: ZERO_ADDRESS');
    require(getPair[token0][token1] == address(0), 'UniswapV2: PAIR_EXISTS'); // single check is sufficient
    bytes memory bytecode = type(UniswapV2Pair).creationCode;
    bytes32 salt = keccak256(abi.encodePacked(token0, token1));
    assembly {
        pair := create2(0, add(bytecode, 32), mload(bytecode), salt)
    }
    IUniswapV2Pair(pair).initialize(token0, token1);
    getPair[token0][token1] = pair;
    getPair[token1][token0] = pair; // populate mapping in the reverse direction
    allPairs.push(pair);
    emit PairCreated(token0, token1, pair, allPairs.length);
}

Could anyone provide further information?


texts: Has the Hard fork (and surrounding issues) affected the planned transition from Proof of Work to PoS

texts:
There was a lot of talk about Ethereum switching from PoW to PoS some time this year.
Has the DAO and the Hard Fork delayed or otherwise affected when that might happen?


texts:
i want to make crypto to crypto smart contract where i need to sell erc20 token and on buyer side i need to calculate the price which i have to send to seller and i have a price of token can you please describe the calculation.below is my function.

function buyToken(uint256 _tradeId, address token, uint256 _quantity, uint256 _tokenPrice) external {

   uint256 quantity = _quantity * (10 ** ERC20Interface(token).decimals);
   uint256 amount = quantity * _tokenPrice;

}


texts: Is it compulsory to deploy 1_initial_migration.js every time I deploy a contract?

texts:
When I run truffle deploy, it deploys 1_initial_migration.js before every contract. Is there anyway this can be avoided? Or is this part of protocol and is supposed to happen everytime?
Thank you.


texts: Python ethereum create account using web3.py

texts:
I am trying to create account for a user using web3.py in my local testrpc ethereum network. I have tried as per the documentation. But I am getting the error

AttributeError: 'Eth' object has no attribute 'account'

Code I am trying :

from web3 import Web3
w3 = Web3(YOUR_PROVIDER)
acct = w3.eth.account.create('KEYSMASH FJAFJKLDSKF7JKFDJ 1530')

I could see there is accounts object in for eth object but that is not what I need.

What am I doing wrong ? I could see there is another type of account which is called PersonalAccount in the doc

What is the difference between these two ?


texts: I am not sure if mining has started with ethminer

texts:
0:28
m  15:38:55|ethminer  Got work package: #6c0f3492
m  15:38:56|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0]     Time: 00:28
m  15:38:56|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0] Time: 00:28
m  15:38:57|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0] Time: 00:28
m  15:38:58|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0] Time: 00:28
m  15:38:58|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0] Time: 00:28
m  15:38:59|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0] Time: 00:28
m  15:39:00|ethminer  Speed   0.00 Mh/s    gpu/0  0.00  [A0+0:R0+0:F0] Time: 00:28

I see this in my console, it says Got work package but I see all 0s. Have I started mining or is something wrong?


texts: Why do i need overide keyword when implementing an interface

texts:
Look at this interface:
 interface Contract1Interface
 {
     function myfunction(uint) external returns (uint);
 }

I have implemented a smartcontract from this interface:
contract Contract1 is Contract1Interface
{

  function myfunction(uint param1) override public returns (uint)
  {
      ...
  }
}

I need to put override in the Contract1's function declaration. The compiler gives me an error if i don't.
My question is why ? This function should implicitly be override. In other programming language there is no need to override because we are implementing an interface...
Have I made a mistake ?


texts: Transaction Nonce deterring Re-entrancy Attack?

texts: Why doesn't the use of transaction nonce deter re-entrancy attack?


texts: Truffle does not add "networks" to build/contracts/contract.json after migration

texts:
Problem

Truffle does not add "networks" to build/contracts/contract.json files after migration.

Versions running

Truffle v4.0.1 (core: 4.0.1)
Solidity v0.4.18 (solc-js)
EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2)
MacOS High Sierra 10.13.1

What I have tried already

Downgrading Truffle:
I have tried to downgrade from Truffle version 4.0.4 to version 4.0.0 and then to 4.0.1 to test if it has something to do with Truffle version, but unfortunately I get the same problem.

truffle.js file looks like this:

module.exports = {
   networks: {
     development: {
       host: "localhost",
       port: 8545,
       network_id: "*" // Match any network id
     }
   }
};

I also tried to run over port 9545 with $ truffle develop, but got the same problem.

Error message

When I run $ truffle test I get the following error message:

  Error: TestContract has not been deployed to detected network
  (network/artifact mismatch)

What does work

When I run $ truffle migrate --reset, my build/contracts/Migrations.json file does have the networks specified like:

...
"networks": {
    "1516203204392": {
      "events": {},
      "links": {},
      "address": "0xa10a9e84eb3ef0bf7ebc1b6337c20031b5a80e69"
    }
  },
...


texts:
When we install Geth client and point it to homestead or test network, first thing it does is, syncs the whole blockchain.

What I am not quite sure is when we say the blocks are copied to the new node the question which arises to me is where from these blocks are getting copied.

Believe each node is running the EVM on their own machine. There maybe nodes which hold the whole block chain and there will be few which use the light version (i..e i believe is downloaded with partial block chain).

Questions
1. Does the Geth client searches for a peer having the whole block chain and then syncs with it
2. Believe there is central point where the whole block chain data is present. So not sure how the whole process is functioning


texts: Is it possible to delete a completed transaction from your wallet history?

texts: Is it possible to get rid of a completed transaction?


texts: How to send ethers to specific address based on solidity contract but not web3py?

texts:
I have written a solidity code, running it on Remix and I use ganache and web3py library to interact with it.
My code is something like this:
contract simplePayment{

    function sendPayment(address payable _reciver) payable public {
        _reciver.transfer(msg.value);
    }
}

Now, when I use Remix IDE and make a transaction everything is fine. I am able to transfer Ethers to the intended address.
When running this following code (using web3py)
contractInstance.functions.sendPayment(_receiverAddress).transact({'from':_senderAddress,'value': 1000000000000000000}Ethere are getting transferred to _receiverAddress
But when running code
contractInstance.functions.sendPayment(_receiverAddress).transact({'from':_senderAddress,'to':_someOtherAddress,'value': 1000000000000000000} Here the Ethers are getting transferred to _someOtherAddress.
How can I resolve this issue from a security perspective in solidity? I know how to use modifiers but do we have some of this equivalent like msg.sender for the receiver?
Thank you.


texts: Supply amount exceed total supply! Why the quantity supply shown 1.00 E+59

texts:
the quantity amount over the total supply,  shown 1E +59
Airdrop solidity code maybe got something problem, does someone had idea??
Can't check for token Holder,  "Sorry, We Are Unable To Generate The Token Holders Chart For This Token Contract"

Here is contract address: 0x437e46108cc18299ee48074de8db7d99d6703a08


texts: Is Blockchain safe to store personal information?

texts:
I'm making my first steps in blockchain development and I have a questions about storing some sensitive data on a blockchain.

Assuming that two companies developed the protocol of document exchange through Blockchain. They don't want to give access to their information to anybody except themselves.

Ok, I think they can choose between two possibilities:

Content of docs is encoded cryptographically. The result is recorded on Blockchain directly.
Pro: companies must not maintain their own DB's for storing docs.
Contra: maybe it is expensive to store big data on blockchain; (the main) if verification key of a counterparty is stolen then malefactor get access to all documents since nobody can remove data from blockchain.
Counterparties can record on a chain hash result of docs' content only.
Pro: It is more safely.
Contra: In this scenario it is impossible to create completely decentralized db since every must maintain the needed data by oneself to get whole content of docs.

Do best practices exist for storing sensitive information on a blockchain?


texts: How can I recover or reset a lost wallet password?

texts: Let's say that a user has lost or forgotten their password. Is there a way to reset the password or recover it?


texts: According to Etherscan Qtum is a Token, holding supply with verified smart contract. But its official site contains its own protocol and integration mechanism. Is it still a token under ETH or it has been moved out as Coin.


texts: Error encoding arguments: Error: invalid bytes32 value (arg="", coderType="bytes32", value="0x6c", version=4.0.37) >

texts:
pragma solidity ^0.4.20;

contract TestBytes32ToString{
    function bytes32ToString(bytes32 x) public pure returns(uint,uint,uint,string memory){
        bytes memory bytesString = new bytes(32);
        uint charCount = 0;
        for(uint i = 0; i < 32; i++){
            byte char = byte(bytes32(uint(x)*2**(8*i)));
            if(char != 0){
                  bytesString[charCount] = char;
                  charCount++;
            }
        }

        bytes memory bytesStringTrimmed = new bytes(charCount);
        for(i = 0; i < charCount; i++){
            bytesStringTrimmed[i] = bytesString[i];
        }
        return (uint(x),uint(x)*2**(8*0),uint(x)*2**(8*1),string(bytesStringTrimmed));
    }
}

When I execute the above code in the new layout of remix，I input "0x6c",then an error had occurred as follws:

Error encoding arguments: Error: invalid bytes32 value (arg="", coderType="bytes32", value="0x6c", version=4.0.37)

But I did the same operation in the previous version of remix, it works.


texts: Do all ethereum based currencies need to be mined?

texts: I am reading about an ethereum based currency called atonomi. It's doing an ICO. I wanted to ask if all ethereum based currencies need to be mined or they could be pre-mined too?