1

Error message after deploying the below contractI am not able to deploy the contract when event traces are added. Please help me figure out what is going wrong here. When I remove trial event() , I can deploy the contract.

pragma solidity 0.4.8;

contract X {

    address owner;
    uint amount;

    event test(address value);
    event trial(uint val);


    function X() {
        owner = msg.sender;
        test(msg.sender);
    }

    function invoke() payable {
        test(msg.sender);

        trial(amount);
        amount = amount + msg.value;

        trial(amount);
    }
}
1

More of a comment than an answer, but I wanted to add a picture. The above code works as expected in Remix, so this is possibly an unrelated issue with the way you're deploying it or transacting with it.

Remember the ABI includes information about the event interface, so if you change the contract, compile it (of course) and get the new ABI.

enter image description here

[{"constant":false,"inputs":[],"name":"invoke","outputs":[],"payable":true,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"address"}],"name":"test","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"val","type":"uint256"}],"name":"trial","type":"event"}]

Hope it helps.

  • Actually, in Mist Wallet I get an error message indicating "No data is deployed in contract address". I will add screenshots to my original post – sun Feb 22 '17 at 4:43
  • 1
    Prashant's comment above about gas is the main suspect now, I think. – Rob Hitchens - B9lab Feb 22 '17 at 15:22
0

I tried replicating your issue at my end, but it works seamlessly.

Estimated fee consumption: 0.00244894 ether (122,447 gas) 
Provide maximum fee: 0.00444894 ether (222,447 gas)
Gas price: 0.02 ether per million gas

Please verify that you are providing sufficient gas to the contract and check if you need to update your wallet. Refer : this and this for details.

0

geth upate fixed the issue

C:\Users\deeph>geth version Geth Version: 1.5.9-stable

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.