Skip to content

JABERMQM/sweat-near

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 SWT Near playground

Dependencies

  • Install near-cli: npm install -g near-cli
  • Install Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Run tests

cargo test -- --nocapture

Or use VS Code + Rust plugin

image

Build

cargo build --target wasm32-unknown-unknown --release

The wasm file will be at target/wasm32-unknown-unknown/release/swt.wasm

Deploy

🎫 Specify your own accountId.

near deploy --accountId=intmainreturn0.testnet --wasmFile=target/wasm32-unknown-unknown/release/swt.wasm --initArgs '{"oracle_id":"intmainreturn0.testnet"}' --initFunction new

OR

near dev-deploy --wasmFile=target/wasm32-unknown-unknown/release/swt.wasm

Send steps

near call intmainreturn0.testnet record '{"account_id":"intmainreturn0.testnet", "steps": 1000}' --accountId intmainreturn0.testnet --gas=300000000000000

Record the batch of steps:

near call <contract name> batch_record '{"steps": [["testmewell.testnet", 1000000]]}' --accountId <your oracle account>

Formula ⨐t

near view intmainreturn0.testnet formula '{"account_id":"intmainreturn0.testnet", "steps": 10000}'
near view intmainreturn0.testnet get_steps_from_tge '{"account_id":"intmainreturn0.testnet"}'

Balances

near view intmainreturn0.testnet ft_balance_of '{"account_id":"intmainreturn0.testnet"}'

About

Sweat The Token

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.6%
  • Shell 0.4%