{"id":13621290,"url":"https://github.com/rust-ethereum/ethabi","last_synced_at":"2025-04-12T01:55:33.828Z","repository":{"id":37862478,"uuid":"57925247","full_name":"rust-ethereum/ethabi","owner":"rust-ethereum","description":"Encode and decode smart contract invocations","archived":false,"fork":false,"pushed_at":"2023-08-16T17:41:09.000Z","size":1411,"stargazers_count":519,"open_issues_count":47,"forks_count":197,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-12T01:55:27.543Z","etag":null,"topics":["abi","ethereum","evm","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-ethereum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-02T22:27:15.000Z","updated_at":"2025-03-10T15:48:36.000Z","dependencies_parsed_at":"2024-06-17T05:29:16.060Z","dependency_job_id":"5f2455ca-37d8-4969-a21f-c2f4f3a78e02","html_url":"https://github.com/rust-ethereum/ethabi","commit_stats":null,"previous_names":["openethereum/ethabi"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-ethereum%2Fethabi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-ethereum%2Fethabi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-ethereum%2Fethabi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-ethereum%2Fethabi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-ethereum","download_url":"https://codeload.github.com/rust-ethereum/ethabi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505867,"owners_count":21115354,"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":["abi","ethereum","evm","rust"],"created_at":"2024-08-01T21:01:04.342Z","updated_at":"2025-04-12T01:55:33.802Z","avatar_url":"https://github.com/rust-ethereum.png","language":"Rust","readme":"This project is not actively maintained. Consider these alternatives:\n- https://github.com/nlordell/solabi-rs\n- https://github.com/alloy-rs/core\n\n# ethabi\n\nThe ABI, Application Binary Interface, is basically how you call functions in a contract and get data back.\n\n\u003e An ABI determines such details as how functions are called and in which binary format information should be passed from one program component to the next...\n\nAn Ethereum smart contract is bytecode, EVM, on the Ethereum blockchain. Among the EVM, there could be several functions in a contract. An ABI is necessary so that you can specify which function in the contract to invoke, as well as get a guarantee that the function will return data in the format you are expecting. [read more](http://ethereum.stackexchange.com/a/1171/394)\n\nThis library encodes function calls and decodes their output.\n\n[Documentation](https://docs.rs/ethabi)\n\n### Disclaimer\n\nThis library intends to support only valid ABIs generated by recent Solidity versions. Specifically, we don't intend to support ABIs that are invalid due to known Solidity bugs or by external libraries that don't strictly follow the specification.\nPlease make sure to pre-process your ABI in case it's not supported before using it with `ethabi`.\n\n### Installation\n\n  ```\n  cargo install ethabi-cli\n  ```\n\n### Usage\n\n```\nEthereum ABI coder.\n  Copyright 2016-2017 Parity Technologies (UK) Limited\n\nUsage:\n    ethabi encode function \u003cabi-path\u003e \u003cfunction-name-or-signature\u003e [-p \u003cparam\u003e]... [-l | --lenient]\n    ethabi encode params [-v \u003ctype\u003e \u003cparam\u003e]... [-l | --lenient]\n    ethabi decode function \u003cabi-path\u003e \u003cfunction-name-or-signature\u003e \u003cdata\u003e\n    ethabi decode params [-t \u003ctype\u003e]... \u003cdata\u003e\n    ethabi decode log \u003cabi-path\u003e \u003cevent-name-or-signature\u003e [-l \u003ctopic\u003e]... \u003cdata\u003e\n    ethabi -h | --help\n\nOptions:\n    -h, --help         Display this message and exit.\n    -l, --lenient      Allow short representation of input params.\n\nCommands:\n    encode             Encode ABI call.\n    decode             Decode ABI call result.\n    function           Load function from json ABI file.\n    params             Specify types of input params inline.\n    log                Decode event log.\n```\n\n### Examples\n\n```\nethabi encode params -v bool 1\n```\n\n\u003e 0000000000000000000000000000000000000000000000000000000000000001\n\n--\n\n```\nethabi encode params -v bool 1 -v string gavofyork -v bool 0\n```\n\n\u003e 00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000096761766f66796f726b0000000000000000000000000000000000000000000000\n\n--\n\n```\nethabi encode params -v bool[] [1,0,false]\n```\n\n\u003e 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n\n--\n\n```\nethabi encode params -v '(string,bool,string)' '(test,1,cyborg)'\n```\n\n\u003e 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004746573740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066379626f72670000000000000000000000000000000000000000000000000000\n\n--\n\n```\nethabi encode function examples/test.json foo -p 1\n```\n\n```json\n[{\n\t\"type\":\"function\",\n\t\"inputs\": [{\n\t\t\"name\":\"a\",\n\t\t\"type\":\"bool\"\n\t}],\n\t\"name\":\"foo\",\n\t\"outputs\": []\n}]\n```\n\n\u003e 455575780000000000000000000000000000000000000000000000000000000000000001\n\n--\n\n```\nethabi encode function examples/test.json foo(bool) -p 1\n```\n\n```json\n[{\n\t\"type\":\"function\",\n\t\"inputs\": [{\n\t\t\"name\":\"a\",\n\t\t\"type\":\"bool\"\n\t}],\n\t\"name\":\"foo\",\n\t\"outputs\": []\n}]\n```\n\n\u003e 455575780000000000000000000000000000000000000000000000000000000000000001\n\n--\n\n```\nethabi encode function examples/test.json bar(bool) -p 1\n```\n\n```json\n[{\n\t\"type\":\"function\",\n\t\"inputs\": [{\n\t\t\"name\":\"a\",\n\t\t\"type\":\"bool\"\n\t}],\n\t\"name\":\"foo\",\n\t\"outputs\": []\n}]\n```\n\n\u003e 6fae94120000000000000000000000000000000000000000000000000000000000000001\n\n--\n\n```\nethabi encode function examples/test.json bar(string):(uint256) -p 1\n```\n\n```json\n[{\n\t\"type\":\"function\",\n\t\"inputs\": [{\n\t\t\"type\":\"string\"\n\t}],\n\t\"name\":\"foo\",\n\t\"outputs\": [{\n\t\t\"type\": \"uint256\"\n\t}]\n}]\n```\n\n\u003e d473a8ed000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000\n\n--\n\n```\nethabi decode params -t bool 0000000000000000000000000000000000000000000000000000000000000001\n```\n\n\u003e bool true\n\n--\n\n```\nethabi decode params -t bool -t string -t bool 00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000096761766f66796f726b0000000000000000000000000000000000000000000000\n```\n\n\u003e bool true\u003cbr/\u003e\n\u003e string gavofyork\u003cbr/\u003e\n\u003e bool false\n\n--\n\n```\nethabi decode params -t bool[] 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n```\n\n\u003e bool[] [true,false,false]\n\n--\n\n```\nethabi decode params -t '(string,bool,string)' 00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000673706972616c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000067175617361720000000000000000000000000000000000000000000000000000```\n```\n\n\u003e (string,bool,string) (spiral,true,quasar)\n\n--\n\n```\nethabi decode function ./examples/foo.json bar 0000000000000000000000000000000000000000000000000000000000000001\n```\n\n```json\n[{\n\t\"constant\":false,\n\t\"inputs\":[{\n\t\t\"name\":\"hello\",\n\t\t\"type\":\"address\"\n\t}],\n\t\"name\":\"bar\",\n\t\"outputs\":[{\n\t\t\"name\":\"\",\n\t\t\"type\":\"bool\"\n\t}],\n\t\"type\":\"function\"\n}]\n```\n\n\u003e bool true\n\n--\n\n```\nethabi decode log ./examples/event.json Event -l 0000000000000000000000000000000000000000000000000000000000000001 0000000000000000000000004444444444444444444444444444444444444444\n```\n\n\u003e a bool true\u003cbr/\u003e\n\u003e b address 4444444444444444444444444444444444444444\n","funding_links":[],"categories":["Languages","Applications","dApps directory","Smart Contracts","Tools","应用程序 Applications"],"sub_categories":["Blockchain","ABI Tools","Cryptocurrencies","Other","加密货币 Cryptocurrencies"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-ethereum%2Fethabi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-ethereum%2Fethabi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-ethereum%2Fethabi/lists"}