Comments (4)
from ethereumjs-abi.
I like the simplicity of raw(De|En)code. I think exposing both would be a good idea. For encode
wouldn't parsing the JSON abi be easier to do than a string?
from ethereumjs-abi.
The ABI JSON makes it easy to support overloading for encoding, e.g. if the ABI defines someMethod
with both bytes
and uint
as an input, encode()
could decide which one to encode based on the type of arguments passed in Javascript. However this is not the case in decode()
where the type needs to be given explicitly. This limits the usefulness of the JSON to encoding only.
Based on this, I think the JSON part would only make sense the way it is done in web3 - to instantiate objects which proxy encoding/decoding to the destination via RPC.
I like this shorthand though for both encoding and decoding: encode('someMethod(bytes,uint)', <bytes data>, 1234)
. Perhaps for decode()
it should support the expected return type as: decode('someMethod(bytes,uint):(boolean)')
rawEncode()
and rawDecode()
shall remain unchanged.
from ethereumjs-abi.
This probably needs further discussion if wished to be pursued.
from ethereumjs-abi.
Related Issues (20)
- Formatting dynamic bytes differs from web3.js HOT 2
- rawEncode silently accepts invalid hex strings HOT 1
- String decoding breaks HOT 3
- Decoded int exceeds width: 160 vs 256 HOT 1
- Error can not install HOT 54
- TypeError: abi.encode is not a function HOT 1
- abi.solidityPack does not work with array HOT 1
- Cutting a new release that includes a `for in` fix HOT 1
- Addresses encoded in 32 bytes instead of 20 bytes
- Decode nested arguments (array of structs)
- "ethereumjs-abi" not found HOT 2
- Out-of-date handling of `bytes` and `string` arrays -- should this repo be marked as deprecated? HOT 2
- Github action ssh permission error on `npm ci` HOT 3
- not installed HOT 4
- Could not find a declaration file for module 'ethereumjs-abi'
- `Could not install from "node_modules/eth-sig-util/ethereumjs-abi@git+https:/github.com/ethereumjs/ethereumjs-abi.git" as it does not contain a package.json file.` HOT 4
- Error HH700: Artifact for contract "Greeter" not found. HOT 1
- Enable private reporting of vulnerabilities or document how to report vulnerabilities
- 无法安装 HOT 1
- Zero-sized-types cause DoS when parsed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereumjs-abi.