ewasm / wrc20-examples

This repository contains examples of WRC20 tokens written in different languages.
MIT License
12 stars 5 forks source link

add assemblyscript #6

Open poemm opened 5 years ago

poemm commented 5 years ago

Add AssemblyScript source code and compiled wasm. This is @lrettig 's work, I just copied files.

jwasinger commented 5 years ago

Should probably amend the commit to make @lrettig an author.

poemm commented 5 years ago

Amended with author change.

BTW anyone is welcome to update this code. I think that Lane mentioned that he ignored endianness so input/output may need bytes reversed, and that he doesn't know whether it still compiles with newest Assemblyscript compiler.

hugo-dc commented 5 years ago

I tried this code, there are some issues with endianess. Maybe we can merge this and then fix it. I made some changes and pushed to this repo: https://github.com/hugo-dc/wrc20-as/blob/master/assembly/index.ts

I fixed the function selector endianess and added the namespace decorators, iirc it is still returning the values with reversed endianess.

Maybe we could merge this PR, and then fix it to use correct endianness.

poemm commented 5 years ago

Should this repository contain source code or just a spec, a test framework, and links to source code? I expect that not everyone will want to share their source code here for various reasons.

So maybe this PR should be closed in favor of a separate AssemblyScript_Ewasm_Contracts repo. Any thoughts?

lrettig commented 5 years ago

Happy to take another look at this but holding off for now pending @poemm's question here.