4

The following code is compiled with solc 0.3 with correct --libraries linking and deployed to morden. Math library is deployed just fine and can be accessed. However A doesn't get deployed on morden with geth 1.3.5.

// on morden at 0xcb264e62f89c121f785dc61daa97c1e3134a6653
library Math {
  function and(bool a, bool b) returns (bool c) {
    return a && b;
  }
}

contract A {
  function testTrue() returns(bool){
    return Math.and(true, true);
  }
}

The transaction is accepted and a contract address generated, but no code is left on the chain:

> web3.eth.getTransactionReceipt('0x65b7915ecfad660a2076fee5ac800c94864bf2b1edf3ecb4432971af994404b7')
{
  blockHash:     "0x8e2ebd5d9fe2588470bc699afb94a3488bd68772115abd7eafc509f1124179c9",
  blockNumber: 663022,
  contractAddress: "0x1d9b45e1519fef452e2fdab6a5aa75d8eee35f99",
  cumulativeGasUsed: 122279,
  gasUsed: 90000,
  logs: [],
  transactionHash:     "0x65b7915ecfad660a2076fee5ac800c94864bf2b1edf3ecb4432971af994404b7",
  transactionIndex: 1
}
> web3.eth.getCode('0x1d9b45e1519fef452e2fdab6a5aa75d8eee35f99')
„0x"

A is deployed with the following bytecode: 606060405260938060106000396000f3606060405260e060020a60003504634e4fb1fa8114601a575b005b608a7f9f6ee0fc0000000000000000000000000000000000000000000000000000000060609081526001606481905260845260009073cb264e62f89c121f785dc61daa97c1e3134a665390639f6ee0fc9060a4906020906044818660325a03f41560025750506040515191505090565b50604051602090f3

EDIT: solved. trivial out of gas error.

Raine Revere
  • 3,600
  • 2
  • 23
  • 34
Denis
  • 911
  • 6
  • 8

1 Answers1

2

gasUsed == gas indicates that all gas, which was send with this transaction was used during the process. This can happen often, if no manual gas value for a transaction was given.

> web3.eth.getTransaction('0xef30f4807c2da51d16d2b3124d9d7a38061a6617c2ed422be220fb8f654de88d')
{
  blockHash: "0xce7aa38e82653fcf3bed3ff2b84f044a803dfef338388dddf81f3ae7fe25871d",
  blockNumber: 664100,
  from: "0x1f2da94743d6d5657a6138fa77d8b4be3c185605",
  gas: 90000,
  gasPrice: 20000000000,
  hash: "0xef30f4807c2da51d16d2b3124d9d7a38061a6617c2ed422be220fb8f654de88d",
  input: "0x60606040525b5b60da8060126000396000f360606040526000357c0100000000000000000000000000000000000000000000000000000000900480634e4fb1fa146037576035565b005b604260048050506058565b6040518082815260200191505060405180910390f35b600073cb264e62f89c121f785dc61daa97c1e3134a6653639f6ee0fc60016001604051837c010000000000000000000000000000000000000000000000000000000002815260040180838152602001828152602001925050506020604051808303818660325a03f41560025750505060405180519060200150905060d7565b9056",
  nonce: 1048675,
  to: null,
  transactionIndex: 0,
  value: 0
}
> web3.eth.getBalance('0x1f2da94743d6d5657a6138fa77d8b4be3c185605')
87627473088049110720
Denis
  • 911
  • 6
  • 8