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

feat: burn contracts #14

Merged
merged 30 commits into from Jan 25, 2022
Merged

feat: burn contracts #14

merged 30 commits into from Jan 25, 2022

Conversation

pradel
Copy link
Contributor

@pradel pradel commented Nov 21, 2021

The contracts will be made of 2 public functions:

  • claim: Mint 71 NFTs and send them to the contract owner wallet. In order to mint the remaining 497 Explorers, we will need to call this function 7 times.
  • burn: Mint 7000 NFTs and keep them in the contract wallet, they should be non-transferable. We will need to call this function 14 times as 500 are burned per transaction.\
➜  contracts git:(feature/museum-contract) clarinet test tests/the-explorer-guild-museum --costs

Running file:///Users/leo/dev/github/sigle/the-explorer-guild/contracts/tests/the-explorer-guild-museum/burn.test.ts
Running file:///Users/leo/dev/github/sigle/the-explorer-guild/contracts/tests/the-explorer-guild-museum/mint.test.ts
* [burn] Should throw error if non contract owner try to burn ... ok (28ms)
* [mint] Should throw error if non contract owner try to mint ... ok (47ms)
* [burn] Should mint 500 NFTs to the contract wallet ... ok (3653ms)
* [mint] Should throw error if minting more than 493 NFTs ... ok (7615ms)
* [mint] Should mint 71 NFTs to the deployer wallet ... ok (696ms)

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (10465ms)


Contract calls cost synthesis
+-----------------------------------+-----------------+------------+---------------------+-------------+----------------------+--------------+
|                                   | Runtime (units) | Read Count | Read Length (bytes) | Write Count | Write Length (bytes) | Tx per Block |
+-----------------------------------+-----------------+------------+---------------------+-------------+----------------------+--------------+
| the-explorer-guild-museum::burn   |   12052 (0.00%) |  6 (0.08%) |       10208 (0.01%) |           0 |                    0 |         1291 |
+-----------------------------------+-----------------+------------+---------------------+-------------+----------------------+--------------+
| the-explorer-guild-museum::mint   |    6489 (0.00%) |  4 (0.05%) |        5198 (0.01%) |           0 |                    0 |         1937 |
+-----------------------------------+-----------------+------------+---------------------+-------------+----------------------+--------------+
|                                                                                                                                            |
+-----------------------------------+-----------------+------------+---------------------+-------------+----------------------+--------------+
| Mainnet Block Limits (Stacks 2.0) |      5000000000 |       7750 |           100000000 |        7750 |             15000000 |            / |
+-----------------------------------+-----------------+------------+---------------------+-------------+----------------------+--------------+

block = chain.mineBlock([
Tx.contractCall(
"the-explorer-guild-mint",
"claim",
"claim-ten",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to optimise this test, looks like the new version of clarity is failing to run it and becomes responsive after some time.

@pradel pradel changed the title feat: burn museum contracts feat: burn contracts Jan 24, 2022
@pradel pradel marked this pull request as ready for review January 24, 2022 17:26
@pradel pradel merged commit abd12bc into main Jan 25, 2022
@pradel pradel deleted the feature/museum-contract branch January 25, 2022 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants