https://github.com/antoncoding/neo-smart-contracts
SC Tutorials from Official Website
https://github.com/antoncoding/neo-smart-contracts
Last synced: 11 months ago
JSON representation
SC Tutorials from Official Website
- Host: GitHub
- URL: https://github.com/antoncoding/neo-smart-contracts
- Owner: antoncoding
- Created: 2018-03-21T06:49:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-12T12:31:10.000Z (over 7 years ago)
- Last Synced: 2025-02-08T07:25:22.175Z (about 1 year ago)
- Language: Python
- Size: 51.8 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Neo Smart Contracts Tutorials

### Required Packages:
`neo-boa` : for compile
`neo-python`: to interact with the NEO blockchain, build and deploy your contracts.
Use this command to start `neo-python`
```
np-prompt -p
```
##### Official Sample 1: Hello World
```
neo> build {path}/smart-contracts/sample1.py test '' 01 False False
```
#### Official Sample 2: Basic Computation
```
neo> build {path}/smart-contracts/sample2.py test 070202 02 False False add 1 2
```
#### Official Sample 3: Balance Checker
```
neo> build {path}/smart-contracts/sample3.py test 070502 02 True False add AG4GfwjnvydAZodm4xEDivguCtjCFzLcJy 3
```
You can you any other address instead of `AG4GfwjnvydAZodm4xEDivguCtjCFzLcJy`, it's only working as a key for Storage
## My Simple Smart Contract Samples
#### Sample - Storage
```
build {path}/smart-contracts/sample-storage.py test 02 02 True True
```
It's a good idea to use `concat()` to contruct specific keystring for storage.
#### Sample: List Operation
Currently working with a samll function `remove_from_list`. Since the remove() and pop() functions are not working properly.
```
build {path}/smart-contracts/sample-list.py test 02 02 True True 1
```
#### Sample: Timestamp
This is about how to get Current TimeStamp in a neo Smart Contract. the GetTime() function works as well.
```
build {path}/smart-contracts/sample-timestamp.py test 02 02 True True
return: Current Linux TimeStamp
```