Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
OxMarco committed Oct 4, 2024
1 parent 67703a8 commit 6d43fd4
Show file tree
Hide file tree
Showing 19 changed files with 1,026 additions and 699 deletions.
28 changes: 14 additions & 14 deletions Clarinet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,38 @@ contract_id = 'SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F.hk-merkle-tree-keccak16

[contracts.pyth-governance-v1]
path = 'contracts/pyth-governance-v1.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[contracts.pyth-oracle-v2]
path = 'contracts/pyth-oracle-v2.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[contracts.pyth-store-v1]
path = 'contracts/pyth-store-v1.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[contracts.pyth-pnau-decoder-v1]
path = 'contracts/pyth-pnau-decoder-v1.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[contracts.pyth-traits-v1]
path = 'contracts/pyth-traits-v1.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[contracts.wormhole-core-v2]
path = 'contracts/wormhole/wormhole-core-v2.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[contracts.wormhole-traits-v1]
path = 'contracts/wormhole/wormhole-traits-v1.clar'
clarity_version = 2
epoch = 2.4
clarity_version = 3
epoch = 3.0

[repl.analysis]
passes = ['check_checker']
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Stacks <> Pyth - edited by Granite team

/ / ▶ Stacks Pyth Bridge
/ --- / Bridging Pyth price feeds to the Stacks blockchain.
/ / Retrieve trading pairs (BTC-USD, STX-USD, etc.) from Clarity smart contracts.
Expand Down Expand Up @@ -150,3 +152,7 @@ If the VAA is valid, the contract call will return a payload with the following

Including all the prices successfully updating the oracle.
All of the implementation details can be found in [Pyth documentation](https://docs.pyth.network/documentation/how-pyth-works).

# Upgrades
- Clarity V3
- bump dependencies
2 changes: 1 addition & 1 deletion contracts/pyth-store-v1.clar
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
prev-publish-time: uint,
}))
(let ((stale-price-threshold (contract-call? .pyth-governance-v1 get-stale-price-threshold))
(latest-bitcoin-timestamp (unwrap! (get-block-info? time (- block-height u1)) ERR_STALE_PRICE)))
(latest-bitcoin-timestamp (unwrap! (get-stacks-block-info? time (- stacks-block-height u1)) ERR_STALE_PRICE)))
;; Ensure that we have not processed a newer price
(asserts! (is-price-update-more-recent (get price-identifier entry) (get publish-time entry)) ERR_NEWER_PRICE_AVAILABLE)
;; Ensure that price is not stale
Expand Down
26 changes: 13 additions & 13 deletions deployments/default.devnet-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,80 +15,80 @@ plan:
SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 64640
path: "./.cache/requirements/SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F.hk-cursor-v2.clar"
clarity-version: 2
clarity-version: 3
- requirement-publish:
contract-id: SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F.hk-ecc-v1
remap-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
remap-principals:
SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 9440
path: "./.cache/requirements/SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F.hk-ecc-v1.clar"
clarity-version: 2
clarity-version: 3
- requirement-publish:
contract-id: SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F.hk-merkle-tree-keccak160-v1
remap-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
remap-principals:
SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 11000
path: "./.cache/requirements/SP2J933XB2CP2JQ1A4FGN8JA968BBG3NK3EKZ7Q9F.hk-merkle-tree-keccak160-v1.clar"
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: wormhole-traits-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 4920
path: contracts/wormhole/wormhole-traits-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-traits-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 16340
path: contracts/pyth-traits-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-governance-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 226570
path: contracts/pyth-governance-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-oracle-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 21680
path: contracts/pyth-oracle-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-pnau-decoder-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 160350
path: contracts/pyth-pnau-decoder-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-store-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 22430
path: contracts/pyth-store-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: wormhole-core-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 197240
path: contracts/wormhole/wormhole-core-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-helper-v1
expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
cost: 4420
path: contracts/pyth-helper-v1.clar
anchor-block-only: true
clarity-version: 2
epoch: "2.4"
clarity-version: 3
epoch: "3.0"
- id: 1
transactions:
- contract-call:
Expand Down Expand Up @@ -122,4 +122,4 @@ plan:
parameters:
- 0x504e41550100000003b801000000030d002c9e33a703a8c86012c117474849ae41118270cf56e2db61c7af28f64ce322391d33cb738930dc3ffcfe5ae35dbd99c4e08a8ac4b390c858d94dc1f0b91e24d00101901948561c54c17b7a21a9885d3f60a85b410e18209b02ebe098b0dd422b02667565e3b5011203303a6445cf629d20cec3d4771f0b391ab03bfd54364ac049f70002a030ed0060f1ba123ddf5473bef4c1c8f4aec8737b47f11023f94d5339b72c4c3aa325515956ea702537a3950d74f86134396de437bfc97a5365fc090dbb382c0103f1f64ba806fe8ba7b7db3846d85fccbe7d803865e7b757301f4a5de6ebde40f923ee925a7df78871d39299d70fd117635263b91fe53f792bfff450d210431316000439e31501d7b661a1b075a9302b57a6fc500c1e760de7e949e30994055b061b280cefcab3eb3b5c780f56cd555e88ee3c674b798ddeb8713bd27a361b8b8f1c730008db908c61e4158d1a7a7d53b2ec14027a4a2b2f3207edf0db2fbb0f431f3cdc020ee9fc9f38e812d094dcf5dd18f3a8d1d1ee94e840f504b00e08d0fbd607ed6d0109cf5c52aed9f4a42691c3c33bc366fde4a3ad23aacdd46c14669ad321106cf8d257b9379fc45cbe91a26ee87f4800951c5ca89ff0069e4a47299f988b368c6b74000b1241dea623dd874e13135682d760ee48ac1888149bddcfac54ff3787f4b89629063d89e084350ff1168999365918f9bdf469323b817a25491e56341a0da5c498000d538baecc668df092ce3cfeebfa5968447584916cb503ce50e7f77443bbd2a3441bb1d962a7f3401bfcf30f444a3301ab72dcb87cc04b681bdada93d45001f53d010e2fd97eeac94ceb3fd87a6e4ab3b785c64db221d522e58230a6d9eb10cba3b53a086ba6989e4285ab0816a26ff64c1a3a05175d0ffa61f4f744f928d6c5b3f92600107f999fa2f5cd826520cdf36f2e3434f4619eca4c2fb944bdec79d84903f76aaa02727844ec451378ab165910140c866ebdc65aea2cc6717da4747d4ed8a7338700115ce8f97f4a39ccdf5a61c9425d8a306a35b598db9d0f936bece6f2d92e79f9b1306d4c4789fb73ba5bd29bf0d306f2e8079aae818bc70aa9db111b745f1f4ab900126933d7f1317e3e45d98687e66ae033d871e1026e92f1ad168ec197a92ad653571837b78ee8e2263f2aca1dfa112fc78de63de9e2231f62ab79db2d956704146c0165131de200000000001ae101faedac5851e32b9b23b5f9411a8c2bac4aae3ed4dd7b811dd1a72ea4aa710000000000df92280141555756000000000005e1b46c00002710dbdd79b598d499596393b24358343774fd54e63c01005500ec7a775f46379b5e943c3526b1c8d54cd49749176b0b98e02dde68d1bd335c170000000002bf687c00000000000091effffffff80000000065131de10000000065131de00000000002c073dc0000000000008d5f09014cff5b7c5413efc667d2bca5549edadde5324814fed82e330d4110d610f5d0325deddb5541eacccd70da0a613768335768226657b201a456613163b0b4a21cf17276c2be6d02280ff05d08a6d4cf481c00c544f4adff1c86c6845a21871b75b4cffdc9314a2b46bddcb2bd44861fa48d4cc429a0783cb122a3eda67b7a13ad6298995c3bddd6cfa1ba547ddd38f0da18fcb0f7ead4d1de56db6c0442b94883a78f40b3541982a58d2d400dbfb761cce7bf780c
cost: 5960
epoch: "2.4"
epoch: "3.0"
20 changes: 10 additions & 10 deletions deployments/default.mainnet-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,57 @@ plan:
cost: 1486613
path: contracts/wormhole/wormhole-traits-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-traits-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1487019
path: contracts/pyth-traits-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-governance-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1495228
path: contracts/pyth-governance-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-oracle-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1487263
path: contracts/pyth-oracle-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-pnau-decoder-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1492627
path: contracts/pyth-pnau-decoder-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-store-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1487263
path: contracts/pyth-store-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: wormhole-core-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1494091
path: contracts/wormhole/wormhole-core-v1.clar
anchor-block-only: true
clarity-version: 2
clarity-version: 3
- contract-publish:
contract-name: pyth-helper-v1
expected-sender: SP19F0S4GN8CJQ4K9PKWRBVE00G2C86QTPTRXZ7GP
cost: 1486613
path: contracts/pyth-helper-v1.clar
anchor-block-only: true
clarity-version: 2
epoch: "2.4"
clarity-version: 3
epoch: "3.0"
- id: 1
transactions:
- contract-call:
Expand All @@ -91,4 +91,4 @@ plan:
- 0x01000000020d00ce45474d9e1b1e7790a2d210871e195db53a70ffd6f237cfe70e2686a32859ac43c84a332267a8ef66f59719cf91cc8df0101fd7c36aa1878d5139241660edc0010375cc906156ae530786661c0cd9aef444747bc3d8d5aa84cac6a6d2933d4e1a031cffa30383d4af8131e929d9f203f460b07309a647d6cd32ab1cc7724089392c000452305156cfc90343128f97e499311b5cae174f488ff22fbc09591991a0a73d8e6af3afb8a5968441d3ab8437836407481739e9850ad5c95e6acfcc871e951bc30105a7956eefc23e7c945a1966d5ddbe9e4be376c2f54e45e3d5da88c2f8692510c7429b1ea860ae94d929bd97e84923a18187e777aa3db419813a80deb84cc8d22b00061b2a4f3d2666608e0aa96737689e3ba5793810ff3a52ff28ad57d8efb20967735dc5537a2e43ef10f583d144c12a1606542c207f5b79af08c38656d3ac40713301086b62c8e130af3411b3c0d91b5b50dcb01ed5f293963f901fc36e7b0e50114dce203373b32eb45971cef8288e5d928d0ed51cd86e2a3006b0af6a65c396c009080009e93ab4d2c8228901a5f4525934000b2c26d1dc679a05e47fdf0ff3231d98fbc207103159ff4116df2832eea69b38275283434e6cd4a4af04d25fa7a82990b707010aa643f4cf615dfff06ffd65830f7f6cf6512dabc3690d5d9e210fdc712842dc2708b8b2c22e224c99280cd25e5e8bfb40e3d1c55b8c41774e287c1e2c352aecfc010b89c1e85faa20a30601964ccc6a79c0ae53cfd26fb10863db37783428cd91390a163346558239db3cd9d420cfe423a0df84c84399790e2e308011b4b63e6b8015010ca31dcb564ac81a053a268d8090e72097f94f366711d0c5d13815af1ec7d47e662e2d1bde22678113d15963da100b668ba26c0c325970d07114b83c5698f46097010dc9fda39c0d592d9ed92cd22b5425cc6b37430e236f02d0d1f8a2ef45a00bde26223c0a6eb363c8b25fd3bf57234a1d9364976cefb8360e755a267cbbb674b39501108db01e444ab1003dd8b6c96f8eb77958b40ba7a85fefecf32ad00b7a47c0ae7524216262495977e09c0989dd50f280c21453d3756843608eacd17f4fdfe47600001261025228ef5af837cb060bcd986fcfa84ccef75b3fa100468cfd24e7fadf99163938f3b841a33496c2706d0208faab088bd155b2e20fd74c625bb1cc8c43677a0163c53c409e0c5dfa000100000000000000000000000000000000000000000000000000000000000000046c5a054d7833d1e42000000000000000000000000000000000000000000000000000000000436f7265020000000000031358cc3ae5c097b213ce3c81979e1b9f9570746aa5ff6cb952589bde862c25ef4392132fb9d4a42157114de8460193bdf3a2fcf81f86a09765f4762fd1107a0086b32d7a0977926a205131d8731d39cbeb8c82b2fd82faed2711d59af0f2499d16e726f6b211b39756c042441be6d8650b69b54ebe715e234354ce5b4d348fb74b958e8966e2ec3dbd4958a7cd15e7caf07c4e3dc8e7c469f92c8cd88fb8005a2074a3bf913953d695260d88bc1aa25a4eee363ef0000ac0076727b35fbea2dac28fee5ccb0fea768eaf45ced136b9d9e24903464ae889f5c8a723fc14f93124b7c738843cbb89e864c862c38cddcccf95d2cc37a4dc036a8d232b48f62cdd4731412f4890da798f6896a3331f64b48c12d1d57fd9cbe7081171aa1be1d36cafe3867910f99c09e347899c19c38192b6e7387ccd768277c17dab1b7a5027c0b3cf178e21ad2e77ae06711549cfbb1f9c7a9d8096e85e1487f35515d02a92753504a8d75471b9f49edb6fbebc898f403e4773e95feb15e80c9a99c8348d
- '(list 0x2a953a2e8b1052eb70c1d7b556b087deed598b55608396686c1c811b9796c763078687ce10459f4f25fb7a0fbf8727bb0fb51e00820e93a123f652ee843cf08d 0x2766db08820e311b22e109801ab8ea505b12e3df3d91ebc87c999ffb6929d1abb0ade987c74aa37db26eea4086ee738a2f34a5594edb8760da0eac5be356b731 0x54177ff4a8329520b76efd86f8bfce5c942554db16e673267dc1133b3f5e230b2d8cbf90fe274946045d4491de288d736680edc2ee9ee5b1b15416b0a34806c4 0x7fa3e98fcc2621337b217b61408a98facaabd25bad2b158438728ce863c14708cfcda1f3b50a16ca0211199079fb338d479a54546ec3c5f775af23a7d7f4fb24 0x0bdcbccc0297c2a4f92a7c39358c42f22a8ed700a78bd05c39c8b61aaf2338e825b6c0d26d1f2a2ae4129cd751201f73d7234c753bd0735212a5288b19748fd2 0xcfd90084be68de514fe14a7c281f492223f045566f859ea5c166d6e60bc650c23940909a8e96c2fbffbd15a598b4e6a5b5aa14c126bf58cc1a9e396fe7771965 0x8edf3f9d997357a0e2c916ee090392c3a645ebac4f6cd8f826d3ecc0173b33bf06b7c14e8002fc9a5d01af9824a5cb3778472cd477e0ab378091448bca6f0417 0x47b15c5039dcb2850b59bea323db662cc597dd7d48fe6b8dbb6cd8704c45854bf0e92fa267c844ba1a700105e157c8099d55c82316cb5e50c56a5d0920ff91c2 0xd5225476d7849b362226952ffc561bab99832f3f8b99741f6d81bbeaffa8e7f6e54a85e5029a3b510707eaa9684df496e4b1268075ad0328693a30bf1b1e0033 0xd9fa78b5b958bea1929080b8ad96dc555d34b051a27aebf711eb1186b807b0448316d994606ac807121838d6c41a58f308bc6307acdf69491fa4b17282f3e66f 0xcc64af75ec2e2741fb9af9f6191cb9ee187d6d26af4d1e96d7bab47e6ec09be12d3192030dc4bbf54d1da319a7a2acfc7a9dd4c644af6646a4aaa02b1024bbab 0xb5943b6e284682ad2e011d6962d41febf86af2f5fc0c9c8f4b81358ff077f9c96ba0880eaf93541eae94b4fa41dba66dab7fb0201cc9af7c75681e5719b0c95f 0x0cfc9d5b5dcf702a1525f9d4ed1841e8eb8b34434cc82470dd35435f1dbdc73ffb51544b7500394eac9c7fa567868b495326075147a2d809ebbfd43273eeec91 0x0aa78894d894a15933969f5826347439e2c309f2049277a10066c9197840499498ad19ee3d1b291f932ec0890bbdafcec292c4f02a446670cd0084f997e25e2f 0x00f400e3fe40f64032485aad9240ead45a8e1fc83ec08c96db861c0eca155ac898df8673e778e3ccaae8a0f9e6af415fe40e99b0cbc88d7610e536b6041b07fb 0x604f384174c7ed3a0dc5f476569a978266a7943bd775449d1b8b27f4eb8beb99cdf095f9200a2dabb1bc5d68c3d96ea3d47f4d34499d59953669b6c8c093d578 0x4881345cbb299fa7c60ab2d16cb7fe7bf8d14675506ef6eb6037038b5b7092ea0a9e4d0b53ba3904edd99f86717d6ba81dffe44eb5b23c6fd22c91ab73c33021 0xee3d4cc17633afe7e1794fcfd728e0643325e3d130eb1daa39c0c5cb05a200b43876117a182cabdcc3795632aa529473a0c8245f9e4f6e43e54c3f1da28bcb82 0x21f338444e96af31cf44958acf5764844efbddace3b823ed761c340c59ed2685d829818c83eebe8f00f783f1048a53515845536668a9e0c059ade7579a0f4204)'
cost: 1000000
epoch: "2.4"
epoch: "3.0"
Loading

0 comments on commit 6d43fd4

Please sign in to comment.