1

I wonder if aside the Json representation of ABI is there a bytecoded and compact version of the same interface. Json is human readable, but in some cases it is just an overkill.

2 Answers 2

1

For some purposes it makes sense to have a more compact format of ABI, e.g. in the case you like to encode it as URL parameter like in this link of Ethereum Event Scan:

https://ethereum-event-scan-stg.cert4trust.de/?abi=eJylkzFPwzAQhf%2FLzZmQYMhaBpZuiKWK0NW5BkvuObLPCVHV%2F44DjZ20QlRhtP383b3n8%2B4EmtsgHspdVUCLA%2B4NQXlA46kALyi0DYJ7bbQMUAJbnkQFyNBGLSjLXlxQYh2cixNgFA1HG3zipBpjuZo%2BqZ4dCTlG8%2FrDwrp25H2EMx7HjXfbM7lcbBKMhf5gxaY0NxnVkfPacmZdBOcqSTbZyrPlmUfqiOXf7kJcPzw%2B5ZaUDRGbqkznd5i7DUo5wvEJ1kT1Cy1euKUt0hKHSjbX2pzW92xgXJQx1nlWmdKQJNAlDhtkFum6CO8a505Tn%2B8eAisZJ2TZ%2BfUz59aZ%2Bhf0H29oAm2RsSE3WVm4WP21ckfVF9GqRcY%3D&contract=0x73b69304Ea866a8d4baE183d8728BFf35AD4d19B&provider=https:%2F%2Fleopold-node3-rpc-stg.cert4trust.de&refresh=true&dark=true

The parameter api can be read with two steps:

  1. decode base64
  2. unzip

You may find an example implementation for encoding and decoding of the ABI in typescript here

0

The general convention that people use is just to remove the white space on the JSON version of the ABI and put it all on one line if this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.