2

It's difficult to tell from the information posted, but abi may not be an array. A quick way to tell is to evaluate Array.isArray(abi). It should return true for an array. A long shot, but assuming you have the ABI in string format (somehow), you could try replacing: const myContract2 = new web3.eth.Contract(abi,contractAddress) with const ...


2

On web3.js v1.x, you should fix the following: Change web3.eth.Contract to new web3.eth.Contract Change omisegoContract.balanceOf to await omisegoContract.methods.balanceOf Of course, the 2nd bullet implies that this line should be executed from an async function.


2

I assume that you need to pass the value of the variable as an attribute of the function: Remember that sstore saves the variable value in slots. I created two functions to see how it works. pragma solidity ^0.5.8; contract MetaCoin { function createVariable(uint _x) public { assembly { let v := _x sstore(0, v) ...


2

The only direct options you have are msg.sender and tx.origin (which shouldn't be used basically ever). There is no way to get addresses which are "between" these addresses. Otherwise, as smarx stated, you should pass the desired owner address as a parameter and use that.


1

Your function blah is not doing anything (it's useless basically), that's what the error is. What you can do is, you can return something from that blah function like this: pragma solidity ^0.5.1; contract contractA { function blah(int x, int y) public payable returns (int) { return x+y; } } Good luck!


1

The "error" you're seeing is not an error. It's a warning. As the warning says, the cause is unused parameters. You can ignore the warning if you want, or you can address it by removing the unused parameters or just their names: // Either this: function blah() public payable {} // Or this: function blah(int, int) public payable {}


1

You could do something like this: contract MetaCoint { uint public index; mapping(uint => uint) public counters; function addCounter() external { index++; } function incCounter(uint _index) external { require(_index < index, "counter was not created"); counters[_index]++; } }


1

@goodvibration is right. From the comment, this appears to be more a signature verification problem. It would be much lighter to use ecrecover: You want to verify the encryption result is generated by a particular public key. One solution, as you have suggested, is to let every node re-execute the encryption and compare. (note the gas cost is unlikely to be ...


1

These three lines are correct var web3 = new Web3("https://mainnet.infura.io"); var contract = web3.Eth.GetContract(abi, contractAddress); var function = contract.GetFunction("getCollectibleDetails"); I understand what you were trying to do here but there is a better way to get this /** var parameters = new object[] { new { Data = 157517, ...


1

I believe this was a bug before which is fixed now. Current version i'm using is: $ truffle version Truffle v5.0.20 (core: 5.0.20) Solidity v0.5.0 (solc-js) Node v10.15.3 Web3.js v1.0.0-beta.37 Simple smart contract to reproduce the issue pragma solidity ^0.5.6; contract TruffleDebug { function Deposit (uint256 timeout, bytes32 hash, address ...


Only top voted, non community-wiki answers of a minimum length are eligible