contracting icon indicating copy to clipboard operation
contracting copied to clipboard

Contracts should be case locked.

Open JeffWScott opened this issue 6 years ago • 1 comments

Describe the bug Contracts are not case locked, so "currency" and "Currency" would be stored as two different contracts. That's a security risk.

To Reproduce Steps to reproduce the behavior:

  1. Submit a contract as "testing"
  2. Submit another as "Testing"
  3. See both exists on BC.

Expected behavior contracts should be converted to upper and lower and compared for duplicate names.

JeffWScott avatar Jan 02 '20 17:01 JeffWScott

Calling str.lower will fix this. We can also restrict the names to be ASCII only, a certain length, and prepend a prefix to prevent collisions with Python keywords.

While -> while -> c_while # Add c_ prefix?
123hElLo -> should fail
Hi^^^%%@@ -> should fail

StuartFarmer avatar Jan 02 '20 17:01 StuartFarmer