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 extensions for stacking #14

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
21 changes: 18 additions & 3 deletions Clarinet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ contract_id = 'SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.nope'

[[project.requirements]]
contract_id = 'SP16GEW6P7GBGZG0PXRXFJEMR3TJHJEY2HJKBP1P5.og-bitcoin-pizza-leather-edition'
[[project.requirements]]
contract_id = 'SP000000000000000000002Q6VF78.pox-4'

[contracts.emergency-rules]
path = 'contracts/rules/emergency-rules.clar'
clarity_version = 2
Expand Down Expand Up @@ -61,15 +64,27 @@ path = 'contracts/smart-wallet-trait.clar'
clarity_version = 2
epoch = 2.1

[contracts.standard-rules]
path = 'contracts/rules/standard-rules.clar'
clarity_version = 2
epoch = 2.1

[contracts.sponsored-transfer]
path = 'contracts/extensions/sponsored-transfer.clar'
clarity_version = 2
epoch = 2.1

[contracts.standard-rules]
path = 'contracts/rules/standard-rules.clar'
[contracts.ext-delegate-stx-pox-4]
path = 'contracts/extensions/ext-delegate-stx-pox-4.clar'
clarity_version = 2
epoch = 2.1
epoch = 2.5

[contracts.ext-allow-contract-caller-pox-4]
path = 'contracts/extensions/ext-allow-contract-caller-pox-4.clar'
clarity_version = 2
epoch = 2.5


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

Expand Down
11 changes: 11 additions & 0 deletions contracts/extensions/ext-allow-contract-caller-pox-4.clar
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(define-constant err-invalid-payload (err u500))

(define-public (call (payload (buff 2048)))
(let ((details (unwrap! (from-consensus-buff? {amount-ustx: uint, delegate-to: principal, until-burn-ht: (optional uint),
pox-addr: (optional { version: (buff 1), hashbytes: (buff 32) })} payload) err-invalid-payload)))
(to-uint-response (contract-call? 'SP000000000000000000002Q6VF78.pox-4 delegate-stx
(get amount-ustx details) (get delegate-to details) (get until-burn-ht details) (get pox-addr details)))
))

(define-read-only (to-uint-response (res (response bool int)))
(match res success (ok success) error (err (to-uint error))))
11 changes: 11 additions & 0 deletions contracts/extensions/ext-delegate-stx-pox-4.clar
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(define-constant err-invalid-payload (err u500))

(define-public (call (payload (buff 2048)))
(let ((details (unwrap! (from-consensus-buff? {amount-ustx: uint, delegate-to: principal, until-burn-ht: (optional uint),
pox-addr: (optional { version: (buff 1), hashbytes: (buff 32) })} payload) err-invalid-payload)))
(to-uint-response (contract-call? 'SP000000000000000000002Q6VF78.pox-4 delegate-stx
(get amount-ustx details) (get delegate-to details) (get until-burn-ht details) (get pox-addr details)))
))

(define-read-only (to-uint-response (res (response bool int)))
(match res success (ok success) error (err (to-uint error))))
58 changes: 19 additions & 39 deletions deployments/default.simnet-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,54 +132,34 @@ plan:
transactions: []
epoch: "2.1"
- id: 3
transactions: []
epoch: "2.1"
transactions:
- emulated-contract-publish:
contract-name: nope
emulated-sender: SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ
path: ".\\.cache/requirements/SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.nope.clar"
clarity-version: 2
epoch: "2.4"
- id: 4
transactions: []
epoch: "2.1"
epoch: "2.4"
- id: 5
transactions: []
epoch: "2.1"
- id: 6
transactions: []
epoch: "2.1"
- id: 7
transactions: []
epoch: "2.1"
- id: 8
transactions: []
epoch: "2.1"
- id: 9
transactions:
- emulated-contract-publish:
contract-name: og-bitcoin-pizza-leather-edition
emulated-sender: SP16GEW6P7GBGZG0PXRXFJEMR3TJHJEY2HJKBP1P5
path: ".\\.cache/requirements/SP16GEW6P7GBGZG0PXRXFJEMR3TJHJEY2HJKBP1P5.og-bitcoin-pizza-leather-edition.clar"
clarity-version: 2
- emulated-contract-publish:
contract-name: nope
emulated-sender: SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ
path: ".\\.cache/requirements/SP32AEEF6WW5Y0NMJ1S8SBSZDAY8R5J32NBZFPKKZ.nope.clar"
contract-name: ext-allow-contract-caller-pox-4
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/extensions/ext-allow-contract-caller-pox-4.clar
clarity-version: 2
epoch: "2.4"
- id: 10
transactions: []
epoch: "2.4"
- id: 11
transactions: []
epoch: "2.4"
- id: 12
transactions: []
epoch: "2.4"
- id: 13
transactions: []
epoch: "2.4"
- id: 14
transactions: []
epoch: "2.4"
- id: 15
transactions: []
epoch: "2.4"
- id: 16
- emulated-contract-publish:
contract-name: ext-delegate-stx-pox-4
emulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
path: contracts/extensions/ext-delegate-stx-pox-4.clar
clarity-version: 2
epoch: "2.5"
- id: 6
transactions: []
epoch: "2.4"
epoch: "2.5"
Loading