Releases: q9f/eth.rb
lib eth.rb v0.5.3 beta
lib eth.rb v0.5.3 is a feature release adding support for smart contracts in ruby.
contract = Eth::Contract.create(file: 'spec/fixtures/contracts/dummy.sol')
# => #<Eth::Contract::Dummy:0x00007fbeee936598>
cli = Eth::Client.create "/tmp/geth.ipc"
# => #<Eth::Client::Ipc:0x00007fbeee946128 @gas_limit=21000, @id=0, @max_fee_per_gas=0.2e11, @max_priority_fee_per_gas=0, @path="/tmp/geth.ipc">
address = cli.deploy_and_wait(contract)
# => "0x2f2faa160420cee087ded96bad52475147136bd8"
cli.transact_and_wait(contract, "set", 1234)
# => "0x49ca4c0a5729da19a1d2574de9a444a9cd3219bdad81745b54f9cf3bb83b6a06"
cli.call(contract, "get")
# => 1234
what's changed
- eth/abi: decode event log by @josh in #69
- gem: bump version by @q9f in #70
- eth/abi/event: batch log decoder by @josh in #71
- smart contract support by @kurotaky in #68
new contributors
full changelog: v0.5.2...v0.5.3
lib eth.rb v0.5.2 beta
lib eth.rb v0.5.2 is a feature release adding support for solidity compiler bindings.
solc = Eth::Solidity.new
# => #<Eth::Solidity:0x000055f05040c6d0 @compiler="/usr/bin/solc">
contract = solc.compile "spec/fixtures/contracts/greeter.sol"
# => {"Greeter"=>
# {"abi"=>
# [{"inputs"=>[{"internalType"=>"string", "name"=>"message", "type"=>"string"}], "stateMutability"=>"nonpayable", "type"=>"constructor"},
# {"inputs"=>[], "name"=>"greet", "outputs"=>[{"internalType"=>"string", "name"=>"", "type"=>"string"}], "stateMutability"=>"view", "type"=>"function"},
# {"inputs"=>[], "name"=>"kill", "outputs"=>[], "stateMutability"=>"nonpayable", "type"=>"function"}],
# "bin"=>
# "6080604052348015...6c634300080c0033"},
# "Mortal"=>
# {"abi"=>[{"inputs"=>[], "stateMutability"=>"nonpayable", "type"=>"constructor"}, {"inputs"=>[], "name"=>"kill", "outputs"=>[], "stateMutability"=>"nonpayable", "type"=>"function"}],
# "bin"=>
# "6080604052348015...6c634300080c0033"}}
now, contract["Greeter"]["bin"]
could be directly used to deploy the contract as Eth::Tx
payload.
what's Changed
- eth: remove duplicated code by @q9f in #62
- ci: allow coverage to drop to 99% without failing by @q9f in #63
- docs: update readme by @q9f in #64
- docs: add wiki to readme by @q9f in #65
- eth/solidity: add solidity compiler bindings by @q9f and @kurotaky in #66
new contributors
full changelog: v0.5.1...v0.5.2
lib eth.rb v0.5.1 beta
lib eth.rb v0.5.1 is a feature release adding support for http/ipc rpc-clients (Eth::Client::*
) and rlp encoding/decoding (Eth::Rlp::*
), as well as improvements to performance, stability, and various bug fixes.
Eth::Rlp.decode "c7c0c1c0c3c0c1c0"
# => [[], [[]], [[], [[]]]]
connect to infura:
infura = Eth::Client.create "https://mainnet.infura.io/v3/#{access_token}"
# => #<Eth::Client::Http:0x000055d43f3ca460 @gas_limit=21000, @host="mainnet.infura.io", @id=0, @max_fee_per_gas=0.2e11, @max_priority_fee_per_gas=0, @port=443, @ssl=true, @uri=#<URI::HTTPS https://mainnet.infura.io/v3/31b...d93>>
deposit_contract = Eth::Address.new "0x00000000219ab540356cBB839Cbe05303d7705Fa"
# => #<Eth::Address:0x000055d43f381738 @address="0x00000000219ab540356cBB839Cbe05303d7705Fa">
infura.get_balance deposit_contract
# => 9087314000069000000000069
what's changed
- spec: add upstream test fixtures for keystore by @q9f in #50
- docs: update changelog by @q9f in #53
- eth/client: implement http/ipc by @q9f in #37
- gem: relax openssl requirement by @q9f in #56
- eth/client: fix legacy transfer by @q9f in #57
- eth/tx: properly serialize signatures by @q9f in #58
- add eth::rlp module by @q9f in #52
- eth/rlp: cleanup by @q9f in #59
- eth/chain: add sepolia chain id; docs by @q9f in #60
- docs: update changelog by @q9f in #61
Full Changelog: v0.5.0...v0.5.1
lib eth.rb v0.5.0 beta
lib eth.rb v0.5.0 is a full-blown, modern, breaking, major rewrite of the ruby-eth gem. it is 100% spec-covered and 100% api-documented.
- coverage: https://app.codecov.io/gh/q9f/eth.rb
- api docs: https://q9f.github.io/eth.rb/
you broke my gem!
don't worry, I'm still maintaining the legacy gem v0.4.x releases. Just put 'eth', '< 0.5'
in your gemspec.
- v0.4.x releases: https://github.com/se3000/ruby-eth/releases
feature overview
- Secp256k1 Key-Pairs and Encrypted Ethereum Key-Stores (JSON)
- EIP-55 Checksummed Ethereum Addresses
- EIP-155 Replay protection with Chain IDs (with presets)
- EIP-191 Ethereum Signed Messages (with prefix and type)
- EIP-712 Ethereum Signed Type Data
- EIP-1559 Ethereum Type-2 Transactions (with priority fee and max gas fee)
- EIP-2028 Call-data intrinsic gas cost estimates (plus access lists)
- EIP-2718 Ethereum Transaction Envelopes (and types)
- EIP-2930 Ethereum Type-1 Transactions (with access lists)
- ABI-Encoder and Decoder (including type parser)
notes on upgrading to 0.5.0
Eth::Key
no longer requires monkey-patched OpenSSL/FFI and uses native Secp256k1 insteadEth::Key.new priv: "30137644b564785d01420f8043f043d74dcca64008e57c59f8ce713a0005a54b"
Eth::Address
is returned as object in most places instead of a string, use.to_s
to get a checksummed address stringEth::Key.new(priv: "30137644b564785d01420f8043f043d74dcca64008e57c59f8ce713a0005a54b").address.to_s
- signature recovery was moved from the
Eth::Key
class to aEth::Signature
moduleEth::Signature.verify "Hello World!", signature, address
- EIP-155 replay protection is implemented everywhere, see
Eth::Chain
modulechain_id = Eth::Chain::OPTIMISM
Eth::Tx.new params
andEth::Tx.parse hex
always try to detect the transaction type (EIP-1559, EIP-2930, legacy)
what's changed
- reset gem to point blank by @q9f in #1
- ci: add nightly schedule by @q9f in #2
- lib: implement Eth::Key class by @q9f in #4
- docs: add AUTHORS file by @q9f in #6
- ci: enable codecov by @q9f in #7
- docs: add code climate badge by @q9f in #8
- gems: bump keccak and secp256k1 by @q9f in #10
- spec: improve key tests by @q9f in #11
- spec: improve util tests by @q9f in #12
- Address class implementation and tests by @chainoperator in #13
- ci: add docs workflow by @q9f in #18
- eth/util: public_key_to_address should return an eth::address by @q9f in #19
- eth/chains: implement eip 155 for replay protection by @q9f in #20
- lib/signature: implement personal_recover (eip 191) by @q9f in #21
- ci: only run coverage on CI by @q9f in #23
- key/signature: personal sign and verify by @q9f in #24
- docs: add some examples to readme by @q9f in #25
- rename util and chain to singular by @q9f in #26
- lib: import ABI to eth/abi by @q9f in #29
- signature: implement eip 712 typed structured data signing by @q9f in #27
- gem: clean up some docs and scripts by @q9f in #32
- eth/tx: create legacy, type-1, and type-2 transactions by @q9f in #33
- Implement encrypt/decrypt by @chainoperator in #22
- docs: update readme for tx and keys by @q9f in #40
- lib: improve error handling by @q9f in #39
- docs: improve readme by @q9f in #41
- eth/abi: refactor for maintainability by @q9f in #42
- eth/sig: allow v values > 0xff, fix #30 by @q9f in #43
- gem: prepare for release by @q9f in #46
- eth/key: allow chain_id empty for signing messages/data by @q9f in #47
- eth/tx: add method to estimate intrinsic gas costs by @q9f in #48
- docs: update readme with features by @q9f in #49
new contributors
- @q9f made their first contribution in #1
- @chainoperator made their first contribution in #13
full changelog: v0.4.16...v0.5.0