gas required exceedes allowance or always failing transaction

So, I got a problem when interacting with a smart contract in geth. I have this very simple contract: pragma solidity^0.6.1; contract Simple{ uint256 public number = 1; constructor() public { } function setNumber(uint256 another) public { number = another; } function getNumber() public view returns (uint256){ return number; } function add(uint256 x, uint256 y)…

Access to smart contract’s value in Browser

My Truffle project is this contract that just shows Yerevan is love: pragma solidity ^0.5.12; contract TEST{ string public note=”Yerevan is love”; function rep() public view returns(string memory){ return note; } } And by the following code i can see Yerevan is love in Node-js: var Web3=require(‘web3’); var web3=new Web3(‘ws://localhost:8545′); var test_json=’C:/Users/lenovo/node_modules/Yerevan/build/contracts/TEST.json’; var test_js=JSON.parse(fs.readFileSync(test_json)); var…

How to get Ethereum transaction list by address in java web3j quickly?

Im trying to fetch transaction logs from ganache using web3j library to send it as an api ,is there any way where i can get all transactions from ganache quickly? @GetMapping(“/test”) public List<Transaction> test() throws InterruptedException, ExecutionException { List<Transaction> transaction=new ArrayList<Transaction>(); Web3j web3j=web3jConfig.initializeWeb3j(); System.out.println(“test Running…….”); EthFilter filter = new EthFilter( DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, “0xeedc155ae507fb0a9becae6315286183a23229b0”); web3j.ethLogFlowable(filter).subscribe(event ->…

Explicit type conversion not allowed from “bytes32” to “address”

I am using solidity 0.5.0 when i compile code i am throwing exception as Explicit type conversion not allowed from “bytes32” to “address”. code is working fine in remix IDE and my code is as function orderItem(uint _itemid,string memory _itemname ) public returns(address){ address uniqueId = address(sha256(msg.sender,’block.timestamp’)); packagemapping[uniqueId].isuidgenerated = true; packagemapping[uniqueId].itemid = _itemid; packagemapping[uniqueId].itemname =…