This repository includes a complete project structure for AssemblyScript contracts targeting the NEAR platform.
The example here is very basic. It's a simple contract demonstrating the following concepts:
- a single contract
- the difference between
viewvs.changemethods - basic contract storage
The goal of this repository is to make it as easy as possible to get started writing unit tests for AssemblyScript contracts built to work with NEAR Protocol.
- clone this repo to a local folder
- run
yarn - run
yarn install - run
yarn test
- run
yarn testto run all tests- (!) be sure to run
yarn build:releaseat least once before:- run
yarn test:unitto run only unit tests
- run
- (!) be sure to run
- run
yarn buildto quickly verify build status - run
yarn deployto quickly run the./scripts/1.deploy.shcommand to deploy smart contract - run
yarn cleanto clean up build folder
- announcement contract and test documentation
- see
/src/announcement/READMEfor contract interface - see
/src/announcement/__tests__/READMEfor announcement unit testing details
- see
src
├── announcement <-- announcement contract
│ ├── README.md
│ ├── __tests__
│ │ ├── README.md
│ │ └── index.unit.spec.ts
│ └── assembly
│ └── index.ts
| └── model.ts
└── utils.ts <-- shared contract codescripts
├── 1.deploy.sh
├── 2.create_announcement.sh
├── 3.get_announcement.sh
├── 4.get_announcements.sh
├── 5.delete_announcement.sh
├── 6.like_announcement.sh
├── 6.dislike_announcement.sh
└── README.md <-- instructionsCheck out the deployed Smart Contract on explorer.testnet.near.org