The motivation behind the coding test is the measurement of the qualification and testing the learning attitude of the candidate.
Create a simple ABI parser library. Please do NOT use any library you can find on the internet only certain exceptions detailed later.
- Rust
- The library should accept a file (contains the abi of an Ethereum based smart contract), and a function signature with parameters depends on necessity.
- The library should NOT use any external library except the one responsible for keccak256 hashing.
- The library should be as simple as possible so the user doesn’t have pray for the undefined gods to make it work.
The ABI file will be provided which should satisfy the following test scenarios:
| Function name | Parameters | Result transaction data |
|---|---|---|
| balanceOf | [0x30E7d7FfF85C8d0E775140b1aD93C230D5595207] | 0x70a0823100000000000000000000000030e7d7fff85c8d0e775140b1ad93c230d5595207 |
| transfer | [0x30E7d7FfF85C8d0E775140b1aD93C230D5595207, 20000000000] | 0xa9059cbb00000000000000000000000030e7d7fff85c8d0e775140b1ad93c230d559520700000000000000000000000000000000000000000000000000000004a817c800 |
| allowance | [0x30E7d7FfF85C8d0E775140b1aD93C230D5595207, 0x81Fbae3C693624FEc9eF1a86626228980bEB1C71] | 0xdd62ed3e00000000000000000000000030e7d7fff85c8d0e775140b1ad93c230d559520700000000000000000000000081fbae3c693624fec9ef1a86626228980beb1c71 |
- So it should accept the function name and the parameters and should return the Transaction data.
- If the candidate familiar with Solidity the library can return whether it should be an
eth_callor aneth_sendTransactionnext to the data.
Any other information should be researched by the candidate. In case of questions please contact us.
senior_rust_abi.jsonshould be contained.