Awesome
Ewasm AssemblyScript demo
The AssemblyScript project in this repository is a proof of concept barebones "ERC-20 style" implementation of a simple ledger. The main code lives in main.ts. It allows anyone to check the token balance of an account, and a tokenholder to transfer some of their tokens to another account. Sample transaction data may be found on the coding challenge gist.
Steps to compile, deploy, and test
- Use WebassemblyStudio or another IDE to bootstrap the project and edit
main.ts
. - If using WebassemblyStudio, download the project code.
- Navigate to the top directory of the project and run
npm install
. - Run
npm run build
to compile the AssemblyScript source to WASM bytecode. Find the compiledmain.wasm
file in thebuild/
directory. At this point you have a valid WASM binary.
You now have a valid ewasm-compatible WAST which is ready to be deployed to the ewasm testnet using a tool such as ewasm-studio.
Another option is to test the code using testeth
. See this example of a test filler that fully tests this code.