If you use solc --ast, the compiler will output a json-representation of the AST (this is also included in the npm version of the compiler). Is that enough for your purposes? If not, please come to gitter to discuss.
I implemented a bitcoin blockchain parser after following along with this blog post. I havent tried changing it to work with the Ethereum blockchain but maybe it can give you some guidance. Here's a parser implemented in Go to hopefully give you some Ethereum specific examples to go off of.
The length of the string is the word after the one you have identified as status. So for asset1 it is 0x16 = 22 in decimal, and for asset2 it is 0xc9 = 201 decimal.
Strings are dynamic types and have a particular ABI representation as described in the ABI spec. Dynamic data appears after the rest of the data: your string_content ??? word is a pointer to ...
I wrote an ANTLR4 grammar for Solidity that you may find useful:
It can generate parsers in any of the ANTLR supported targets and it has full support for the Solidity language as of today.
You can find the parser's source code in the ethereum/solidity project, it's written in C++.
Here's the main implementation file: Parser.cpp
You can find the main repo where solidity is linked and which contains the required dependencies to build it in the webthree-umbrella project repo.
Here's a direct link to the wiki for installing it, you don't need ...
If you want to do it in NodeJs, you can create a file named decodeParams.js and which contains:
const Web3 = require("web3");
const web3 = new Web3();
const Coder = require("./node_modules/web3/lib/solidity/coder.js");
var result = Coder.decodeParams(
[ "uint256", "uint256", "uint256", "address", "string" ],
Try this out.
pragma solidity > 0.5.1;
returns (string memory)
function addressToString(address _addr) public pure returns(string memory)
bytes32 value = bytes32(uint256(_addr));
Smart contract code (EVM bytecode, in the case of Ethereum) is "uploaded" to the blockchain in the deployment transaction of a smart contract. The contract gets its own address, similar to Ethereum personal address.
You can easily inspect transactions in and out of a smart contract by monitoring its address. This can be done using a blockchain explorer like ...
grabABI, which is part of QuickBlocks, comes very close. It's open source, so you could modify it slightly to surround its output with the contract part and add the squiggles after each function, but it should be easy.
You can find it on github.
There is also a xText grammar, https://github.com/webdaford/smart-contract-tools/blob/master/workspace/com.dell.research.bc.eth.solidity.editor/src/com/dell/research/bc/eth/solidity/editor/Solidity.xtext which is quite similar to BNF.
is ethereumjs-tx-unsign along the lines of what you're hoping to accomplish?
if so.. and you're also interested in obtaining even more information (from the signature), then the unsign() function in ethereumjs-tx-sign is a good place to look.
It perhaps doesn't meet the "it would be nice to give it to someone non-technical and allow them to parse it without using tools I've provided" qualifier, but the Ethslurp tool may be of use to people with at least some technical knowhow.
(As mentioned in an answer to this very similar previous question: Symbolic decoding of a transaction for Solidity.)
Your geth node will also act as a JSON-RPC server. You can use the APIs wiki page to crawl the blockchain and extract block data. Here is an interesting git repo that you could fork. It's a bit show though and requires some code modifications as the owner isn't maintaining it any more. You'll find a pull request on that repo that runs substantially faster, ...
In addition to Tim's answer there's also a python-solidity-parser based on the ANTLR syntax and AST format used in solidity-parser-antlr that you can use if you want to avoid depending on the compiler. Note: compiler AST is the truth.