Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vault contract #6

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions Clarinet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ path = 'src/aibtcdev-resources-v1.clar'
clarity_version = 2
epoch = 2.4

[contracts.aibtcdev-vault]
path = 'src/aibtcdev-vault.clar'
clarity_version = 2
epoch = 2.4

[repl.analysis]
passes = ['check_checker']

Expand Down
5 changes: 5 additions & 0 deletions deployments/default.simnet-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ plan:
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: src/aibtcdev-resources-v1.clar
clarity-version: 2
- emulated-contract-publish:
contract-name: aibtcdev-vault
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: src/aibtcdev-vault.clar
clarity-version: 2
epoch: "2.4"
30 changes: 30 additions & 0 deletions src/aibtcdev-vault.clar
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

;; title: aibtcdev-vault
;; version: 0.0.2
;; summary: Vault contract to hold and manage assets
;; description: The vault contract facilitates the storage and management of payments for resources. Within a 1,044 Bitcoin block cycle (~1 week), deposits are pooled and assigned 75% to the owner and 25% to the token holders.

;; traits
;;

;; token definitions
;;

;; constants
;;

;; data vars
;;

;; data maps
;;

;; public functions
;;

;; read only functions
;;

;; private functions
;;

21 changes: 21 additions & 0 deletions tests/aibtcdev-vault.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import { describe, expect, it } from "vitest";

const accounts = simnet.getAccounts();
const address1 = accounts.get("wallet_1")!;

/*
The test below is an example. To learn more, read the testing documentation here:
https://docs.hiro.so/clarinet/feature-guides/test-contract-with-clarinet-sdk
*/

describe("example tests", () => {
it("ensures simnet is well initalised", () => {
expect(simnet.blockHeight).toBeDefined();
});

// it("shows an example", () => {
// const { result } = simnet.callReadOnlyFn("counter", "get-counter", [], address1);
// expect(result).toBeUint(0);
// });
});
Loading