Open 0xekez opened 2 years ago
this looks nice! actually i once tried using the regex for verification, but the regex library makes the contract binary too big to be put on-chain.
@larry0x: this looks nice!
Happy to put up a PR to add this. Are we early enough with versioning here that we can make a change that isn't backwards compatible?
Agree about regex. :) There are some ways to generate valid strings from a regex so I was thinking of trying to write some fuzzing code for this using that. There are some weird corners with go regex vs rust strings that I worry about: https://github.com/DA0-DA0/dao-contracts/blob/zeke/deposit-modules/packages/voting/src/denom.rs#L215-L223
I was recently looking into native denom validation, and it turns out there are actually some reasonably strict rules in the SDK as to what strings may be denominations. We should be able to perform that validation in a contract reasonably enough. From dao-contracts: