Skip to content

Instantly share code, notes, and snippets.

@arhuaco
Created May 21, 2015 17:48
Show Gist options
  • Save arhuaco/a36854ff9aa0901c6267 to your computer and use it in GitHub Desktop.
Save arhuaco/a36854ff9aa0901c6267 to your computer and use it in GitHub Desktop.
Issue calling contract
> var contract_address = '0x5a219cab7d5a5888ae86e80de2775dc022de6e0c';
undefined
> abiDef = [{ type: 'function', constant: true, inputs: [ ], name: 'step', outputs: [{name: 'retVal', type: 'uint256' } ] }]
[{
type: 'function',
constant: true,
inputs: [ ],
name: 'step',
outputs: [{
name: 'retVal',
type: 'uint256'
} ]
} ]
> counter_contract = eth.contract(abiDef);
{
abi: [{
type: 'function',
constant: true,
inputs: [ ],
name: 'step',
outputs: [{
name: 'retVal',
type: 'uint256'
} ]
} ],
new: [Function],
at: [Function]
}
> counter = new counter_contract(contract_address)
TypeError: 'counter_contract' is not a function
at <anonymous>:1:15
@arhuaco
Copy link
Author

arhuaco commented May 21, 2015

counter = counter_contract.at(contract_address)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment