Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Samovic11 authored Jan 30, 2024
0 parents commit 5f389f1
Show file tree
Hide file tree
Showing 79 changed files with 25,003 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: jetli/[email protected]
with:
version: 'latest'
- name: Rust - install
run: yarn
working-directory: rust/pst
- name: Rust - build
run: yarn build
working-directory: rust/pst
- name: Rust - generate bindings
run: yarn gen-bindings
working-directory: rust/pst
- name: Rust - run tests
run: yarn test
working-directory: rust/pst
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
target
dist
__tests__/*.json
/coverage
.DS_Store
.secrets
.idea
.yalc
yalc.lock
/rust/pst/contract/definition/bindings
logs
cache
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Warp contracts - WASM templates

This repo contains Warp WASM contracts templates in:

- [AssemblyScript](assemblyscript/README.md)
- [Rust](rust/pst/README.md)
- [Go](go/README.md)

It allows to quickly jump into contract development - each template contains an example PST contract,
deployment scripts (on localhost, testnet and mainnet), build scripts and example tests - all backed-up by the [Warp SDK](https://github.com/warp-contracts/warp).

| Feature | JS | WASM - AS | WASM - Rust | WASM - Go |
| ---------------------- | ----------------------------------------- | --------- | ----------- | --------- |
| Sandboxing | [vm2](https://github.com/patriksimek/vm2) ||||
| Foreign contract read || R&D |||
| Foreign contract view || R&D || Soon |
| Foreign contract write || R&D || Soon |
| Arweave.utils || Soon | Soon | Soon |
| Evolve |||||
| Logging from contract |||||
| Transaction data (1) |||||
| Block data (2) |||||
| Contract data (3) |||||
| Gas metering | 🚫 ||||

Legend:

- `R&D` - we need to make some research and development before implementing the feature
- `Soon` - the technology is already there, we just need to find some time to add the missing features :-)
- `(1)` - access current transaction data (id, owner, etc.)
- `(2)` - access current block data (indep_hash, height, timestamp)
- `(3)` - access current contract data (id, owner)
3 changes: 3 additions & 0 deletions rust/pst/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
lib
src/__tests__/integration/data
18 changes: 18 additions & 0 deletions rust/pst/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 1, // warning
"multiline-ternary": "off",
"no-nested-ternary": "off",
"no-multiple-empty-lines": "off",
"prettier/prettier": 2 // error
}
}
3 changes: 3 additions & 0 deletions rust/pst/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
lib
src/__tests__/integration/data
6 changes: 6 additions & 0 deletions rust/pst/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 120
}
Loading

0 comments on commit 5f389f1

Please sign in to comment.