neo-one-suite/neo-one

Fix how our contracts are called

Opened this issue · 5 comments

  • Need to make sure we’re calling contracts correctly in our client ScriptBuilder
  • If sticking with current hack-y version:
    • All method offsets are set to zero (improper)
    • Every method should now accept two args: 1 byte string for method, and one array for actual args
    • Made edits in smartContract for.ts and linkedSmartContract for.ts
  • If changing to how it should be done
    • Remove jump table. Method lookup is by manifest offset
    • Method offsets should be where the method actually starts and not jump table location
    • Every method needs to start with INITSLO

Change line 250 in createSmartContract.ts
Screen Shot 2021-08-19 at 5 19 42 PM

and line 216-218:
Screen Shot 2021-08-19 at 5 19 42 PM

And in line 227 in LocalUserAccountProvider.ts
Screen Shot 2021-08-19 at 6 40 51 PM

And line 403 (and probably others) in common.ts:
Screen Shot 2021-08-24 at 2 19 23 PM

And here in common.ts and ManifestSmartContractProcessor.ts

Screen Shot 2021-08-25 at 12 33 11 PM

Screen Shot 2021-08-25 at 12 33 29 PM

Also revert #2544