-
Notifications
You must be signed in to change notification settings - Fork 5
Solidity validator - BYTES #136
Comments
bytes1 0x00 ~ 0xff |
I actually don't know exactly, but if both are valid bytes, we can except any and then before I send them to the contract with ethers.js, I encode them into the right format that ethers.js excepts. But user should be able to write any valid format of bytes. Also a string... Does that make sense? |
@alincode Just implemented formating and parsing bytes when sending a transaction. This is the format of the hex byte ethers.js wants 0x736f6d657468696e670000000000000000000000000000000000000000000000 So, user can either write a string, that will be formatted to a bytecode Please let me know once validators are ready so I can update it in the smartcontract-app. I am using ethers.js (ethers.utils.formatBytes32String and ethers.utils.parseBytes32String) |
@ninabreznik |
@alincode Perfect. Let me know once you're done so I can update the validate module and test it in smartcontract-app :) |
release at https://www.npmjs.com/package/solidity-validator 0.2.1 |
@ninabreznik |
We need to validate bytes field too. So far we were validating it as a string, but when we send the EVM doesn't accept it as a string, but we need to convert it into a byte, so it makes sense to also validate it as a byte.
So, we should validate both:
There are many types of bytes, so we also need to check if it's bytes, byte32 etc.
The text was updated successfully, but these errors were encountered: