0

Used the following code, put it in to deploy new contract.

When I try to verify the code on etherscan it says it doesn't match the code of the contract?

Here's the Etherscan Link:

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

And here's the code I inserted in the deploy contract part of the Ethereum wallet.

pragma solidity ^0.4.16;

contract MyKidsEducationFund {
  string public constant symbol = "MKEF";
  string public constant name = "MyKidsEducationFund";
  uint8 public constant decimals = 18;

  address owner = 0x3755530e18033E3EDe5E6b771F1F583bf86EfD10;

  mapping (address => uint256) public balances;

  event Transfer(address indexed _from, address indexed _to, uint256 _value);

  function MyKidsEducationFund() public {
    balances[msg.sender] = 1000;
  }

  function transfer(address _to, uint256 _value) public returns (bool success) {
    require(balances[msg.sender] >= _value);
    require(_value > 0);
    require(balances[_to] + _value >= balances[_to]);
    balances[msg.sender] -= _value;
    balances[_to] += _value;
    Transfer(msg.sender, _to, _value);
    return true;
  }

  function () payable public {
    require(msg.value >= 0);
    uint tokens = msg.value / 10 finney;
    balances[msg.sender] += tokens;
    owner.transfer(msg.value);
  }
}
0

It's important to match the compiler version and select optimization on/off exactly as everything was when the contract was compiled and the bytecode was generated.

Your use of ^ in the pragma makes it a bit ambiguous because it might have been compiled with any later version of the compiler.

With a little guesswork, I got it to verify with

  • Compiler Version: v0.4.16+commit.d7661dd9
  • Optimization Enabled: 1

It's done. No warranty ;-)

Hope it helps.

  • Thank you so much!! Any ideas how to fix this? Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity) Solidity compiler bugs. – SamWolf Nov 25 '17 at 23:19
  • Thanks for the accept. The short answer is there is nothing possible to do to an already deployed contract. It is what it is. In this case, the description states that under rare circumstances a carefully named function might execute in place of the fallback function. The warning might help contract users determine if your contract is trying to exploit a compiler issue in an underhanded way. – Rob Hitchens - B9lab Nov 26 '17 at 7:53

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.