1

Recently just pushed my first smart contract from truffle to the ropsten testnet.

As you can see from my terminal output below it compiles and was migrated with no problem:

enter image description here

Was broadcast to the network by my running geth node:

enter image description here

The contract can be found on my GitHub here, it looks like this:

pragma solidity ^0.4.13;

// This contract demonstrates a simple non-constant (transactional) function you can call from geth.
// increment() takes no parameters and merely increments the "iteration" value. 

contract Incrementer {
    uint iteration;

    function Incrementer() {
        iteration = 0;
    }

    function increment(uint count) {
        iteration += count;
    }

    function getIteration() constant returns (uint) {
        return iteration;
    }

}

This is the representation of the transaction on ropsten.etherscan.io:

enter image description here

You can see that the ByteCode on the Blockchain (what we are looking for) and the Your Compiled Bytecode (what you provided) are the same in the beginning- I don't know if that means anything or not- but anyhow:

enter image description here

I know that in the past there were some problems with trying to verify contracts compiled with truffle with respect to the Runs (Optimizer), but so far as I could tell this has been fixed, anyway for good measure I've tried to verify with this value set to 0 and also to 200, neither have worked...

Here's what I've been entering:

Is it correct what I've been doing?

enter image description here

Why is this contract not verifying?

  • 1
    Did you select the same compiler version for compilation and verification. Truffle usually uses the latest stable version of the compiler while on the screenshot I looks like you took the latest commit for verification. So probably this results in different bytecode and verification fails. Anyways I would just use the contract and treat it as verified if it works as expected. – larsl Jul 30 '17 at 22:11
  • That might be it, I was selecting the compiler I declared in my code – smatthewenglish Jul 30 '17 at 23:22
  • man I don't think that's it, I've just tried every compiler 0.4.13 and above, none of them worked – smatthewenglish Jul 31 '17 at 1:52
2

You were trying to verify the "Migrations" contract that you used in your truffle configuration.

You incrementer contract was the next contract you created, and can be found here: https://ropsten.etherscan.io/address/0x8705c513da621a16fd1defc9de8ae7cdead01fb8#code

I verified it for you, using the Optimizer but setting it to 0 optimizations. You were using 0.4.13, as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.