Hot answers tagged

6

Guys I really hate my life. It took me over 10 hours to find the solution to this problem. I compiled the contract with various different methods. Deployment worked with each of the but the contract couldn't be verified nontheless. After a while I figured out that I didn't set the optimisation checkbox on etherscan to "yes". I was compiling optimized all ...


5

I deployed the contract on the Kovan test net. Deployment versions same as you. Everything worked properly. I see no reason for it not to work on Ropsten. How did you deploy the contract? Maybe share the address to I can try to verify it.


4

You need to choose the right compiler version. On the right sidebar you can see your current compiler version. The compiler version must match the number used in the pragma solidity! Expand the dropdown and choose 0.5.12 nightly. You should probably downgrade to a full commit version like 0.5.11 commit. I hope this helps!


3

Just use this: npm install web3


3

Think of your VM like a completely different machine. It has another IP for example. 127.0.0.1 accesses localhost and therefore your host machine. So how do you fix this? You need to connect to your VM with the correct IP. Go into your VM and run the command ifconfig. A lot of stuff gets returned. You will surely recognice the correct IP when you see it. ...


2

When calling associatedToken.transfer(address(this), _ammount) the caller of this transaction is your contract, so it tries to transfer contract's 82 DAI to itself. To transfer DAI you should be the caller of the transaction with transfer() function call. You should upload DAI's code to Remix and use "At address" button and then call transfer() function at ...


1

It looks like you have two bugs. First: bytes4 sig = bytes4(keccak256("verifyHash(string)")); The actual function takes a bytes32, not a string, so this should be: bytes4 sig = bytes4(keccak256("verifyHash(bytes32)")); Second: 0x20, // Inputs are 32 bytes long The input is actually 36 bytes long. 4 bytes for the function selector, and then a single ...


1

Turning a comment into an answer: From the "web3.utils" part in your code, I conclude that you are using web3.js v1.x. If that is indeed the case, then use web3.utils.soliditySha3 instead of web3.utils.sha3.


1

I can use the following function: function foo(uint n) public { require(yourContract.winningThreshold() == yourContract.registrarCounter() + 1); uint CurrentStake = yourContract.stake(); yourContract.register(n); uint[] memory seeds = yourContract.revealWinningSeeds(); require(seeds[seeds.length - 1] > currentStake); } Every non-...


1

You need to install git in your machine to have it working. ubuntu : sudo apt-get install git Windows : here's the link to download it https://git-scm.com/download/win


1

Currently, it is impossible to return struct in solidity. Though you can use experimental ABIEncoderV2. pragma solidity 0.5.9; pragma experimental ABIEncoderV2; contract company { struct contractDetails { string contractId; string companyA; string companyB; address A; address B; uint256 timestamp; string signHash; bool ...


1

The reason for that is because your solc-js compiler version is lower than 0.5.11 but you want the version of your contract to be higher than 0.5.11 so the compiler give error. A simple way to solve this is change pragma solidity ^0.5.11 to pragma solidity ^0.5.0 or just update your solc-js compiler with npm install solc


1

There are two types of transaction in Ethereum, one is simple balance transfer and the other one is making any modification in the contract(either it could be contract deployment/contract's method invocation). The 'data' field in the raw transaction json structure of Ethereum contains the code to execute a transaction in the EVM. In case of contract ...


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