Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
aeb065d
init
Oct 14, 2025
6954cd8
initial commit
vasyafromrussia Oct 14, 2025
5c72ff5
feat: grant termination
vasyafromrussia Oct 15, 2025
2f91f91
feat: issue grants with transfer
vasyafromrussia Oct 15, 2025
1c99eda
feat: add migration with a transfer
vasyafromrussia Oct 15, 2025
5401586
feat: add rbac
vasyafromrussia Oct 20, 2025
f225c18
refactor: rearrange code
vasyafromrussia Oct 20, 2025
d270f79
feat: add owmer
vasyafromrussia Oct 20, 2025
c1805c6
chore: clean
vasyafromrussia Oct 20, 2025
0e9cdf1
chore: some code consistency
vasyafromrussia Oct 20, 2025
d211e91
feat: add event
vasyafromrussia Oct 20, 2025
75e510e
test: add rbac tests
vasyafromrussia Oct 21, 2025
6696796
fix: better xcc result handling
vasyafromrussia Oct 21, 2025
b25f0bc
feat: pause
vasyafromrussia Oct 21, 2025
cd53aa7
build: v0.1.0
vasyafromrussia Oct 21, 2025
3c1b772
fix: fix tests
vasyafromrussia Oct 21, 2025
f543635
chore: add Makefile
vasyafromrussia Oct 21, 2025
042b9f9
chore: update README
vasyafromrussia Oct 21, 2025
ece2b4c
fix: unified issue mechanism
vasyafromrussia Oct 22, 2025
b6c1a53
chore: sync empty main
vasyafromrussia Oct 22, 2025
98b760c
test: add integration tests (#2)
vasyafromrussia Oct 23, 2025
c07cfd4
bump version
vasyafromrussia Oct 23, 2025
302000d
build: v0.1.1
vasyafromrussia Oct 23, 2025
42e454c
fix: fix vested amount calculation
vasyafromrussia Oct 25, 2025
6bfca1a
add spooning to tests
vasyafromrussia Oct 25, 2025
9bc00d7
test: clean tests
vasyafromrussia Oct 27, 2025
85dcfb6
bump version
vasyafromrussia Oct 27, 2025
c441bb2
release: v0.1.2
vasyafromrussia Oct 27, 2025
69bc804
feat: force unpause
vasyafromrussia Oct 27, 2025
ed4e2a0
fix: unpause on decline
vasyafromrussia Oct 27, 2025
75b88ad
bump version
vasyafromrussia Oct 27, 2025
ebb7f7e
fix: add termination date and reset total amount on terminate
vasyafromrussia Oct 29, 2025
7f51feb
test: move to rstest
vasyafromrussia Oct 30, 2025
ed3fe12
feat: check gas on authorize
vasyafromrussia Oct 30, 2025
2b46a56
test: more corner cases
vasyafromrussia Oct 30, 2025
c411a28
chore: imports clean
vasyafromrussia Oct 31, 2025
e1d2cb6
feat: add termination event
vasyafromrussia Oct 31, 2025
53b7f56
bump version
vasyafromrussia Oct 31, 2025
7fe586e
release: v0.1.4
vasyafromrussia Oct 31, 2025
5ac19d2
fix: termination in future
vasyafromrussia Oct 31, 2025
77231fd
bump version
vasyafromrussia Oct 31, 2025
67cd12c
release: v0.1.5
vasyafromrussia Oct 31, 2025
88196cf
feat: terminate a single grant
vasyafromrussia Nov 5, 2025
8a2c92d
feat: return bought amount on 'buy'
vasyafromrussia Nov 5, 2025
0b0d0c2
bump version
vasyafromrussia Nov 5, 2025
138e6d7
release: v0.1.6
vasyafromrussia Nov 5, 2025
488c187
fix: early termination
vasyafromrussia Nov 5, 2025
52f960a
bump version
vasyafromrussia Nov 5, 2025
1193b83
release: v0.1.7
vasyafromrussia Nov 5, 2025
5a66ea4
fix: handle callback properly
vasyafromrussia Nov 5, 2025
79da07f
bump version
vasyafromrussia Nov 5, 2025
1f6350d
release: v0.1.8
vasyafromrussia Nov 5, 2025
26596a4
feat: timestamp in account view; fix: buy event
vasyafromrussia Nov 6, 2025
02fc10e
bump version
vasyafromrussia Nov 6, 2025
53535e0
release: v0.1.9
vasyafromrussia Nov 6, 2025
8141ce1
fix: change standard name
vasyafromrussia Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy to production
on:
push:
branches: [main]

jobs:
test:
uses: ./.github/workflows/test.yml

deploy-staging:
name: Deploy to production
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cargo-near CLI
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.17.0/cargo-near-installer.sh | sh
- name: Deploy to production
run: |
cargo near deploy build-reproducible-wasm "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_ID }}" \
without-init-call \
network-config "${{ vars.NEAR_CONTRACT_PRODUCTION_NETWORK }}" \
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PRIVATE_KEY }}" \
send
52 changes: 52 additions & 0 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy to staging
on:
pull_request:

jobs:
test:
uses: ./.github/workflows/test.yml

deploy-staging:
name: Deploy to staging subaccount
permissions:
pull-requests: write
needs: [test]
runs-on: ubuntu-latest
env:
NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID: gh-${{ github.event.number }}.${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install near CLI
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.20.0/near-cli-rs-installer.sh | sh
- name: Create staging account
if: github.event.action == 'opened' || github.event.action == 'reopened'
run: |
near account create-account fund-myself "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" '10 NEAR' \
use-manually-provided-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \
sign-as "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \
network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
send

- name: Install cargo-near CLI
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.17.0/cargo-near-installer.sh | sh
- name: Deploy to staging
# `--skip-git-remote-check` was used
# as pull request git refs `refs/pull/NUMBER/merge` are somewhat harder to access and live only as long as PRs do
#
# WASM reproducibility check akin to SourceScan won't be available for staging contracts, deployed from PRs
run: |
cargo near deploy build-reproducible-wasm --skip-git-remote-check "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \
without-init-call \
network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
send

- name: Comment on pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr comment "${{ github.event.number }}" --body "Staging contract is deployed to ["'`'"${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}"'`'" account](https://explorer.${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}.near.org/accounts/${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }})"
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test
on:
workflow_call:

jobs:
code-formatting:
name: Code Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: cargo fmt --check

code-linter:
name: Code Linter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run cargo clippy
run: |
rustup component add clippy
cargo clippy --all-features --workspace --tests -- --warn clippy::all --warn clippy::nursery

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cargo-near CLI
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.17.0/cargo-near-installer.sh | sh
- name: Run cargo test
run: cargo test
23 changes: 23 additions & 0 deletions .github/workflows/undeploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Undeploy staging
on:
pull_request:
types: [closed]

jobs:
cleanup-staging:
name: Cleanup staging account
runs-on: ubuntu-latest
env:
NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID: gh-${{ github.event.number }}.${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install near CLI
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.20.0/near-cli-rs-installer.sh | sh
- name: Remove staging account
run: |
near account delete-account "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \
beneficiary "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \
network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \
sign-with-plaintext-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \
send
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
.DS_Store
Loading
Loading