{"id":25436737,"url":"https://github.com/rkotov93/evm-tx-input-decoder","last_synced_at":"2025-11-01T04:30:23.036Z","repository":{"id":184900600,"uuid":"672651692","full_name":"rkotov93/evm-tx-input-decoder","owner":"rkotov93","description":"Simple gem to decode and encode EVM transactions input data  ","archived":false,"fork":false,"pushed_at":"2023-08-03T22:28:27.000Z","size":60,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T14:58:11.029Z","etag":null,"topics":["blockchain","eth","ethereum","ethereum-virtual-machine","evm","evm-blockchain","ruby","ruby-on-rails","tron","trx"],"latest_commit_sha":null,"homepage":"https://rubydoc.info/github/rkotov93/evm-tx-input-decoder/main","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rkotov93.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-07-30T19:56:31.000Z","updated_at":"2025-01-22T19:25:07.000Z","dependencies_parsed_at":"2023-12-15T20:30:22.400Z","dependency_job_id":null,"html_url":"https://github.com/rkotov93/evm-tx-input-decoder","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"43605177e42a5c9f77786db963eaab3e9bc1253d"},"previous_names":["rkotov93/evm-tx-inputs-decoder","rkotov93/evm-tx-input-decoder"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkotov93%2Fevm-tx-input-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkotov93%2Fevm-tx-input-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkotov93%2Fevm-tx-input-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rkotov93%2Fevm-tx-input-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rkotov93","download_url":"https://codeload.github.com/rkotov93/evm-tx-input-decoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239255599,"owners_count":19608306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","eth","ethereum","ethereum-virtual-machine","evm","evm-blockchain","ruby","ruby-on-rails","tron","trx"],"created_at":"2025-02-17T08:22:12.471Z","updated_at":"2025-11-01T04:30:22.969Z","avatar_url":"https://github.com/rkotov93.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EVM Transactions Input Decoder\n\nThis is a simple gem that helps decoding and encoding transactions input data for EVM based blockchains like Ethereum and Tron.\n\n## Installation\nRun\n```bash\ngem install evm-tx-input-decoder\n```\nor add\n```ruby\ngem 'evm-tx-input-decoder', require: 'evm_tx_input'\n```\nto your Gemfile.\n\n## Usage\n\n### Decoding\nLet's consider decoding process by example [USDT transaction](https://etherscan.io/tx/0x93ae1b191189aa27833b65f3668ae7704f9b7d9badabf4a9a16e53d84e1a3472) in an Ethereum blockchain.\n\nThe input data is `0xa9059cbb00000000000000000000000003cb76e200ba785f6008c12933aa3640536d2011000000000000000000000000000000000000000000000000000000a083712e00`, which can be found in `More details` section.\n\nThe USDT token ABI can be found by [this url](http://api.etherscan.io/api?module=contract\u0026action=getabi\u0026address=0xdac17f958d2ee523a2206206994597c13d831ec7\u0026format=raw)\n\n```ruby\nrequire 'open-uri'\nrequire 'evm_tx_input'\n\njson = URI.open('http://api.etherscan.io/api?module=contract\u0026action=getabi\u0026address=0xdac17f958d2ee523a2206206994597c13d831ec7\u0026format=raw') { |file| file.read }\nabi = JSON.parse(json)\ninput = '0xa9059cbb00000000000000000000000003cb76e200ba785f6008c12933aa3640536d2011000000000000000000000000000000000000000000000000000000a083712e00'\n\nfunction = EvmTxInput::Decoder.new(abi).decode_input(input)\nfunction.id #=\u003e \"a9059cbb\"\nfunction.name #=\u003e \"transfer\"\nfunction.arguments\n# [#\u003cEvmTxInput::Argument:0x00000001107ffa60 @name=\"_to\", @type=\"address\", @value=\"0x03cb76e200ba785f6008c12933aa3640536d2011\"\u003e,\n#  #\u003cEvmTxInput::Argument:0x00000001107ffa10 @name=\"_value\", @type=\"uint256\", @value=689400000000\u003e]\n```\n\n### Encoding\nFollowing decoding procedure let's encode the previous result.\n\n```ruby\nrequire 'evm_tx_input'\n\nfunction_name = 'transfer'\ntypes = %w[address uint256]\nargs = ['0x03cb76e200ba785f6008c12933aa3640536d2011', 689400000000]\nEvmTxInput::Encoder.encode_input(function_name, types, args)\n#=\u003e \"0xa9059cbb00000000000000000000000003cb76e200ba785f6008c12933aa3640536d2011000000000000000000000000000000000000000000000000000000a083712e00\"\n```\n\nFor more details read the [documentation](https://rubydoc.info/github/rkotov93/evm-tx-input-decoder/main).\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rkotov93/evm-tx-input-decoder.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkotov93%2Fevm-tx-input-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frkotov93%2Fevm-tx-input-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frkotov93%2Fevm-tx-input-decoder/lists"}