Ethereum::Contract - Support for interacting with Ethereum contracts using the geth RPC interface
Constructor: Here we get all functions from the passed ABI and bring it to contract class subs.
Parameters: contract_address ( Optional - only if the contract already exists ), contract_abi ( Required - https://solidity.readthedocs.io/en/develop/abi-spec.html ), rpc_client ( Optional - Ethereum::RPC::Client(https://github.com/binary-com/perl-Ethereum-RPC-Client) - if not given, new instance will be created ); from ( Optional - Address ) gas ( Optional - Integer gas ) gas_price ( Optional - Integer gasPrice )
Return: New contract instance
Invokes all calls from ABI to the contract.
Parameters: name (Required - the string function name ) params (Optional - the parameters)
Return: Ethereum::Contract::ContractTransaction
Get the function and parameters and merge to create the hashed ethereum function ID
Ex: function approve with the inputs address _spender and uint value must be represented as: SHA3("approve(address,uint)")
Parameters: function_string (Required - the string function name ) inputs (Required - the input list given on the contract ABI)
Return: New function ID hash
Join the data and parameters and return a prepared transaction to be called as send, call or deploy.
Parameters: $compiled_data ( Required - the hashed function string name with parameters or the compiled contract bytecode ) params ( Required - the parameters args given by the method call )
Return: Future object on_done: Ethereum::Contract::ContractTransaction on_fail: string message
Convert the given value to hexadecimal format
Parameters: function_id (Required - arg to be converted to hexadecimal)
Return: Hexadecimal string
Create a filter based on the given block to listen all events sent by the contract.
The filter is killed before the list return, so for each request a new filter will be created.
Parameters: from_block ( Optional - start search block ) function ( Required - function name )
Return: https://github.com/ethereum/wiki/wiki/JSON-RPC#returns-42
Prepare a deploy transaction,
Parameters: compiled ( Required - contract bytecode) params ( Required - contract constructor params
Ensure that the given hexadecimal string starts with 0x.
To install Ethereum::RPC::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ethereum::RPC::Client
CPAN shell
perl -MCPAN -e shell install Ethereum::RPC::Client
For more information on module installation, please visit the detailed CPAN module installation guide.