Skip to content

Instantly share code, notes, and snippets.

@marek22k
Created December 12, 2021 18:59
Show Gist options
  • Save marek22k/1e397a34fcd1487d71889cdac8fa2812 to your computer and use it in GitHub Desktop.
Save marek22k/1e397a34fcd1487d71889cdac8fa2812 to your computer and use it in GitHub Desktop.
Same functionality as helpeth addressDetails
require "icap"
require "eth"
addr = ARGV[0]
if ! (addr == addr.downcase) && (! Eth::Utils.valid_address? addr)
puts "The supplied address failed the checksum test. It might be invalid."
end
puts "Address: #{addr.downcase}"
puts "Address (checksum): #{Eth::Utils.format_address addr}"
puts "ICAP: #{ICAP::calculate_icap ICAP::calculate_bban addr}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment