Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
7771fe6
Add files required for npm packaging
nrutledge May 19, 2022
b435243
Update index.js and readme for npm packaging
nrutledge May 19, 2022
e9376f5
Fix marketplaceValidator json
nrutledge May 23, 2022
abe51ac
Upgrade CTL and fix errors
nrutledge May 23, 2022
dbea8a7
Bump CTL version and add getWallatBalance function
nrutledge May 27, 2022
cabfbf9
Fix non-json issues
samuelWilliams99 May 30, 2022
6e25b4e
Fix remaining build issues
samuelWilliams99 May 30, 2022
118e56b
Apply formatting
samuelWilliams99 May 30, 2022
2e4c5d3
Resolve misc. errors
nrutledge Jun 2, 2022
af82a87
Bump CTL version
nrutledge Jun 2, 2022
a77f69c
Add jssha dependency
nrutledge Jun 2, 2022
af4ebe4
Switch to client side hashing for Hashable ByteArray
nrutledge Jun 3, 2022
fc70a5f
Fix wrong token name used for minting NFT
nrutledge Jun 7, 2022
aca332c
Bump CTL version for fee fixes
nrutledge Jun 7, 2022
b760e46
Add fd to nix develop (require for seabug build)
Jun 23, 2022
027d871
Fix warning
Jun 27, 2022
f6b1831
Fix logLevel configuration.
Jun 27, 2022
185659c
Auto-formatting change
rynoV Jun 28, 2022
3bc3a83
Copy over seabug-specific metadata code from CTL
rynoV Jun 28, 2022
5204466
Copy seabug metadata tests from CTL
rynoV Jun 29, 2022
4f7f191
Initial work on adding purchase metadata
rynoV Jun 29, 2022
b9d2874
Use patched CTL to fix build
rynoV Jun 30, 2022
a9b19bf
Move metadata-adding to its own function
rynoV Jun 30, 2022
823da38
Merge pull request #6 from mlabs-haskell/aleksandr/fd-to-nix-develop
ryukzak Jul 1, 2022
3431f7c
Add logging for policy, unapllied policy and policy args.
Jun 29, 2022
3771b24
Update hardcoded minting policy and bump CTL version
Jul 1, 2022
409be24
Update policyId to use collectionNftCs
rynoV Jul 1, 2022
3c0714d
Update policyId creation to use CTL built-in function
rynoV Jul 1, 2022
cf6e1f1
Merge remote-tracking branch 'origin/calum/move-metadata-code' into a…
Jul 1, 2022
6e1298e
Use liftContractM instead of liftedM
rynoV Jul 1, 2022
d5b0d1e
Update CTL version
Jul 3, 2022
ae43148
Add more trace code for debugging purpose.
Jul 3, 2022
37aa71b
Use batched datum fetching
rynoV Jul 4, 2022
46b6ff2
Parallelize metadata fetching from blockfrost
rynoV Jul 4, 2022
3a18d29
Remove unnecessary json parsing and refactor blockfrost errors
rynoV Jul 6, 2022
dabfb1b
Implement basic blockfrost rate limit handling
rynoV Jul 6, 2022
c518832
Auto-formatting changes
rynoV Jul 6, 2022
b09d350
Tidying up
rynoV Jul 6, 2022
0dcae77
Merge pull request #7 from mlabs-haskell/calum/move-metadata-code
rynoV Jul 6, 2022
e986be5
Merge remote-tracking branch 'origin/neil/typescript-api' into calum/…
rynoV Jul 6, 2022
d2018a4
Merge remote-tracking branch 'origin/neil/typescript-api' into calum/…
rynoV Jul 6, 2022
969e65a
Auto-formatting change
rynoV Jul 6, 2022
c5fb3aa
Small refactor
rynoV Jul 6, 2022
8b69d29
Bump CTL version (2.0.0-alpha + patches).
Jul 5, 2022
a6865a1
Merge remote-tracking branch 'origin/neil/typescript-api' into aleksa…
Jul 7, 2022
6efa09b
Fix formatting.
Jul 7, 2022
96adb20
Clean up.
Jul 7, 2022
3dcb6c6
Fix CI building process (dependencies and warnings)
Jul 7, 2022
05485b7
Replace utxoEntrySizeWithoutVal by own constant (minAdaOnlyUTxOValue).
Jul 8, 2022
3de16d6
Merge pull request #18 from mlabs-haskell/aleksandr/fix-minting-policy
samuelWilliams99 Jul 8, 2022
a6e5a40
Merge branch 'neil/typescript-api' into calum/optimize-list-nft
rynoV Jul 8, 2022
35cc0da
Merge branch 'neil/typescript-api' of https://github.com/mlabs-haskel…
rynoV Jul 8, 2022
4892ef2
Fix build following CTL update
rynoV Jul 8, 2022
af51048
Update CTL version to calum/metadata-invalid-char-fix HEAD
rynoV Jul 8, 2022
d210a62
Use Contract.Value.CurrencySymbol in SeabugMetadata
rynoV Jul 8, 2022
9b65c0a
Remove other usage of Cardano.Types.Value.CurrencySymbol
rynoV Jul 8, 2022
ed2d42d
Fetch NFT initial implementation
rynoV Jul 9, 2022
705feb1
Merge pull request #12 from mlabs-haskell/calum/optimize-list-nft
samuelWilliams99 Jul 11, 2022
57977a3
Merge branch 'neil/typescript-api' of https://github.com/mlabs-haskel…
rynoV Jul 11, 2022
437458b
Remove fakeAuthor field
rynoV Jul 12, 2022
29f2e09
Testing out cnft minting policy
rynoV Jul 14, 2022
8dca3ba
Initial port of "mintWithCollection" and locking script
rynoV Jul 14, 2022
267165e
Merge branch 'calum/purchase-metadata' into calum/minting-contract
rynoV Jul 14, 2022
9cae4e9
Add metadata to NFT mint
rynoV Jul 14, 2022
e05ce49
Merge branch 'neil/typescript-api' of https://github.com/mlabs-haskel…
rynoV Jul 14, 2022
e7220bd
Merge branch 'calum/purchase-metadata' of https://github.com/mlabs-ha…
rynoV Jul 14, 2022
434002a
Initial work on CNFT mint contract
rynoV Jul 15, 2022
38661fa
Finish cnft mint contract and update seabug metadata policy id
rynoV Jul 15, 2022
67b7b8b
Clean up minting policy
rynoV Jul 15, 2022
25a0735
Fix up blockfrost metadata parsing for cnfts
rynoV Jul 15, 2022
9d9872f
Fix up locking script
rynoV Jul 15, 2022
5bdee3f
Initial minting invocation code
rynoV Jul 15, 2022
2927f6b
flake.lock update
rynoV Jul 15, 2022
0a87700
Update CTL for awaitTxConfirmed and fully automate minting
rynoV Jul 18, 2022
101d098
Move `setSeabugMetadata` to a better spot
rynoV Jul 20, 2022
cda8882
Only fetch and show NFTs that are known to work
rynoV Jul 20, 2022
a33375d
Add minting process description
rynoV Jul 20, 2022
4071818
Fix key wallet setup description
rynoV Jul 20, 2022
0fb7214
Update nft filter
rynoV Jul 20, 2022
d34140c
Remove unnecessary cnft testing function
rynoV Jul 21, 2022
bba5da5
Minor doc and names updates
rynoV Jul 21, 2022
c8721f8
Use min ada constant instead of heuristic value for nft filter
rynoV Jul 21, 2022
cc0b419
Unused import
rynoV Jul 21, 2022
ca4c703
Remove old TODO comment
rynoV Jul 21, 2022
5aecc5a
Update minting to use a base address (#29)
rynoV Jul 22, 2022
e8153c5
Update cnft mint policy to use minor refactor
rynoV Jul 22, 2022
1ac993d
Don't use "ref" for CTL flake input
rynoV Jul 22, 2022
ecfa183
Fix nix build
rynoV Jul 22, 2022
6476154
Return the NFT to the frontend and fix typescript api for input
rynoV Jul 22, 2022
85b3755
Make fetchNft return null for spent txos
rynoV Jul 23, 2022
bfcf8a6
Documentation updates
rynoV Jul 23, 2022
8798232
Merge pull request #20 from mlabs-haskell/calum/fetch-single-nft
samuelWilliams99 Jul 25, 2022
f4a4930
Merge remote-tracking branch 'origin/neil/typescript-api' into calum/…
rynoV Jul 25, 2022
6e70895
Merge pull request #22 from mlabs-haskell/calum/minting-contract
rynoV Jul 25, 2022
fd8e4ed
Improve seabug metadata parsing errors
rynoV Jul 26, 2022
314661f
Update mintPolicy type and parse it from metadata
rynoV Jul 26, 2022
9a49c40
Replace `liftedM ... pure` usage with `liftContractM`
rynoV Jul 26, 2022
12fc59b
Remove/update old comments, logs, and functions
rynoV Jul 26, 2022
196a2d4
Note discrepancy in share range
rynoV Jul 26, 2022
3ef2a2c
Fix metadata decoding to include the policyId
rynoV Jul 26, 2022
c31def6
Extract maximum share value to constant
rynoV Jul 26, 2022
959b815
Fix min ada constant to align with onchain
rynoV Jul 27, 2022
753ac07
Make mintPolicy "V1"
rynoV Jul 27, 2022
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
15 changes: 15 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.github
.psc-ide-port
.spago
.spago2nix
dist
exe
flake.lock
Makefile
node_modules
output
src
test
*purs
*.nix
*.dhall
Binary file added .output.js.swm
Binary file not shown.
Binary file added .output.js.swn
Binary file not shown.
Binary file added .output.js.swo
Binary file not shown.
Binary file added .output.js.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c

ps-sources := $(shell fd -epurs)
ps-entrypoint := Main
ps-entrypoint := Seabug
ps-bundle = spago bundle-module -m ${ps-entrypoint} --to output.js

run-dev:
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# seabug-contracts

TODO
A library for interacting with Seabug smart contracts via the Cardano Transaction Lib (CTL).

## Tests

Use `spago test` to run the tests. Something like `nix build .#checks.<system>.seabug-contracts` can also be used, where `<system>` is something like `x86_64-linux`.

## Minting

The minting process currently requires some manual steps. To mint a new NFT:

- Upload a new image to nft.storage (e.g. using `seabug/scripts/mint-nft.sh`)
- Uncomment [this line](https://github.com/mlabs-haskell/seabug-contracts/blob/cda88824f87e0b961b738c66a428b7ade77454be/index.js#L39)
- Update the image info [here](https://github.com/mlabs-haskell/seabug-contracts/blob/cda88824f87e0b961b738c66a428b7ade77454be/src/Seabug/Seabug.purs#L34)
- Make sure you're using the base36 encoded CID (`mint-nft.sh` prints this out)
- Run `make run-dev` and open the link from the console in chrome; this will trigger the minting
- If Nami/Gero are giving you trouble, this snippet can be used to use a key wallet instead:
```
privateKey <- liftM (error "Failed to parse private key") $
privateKeyFromBytes
=<< hexToRawBytes "<secret key>"
privateStakeKey <- liftM (error "Failed to parse private stake key")
$ privateKeyFromBytes
=<< hexToRawBytes "<secret stake key>"
let wallet = Just $ mkKeyWallet (wrap privateKey) (Just $ wrap privateStakeKey)
```
- The secret key can be obtained through e.g. `seabug/scripts/prepare-wallet.sh` (make sure to add ada to that wallet)
- Note you may have to remove the "5820" from the start of the "cborHex" in the skey file
- The stake key will also be necessary for minting, the command `cardano-cli stake-address key-gen --signing-key-file stake.skey --verification-key-file stake.vkey` can be used to get a stake key
- Add the wallet that you minted with as an artist to the
`nft-marketplace-server` database with `admin/create_artist`
4 changes: 2 additions & 2 deletions exe/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module Main (main) where
import Contract.Prelude

import Contract.Address (ownPaymentPubKeyHash)
import Contract.Monad (defaultContractConfig, runContract_)
import Contract.Monad (defaultTestnetContractConfig, runContract_)
import Effect.Aff (launchAff_)

main :: Effect Unit
main = launchAff_ $ do
cfg <- defaultContractConfig
cfg <- defaultTestnetContractConfig
runContract_ cfg
$ log
<<< show
Expand Down
Loading