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

[WIP] MetaLamp/nft marketplace/development #63

Open
wants to merge 262 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
429ca03
add simulation test case
stanislav-az Jul 22, 2021
93b88a6
add existing nft check
stanislav-az Jul 22, 2021
28f8c70
add todos
stanislav-az Jul 26, 2021
ef922d6
add sale state machine
stanislav-az Jul 27, 2021
62ff6d8
add sale contract endpoints
stanislav-az Jul 28, 2021
e9f1dca
fix sale state machine
stanislav-az Jul 28, 2021
69ead39
add open sale endpoint
stanislav-az Jul 29, 2021
97d212b
add buy and close sale endpoints
stanislav-az Jul 29, 2021
a314c9a
add simulation for buying nft
stanislav-az Jul 29, 2021
970f0d2
add close sale simulation
stanislav-az Jul 30, 2021
a47b08f
cp auction contract
stanislav-az Jul 31, 2021
b77061b
add hold auction endpoint
stanislav-az Jul 31, 2021
9f7a1fe
add auction buyer endpoints
stanislav-az Jul 31, 2021
65049fc
add auction simulation
stanislav-az Aug 1, 2021
261b1e1
add endpoints description
stanislav-az Aug 1, 2021
bb2b92d
mv models to a module
stanislav-az Aug 1, 2021
b8a67e2
use sale model
stanislav-az Aug 1, 2021
2424fe7
add categories
stanislav-az Aug 1, 2021
f0d6a98
remodel domain with bundles
stanislav-az Aug 3, 2021
8fca248
refactor nft state machine
stanislav-az Aug 3, 2021
63bdb6d
fix singletons endpoints call
stanislav-az Aug 6, 2021
b8f512b
calculate bundle id
stanislav-az Aug 6, 2021
bf0ddf5
add bundle state changes
stanislav-az Aug 9, 2021
0e26e2e
Merge pull request #64 from input-output-hk/Metalamp/nft-marketplace/…
performanceArtist Aug 9, 2021
a717f9b
rename bid on auction params prefix
stanislav-az Aug 9, 2021
b2b1cb1
Merge remote-tracking branch 'origin/MetaLamp/nft-marketplace/develop…
stanislav-az Aug 9, 2021
5cfc13f
add todo
stanislav-az Aug 9, 2021
55a67a8
Merge pull request #65 from input-output-hk/Metalamp/nft-marketplace/…
performanceArtist Aug 9, 2021
0364b29
add constraints for bundle endpoints
stanislav-az Aug 9, 2021
42d7e43
add bundle endpoints
stanislav-az Aug 9, 2021
629c82a
fix traceError call bug
stanislav-az Aug 10, 2021
c590ffa
add bundle simulation
stanislav-az Aug 10, 2021
d867600
add bundle lot state transition
stanislav-az Aug 10, 2021
9de86b8
add singleton existing lot check
stanislav-az Aug 10, 2021
af31d2f
add bundle lot state validation
stanislav-az Aug 10, 2021
ebe9a6d
Merge remote-tracking branch 'origin/MetaLamp/nft-marketplace/develop…
stanislav-az Aug 11, 2021
5b47857
add id modules
stanislav-az Aug 11, 2021
ee20892
add bundles to lot endpoints
stanislav-az Aug 13, 2021
98a529b
add test suite
stanislav-az Aug 14, 2021
2846c54
add test for start
stanislav-az Aug 14, 2021
a83cfd9
add marketplace value check
stanislav-az Aug 16, 2021
5cad6b8
add create nft test
stanislav-az Aug 17, 2021
0b24085
add reveal issuer tests
stanislav-az Aug 17, 2021
6c78825
add bundle up test
stanislav-az Aug 17, 2021
57715ae
add bundle up fail test
stanislav-az Aug 17, 2021
624ee99
add unbundle tests
stanislav-az Aug 17, 2021
88b876c
add nft sale tests
stanislav-az Aug 18, 2021
cd2ce4c
add sale bundle tests
stanislav-az Aug 18, 2021
43b95ac
add nft auction tests
stanislav-az Aug 18, 2021
316e9db
add bundle auction tests
stanislav-az Aug 18, 2021
c0a9314
rm unused code
stanislav-az Aug 18, 2021
e6481e8
fix ide hints
stanislav-az Aug 18, 2021
caa9682
add cabal apps interacting with client
stanislav-az Aug 19, 2021
2cca670
wip add client
stanislav-az Aug 20, 2021
8831032
add wallet selector
stanislav-az Aug 23, 2021
00974a2
add wallet selector to main
stanislav-az Aug 26, 2021
ff5c9ee
rename wallet selector
stanislav-az Aug 26, 2021
7b4e4f5
add routing infrastructure
stanislav-az Aug 26, 2021
a6e7207
add routing
stanislav-az Aug 26, 2021
8c1310d
add pab contracts initialization
stanislav-az Aug 27, 2021
14d870e
rename navigate query
stanislav-az Aug 27, 2021
0a67c81
add ipfs capability
stanislav-az Aug 30, 2021
740b21d
wip add ipfs impl
stanislav-az Aug 30, 2021
da890fd
add pin ipfs iml
stanislav-az Aug 31, 2021
57ec23c
update plutus for backend
stanislav-az Sep 2, 2021
2c17fa9
wip fix update backend conflicts
stanislav-az Sep 2, 2021
43d7bff
fix lib errors
stanislav-az Sep 3, 2021
489f2ab
add cabal common options
stanislav-az Sep 3, 2021
3d89b68
fix purs generation
stanislav-az Sep 3, 2021
1b0653a
fix tests
stanislav-az Sep 3, 2021
8fe5a3b
wip fix client
stanislav-az Sep 3, 2021
d2ec4d3
fix client
stanislav-az Sep 4, 2021
17b46f5
fix pab api call
stanislav-az Sep 4, 2021
16078b4
add cors middleware to pab
stanislav-az Sep 4, 2021
ab0df98
run fmt
stanislav-az Sep 4, 2021
1916879
add servant-options to nix
stanislav-az Sep 4, 2021
811c634
add instance state to user page
stanislav-az Sep 7, 2021
0ec51e5
wip add create nft element
stanislav-az Sep 7, 2021
93d5e10
add bytestring serialization
stanislav-az Sep 8, 2021
748697f
add create nft form
stanislav-az Sep 8, 2021
fbaa92f
mv file upload to create nft form
stanislav-az Sep 8, 2021
a5e0a32
rm start chrome script
stanislav-az Sep 8, 2021
010e1c3
add reveal issuer checkbox
stanislav-az Sep 8, 2021
8ee1b94
add funds and marketplace user state
stanislav-az Sep 8, 2021
db636db
add spec document
Sep 9, 2021
821d1c7
add wallet nft singletons display
stanislav-az Sep 9, 2021
a48ab5f
add Implementation features
Sep 10, 2021
7095b3f
fix grammar
Sep 10, 2021
2316262
clarify cId abbreviation
Sep 10, 2021
48145af
add encoding todo
stanislav-az Sep 10, 2021
a607e6d
Merge pull request #69 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Sep 10, 2021
cf3786e
Merge pull request #70 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Sep 10, 2021
2d29c0b
Merge pull request #73 from input-output-hk/Metalamp/nft-marketplace/…
stanislav-az Sep 10, 2021
df5a477
Merge remote-tracking branch 'origin/MetaLamp/nft-marketplace/develop…
Sep 13, 2021
9f64287
add ipfs configuration steps to README
Sep 13, 2021
70f2e81
mv submit button
stanislav-az Sep 13, 2021
41f3f48
add bytestring decoder
stanislav-az Sep 13, 2021
772ae2e
Merge pull request #74 from input-output-hk/Metalamp/nft-marketplace/…
stanislav-az Sep 13, 2021
2ce9ad3
render nft singletons
stanislav-az Sep 13, 2021
7319182
add put on sale form
stanislav-az Sep 14, 2021
c98ba68
add market page state
stanislav-az Sep 14, 2021
f9fc401
add market singletons rendering
stanislav-az Sep 14, 2021
e3d1356
add close sale and buy nft
stanislav-az Sep 14, 2021
208b9f3
add start an auction form
stanislav-az Sep 14, 2021
b833036
fix posix time serialization bug
stanislav-az Sep 14, 2021
21b0b41
wip render auction
stanislav-az Sep 14, 2021
ebfdb25
change favicon
stanislav-az Sep 15, 2021
f3c5813
add nft border
stanislav-az Sep 15, 2021
ec4fba2
add time formatting
stanislav-az Sep 17, 2021
810e238
add complete auction button
stanislav-az Sep 17, 2021
26f8744
add bid on auction form
stanislav-az Sep 17, 2021
8577c42
add findNftBundles
stanislav-az Sep 17, 2021
26183a9
add user bundles rendering
stanislav-az Sep 20, 2021
4d4c675
add create bundle form
stanislav-az Sep 20, 2021
c266ff5
add bundle sale options
stanislav-az Sep 20, 2021
7aebfcd
add unbundle action
stanislav-az Sep 20, 2021
f45f529
add bundle lot render
stanislav-az Sep 20, 2021
8320017
add bundles to market page
stanislav-az Sep 20, 2021
5fc2a55
rename forms actions
stanislav-az Sep 21, 2021
e22072b
Merge pull request #77 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Sep 21, 2021
a60f3ae
mv auction todo to task
stanislav-az Sep 21, 2021
7baf003
rm tags todo
stanislav-az Sep 21, 2021
e13c4e6
add fee param on marketplace start
Sep 22, 2021
ea709eb
rm thread token value validation
stanislav-az Sep 22, 2021
7732198
add sale owner to marketplace state
stanislav-az Sep 22, 2021
cfb26b9
check sale owner on client
stanislav-az Sep 22, 2021
6e59acf
rm not required todos
stanislav-az Sep 22, 2021
d1f8c15
get fee on buy NFT
Sep 22, 2021
79ee9cb
Merge pull request #79 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Sep 23, 2021
d1403b3
Merge branch 'MetaLamp/nft-marketplace/development' into MetaLamp/nft…
Sep 23, 2021
d0ed494
operator fee on finish auction
Sep 24, 2021
89fba72
aff fix fee on minting and bundling
Sep 24, 2021
58ad9ad
make fmt
Sep 24, 2021
639ccde
move Marketplace to onChain directory
Sep 24, 2021
8885a26
add remote data and contract resp
stanislav-az Sep 24, 2021
700be3f
add tests for marketplace operator fee
Sep 24, 2021
ba75869
add monoid for remote data
stanislav-az Sep 25, 2021
9b47d3c
add contract resp monoid instance
stanislav-az Sep 25, 2021
5ece671
wip use contract resp
stanislav-az Sep 25, 2021
e546b8b
Clarify readme, remove todo
Sep 28, 2021
c9cb8f5
fix tests
stanislav-az Sep 30, 2021
dca4551
fix simulation
stanislav-az Sep 30, 2021
380ea5d
use contract resp in client
stanislav-az Sep 30, 2021
54e0900
remove Ratio from Percentage file, fix client
Sep 30, 2021
6f10cb1
Merge pull request #84 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Oct 4, 2021
9b76bd1
Merge branch 'MetaLamp/nft-marketplace/development' into MetaLamp/nft…
Oct 5, 2021
f2c73ff
make auction work with fee and without it
olgaklimenko Oct 6, 2021
2854261
make sale work with fee and without it
Oct 7, 2021
91832cf
fix client & make fmt
Oct 7, 2021
5dde35b
fix mkPercentage
Oct 7, 2021
a5377cb
add tests for mkPercentage
Oct 7, 2021
cc13fba
check selller's profit in tests
Oct 8, 2021
ab21b96
refactor auction
Oct 8, 2021
bad6356
Add generation script
performanceArtist Oct 7, 2021
0a85d60
bump to plutus-pab/v0.0.2
Oct 11, 2021
250e02a
Merge pull request #87 from input-output-hk/MetaLamp/nft-marketplace/…
olgaklimenko Oct 11, 2021
5a7b3bb
remove unused Percentage types
Oct 11, 2021
b5b6385
Add AssocMap instance
performanceArtist Oct 12, 2021
6c6fb55
Merge pull request #88 from input-output-hk/MetaLamp/nft-marketplace/…
olgaklimenko Oct 13, 2021
a060e9f
fix code after update
Oct 13, 2021
d20ed73
make fmt
Oct 13, 2021
c5cb0d5
add todo about DiffMilliSeconds
Oct 13, 2021
27ed98a
Merge branch 'Metalamp/nft-marketplace/update-plutus' into Metalamp/n…
Oct 13, 2021
d2737be
make fmt
Oct 13, 2021
0e8823f
fix spec and remove comment
Oct 14, 2021
88b9ac1
Merge pull request #82 from input-output-hk/MetaLamp/nft-marketplace/…
olgaklimenko Oct 14, 2021
c646401
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Oct 14, 2021
d08876c
add new marketplace types to typescript generator
Oct 15, 2021
c167f8f
make fmt
Oct 15, 2021
6ce64fc
Merge pull request #90 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Oct 15, 2021
f9c3d19
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Oct 15, 2021
e87c3cd
fix generate-typescript types
Oct 15, 2021
0c2c61a
LotLink refactoring
Oct 15, 2021
65b990f
PutLotRedeemer and RemoveLotRedeemer refactoring
Oct 15, 2021
b6aca3d
make fmt
Oct 15, 2021
0b170d3
Remote ContractResponse, use RemoteData
performanceArtist Oct 18, 2021
3a39a63
add prisms for LotLink
Oct 19, 2021
2964f6b
Merge pull request #97 from input-output-hk/MetaLamp/nft-marketplace/…
olgaklimenko Oct 19, 2021
25f7ad6
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Oct 19, 2021
5740369
Merge pull request #94 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Oct 19, 2021
f749002
change begging of time
Oct 20, 2021
1529edd
make fmt
Oct 20, 2021
25e1b66
add initial price
Oct 20, 2021
373c973
Add Controller
performanceArtist Oct 20, 2021
c50c57f
Add expiration error to bid endpoint
performanceArtist Oct 21, 2021
9f7642c
Add ContractState and ContractResponse types
performanceArtist Oct 22, 2021
87e96cf
Merge pull request #101 from input-output-hk/MetaLamp/nft-marketplace…
performanceArtist Oct 22, 2021
2128156
fix client, handle failed bid in endpoint
Oct 25, 2021
71a408b
throwError when bid is lt initial or previous bid
Oct 26, 2021
382e159
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Oct 27, 2021
95b226b
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Oct 27, 2021
41d8796
change duration to end time
Oct 27, 2021
5849f3e
add marketplace settings endpoint
Oct 27, 2021
17c4ccc
add failed bid on auction to the simulation
Oct 27, 2021
25801ee
make fmt
Oct 27, 2021
3dac598
make fmt
Oct 27, 2021
848ea0b
Merge pull request #99 from input-output-hk/Metalamp/nft-marketplace/…
olgaklimenko Oct 27, 2021
62e03ea
Merge pull request #106 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Oct 27, 2021
9c5ede5
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Oct 28, 2021
2690d1c
fix posix time in simulation
Oct 28, 2021
4717917
Merge pull request #105 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Oct 28, 2021
36a2e57
add cancelAuction endpoint
Oct 28, 2021
ac94cdc
make fmt
Oct 28, 2021
a62bfb6
Merge pull request #108 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Nov 1, 2021
3844130
Add PlutusBuiltinByteString newtype
performanceArtist Nov 1, 2021
f7940f5
fix tests and ts generation
Nov 2, 2021
26c51c0
Merge pull request #110 from input-output-hk/MetaLamp/nft-marketplace…
olgaklimenko Nov 2, 2021
e4eb2d9
Merge branch 'MetaLamp/nft-marketplace/development' into MetaLamp/nft…
Nov 3, 2021
58a02e4
remove hardcoded posix time
Nov 3, 2021
bb0899d
change end time to duration in start auction params
Nov 3, 2021
9893925
fix types generators
Nov 3, 2021
3c47986
make fmt
Nov 3, 2021
baf5793
remove comments
Nov 3, 2021
100a8b6
Merge pull request #100 from input-output-hk/MetaLamp/nft-marketplace…
olgaklimenko Nov 3, 2021
0608647
generate POSIXTime as integer for ts client
Nov 9, 2021
7c6c5bb
Merge pull request #114 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Nov 9, 2021
e68ecb9
revert custom beginning of time and auction endtime
Nov 9, 2021
73780f5
refactor auction endTime calculation
Nov 10, 2021
286ee22
flesh out why use a specified beginning of time
Nov 10, 2021
3985285
Merge pull request #115 from input-output-hk/Metalamp/nft-marketplace…
stanislav-az Nov 10, 2021
b836701
update to plutus-starter-devcontainer/v1.0.14
Nov 11, 2021
49a726c
update plutus-apps to v2021-11-05
Nov 11, 2021
cd9af20
rm marketplace controller
stanislav-az Nov 11, 2021
a9f2be9
Merge pull request #116 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Nov 11, 2021
ccad4f7
update code and remove purescript client
Nov 11, 2021
54b15a7
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Nov 11, 2021
8fc6387
add devcontainer
Nov 15, 2021
be0b1af
Merge pull request #117 from input-output-hk/Metalamp/nft-marketplace…
stanislav-az Nov 15, 2021
80900ab
fix auction bugs
stanislav-az Nov 16, 2021
cf88256
initial deployment config
Nov 17, 2021
80a2167
Merge pull request #119 from input-output-hk/Metalamp/nft-marketplace…
stanislav-az Nov 17, 2021
0f0e6e9
refactor deployment files, add readme
Nov 18, 2021
8af4b72
make fmt
Nov 18, 2021
cfb6075
fix fixtures, rename pab
Nov 18, 2021
0874d7d
update deps to 7333e3c3ae
Nov 21, 2021
638ca5f
add more deployment instructions in README
Nov 21, 2021
d6420e0
remove unused deps from haskell.nix
Nov 22, 2021
e34f08c
Merge pull request #120 from input-output-hk/Metalamp/nft-marketplace…
stanislav-az Nov 22, 2021
c81c7f3
add min-ada-value on start marketplace
Nov 22, 2021
98ed5b8
update to v2021-11-22
Nov 23, 2021
83d3e2f
fix tests
Nov 23, 2021
f329784
fix Sale transitions
Nov 25, 2021
caab8f7
add explicit minAdaTxOut to transactions
Nov 25, 2021
8ef04e7
add config file for chain-index
Nov 26, 2021
8d86c74
add scripts size analyzer
Nov 30, 2021
d660726
Merge pull request #123 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Dec 1, 2021
4f54428
Merge branch 'MetaLamp/nft-marketplace/development' into Metalamp/nft…
Dec 3, 2021
8edf92d
remove script analyzer
Dec 3, 2021
6d0c3fe
make fmt
Dec 3, 2021
9207608
Merge pull request #124 from input-output-hk/Metalamp/nft-marketplace…
olgaklimenko Dec 3, 2021
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
23 changes: 23 additions & 0 deletions .devcontainer/ devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Plutus Starter Project",
"image": "docker.io/inputoutput/plutus-starter-devcontainer:v1.0.14",

"remoteUser": "plutus",

"mounts": [
// This shares cabal's remote repository state with the host. We don't mount the whole of '.cabal', because
// 1. '.cabal/config' contains absolute paths that will only make sense on the host, and
// 2. '.cabal/store' is not necessarily portable to different version of cabal etc.
"source=${localEnv:HOME}/.cabal/packages,target=/home/plutus/.cabal/packages,type=bind,consistency=cached",
],

"settings": {
// Note: don't change from bash so it runs .bashrc
"terminal.integrated.shell.linux": "/bin/bash"
},

// IDs of extensions inside container
"extensions": [
"haskell.haskell"
],
}
28 changes: 28 additions & 0 deletions MetaLamp/nft-marketplace/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
dist
dist-*
cabal-dev
*.o
*.hi
*.hie
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
.psc-ide-port
config/plutus-pab.local.yaml
config/chain-index-config.local.json
deployment/env/env.local.sh

201 changes: 201 additions & 0 deletions MetaLamp/nft-marketplace/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 2 additions & 0 deletions MetaLamp/nft-marketplace/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fmt:
fix-stylish-haskell
73 changes: 73 additions & 0 deletions MetaLamp/nft-marketplace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# NFT Marketplace

[The description and specification of a project](Spec.md)

## Setting up

- Install nix
- Clone https://github.com/input-output-hk/plutus
- Set up your machine to build things with Nix, following the Plutus README (make sure to set up the binary cache!)

## The Plutus Application Backend (PAB) usage

We have provided two PAB applications in `./pab` and `./pab-simulation`. The first one is made for real world usage and interaction through frontend [client](client/README.md), the second one is a big test scenario.
With the PAB we can serve and interact with contracts over a web API. You can read more about the PAB here: [PAB Architecture](https://github.com/input-output-hk/plutus/blob/master/plutus-pab/ARCHITECTURE.adoc).

1. Enter the nix shell (from `nft-marketplace` directory):

```
nix-shell
```

2. Build the PAB executables (cd to plutus-use-cases/MetaLamp/nft-marketplace):

```
cabal build all
```

3. Run the PAB binary:

```
cabal run pab
```

This will then start up the server on port 8080.

4. To run test simulation do:

```
cabal run pab-simulation
```

## IPFS

1. Install IPFS daemon following the [instruction](https://docs.ipfs.io/install/command-line/#official-distributions)

2. To initialize the repository using to store IPFS settings, run:

```
ipfs init
```

3. Set up the `CORS` settings:

```
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["webui://-", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io", "https://localhost:8009", "http://localhost:8009"]'
```

```
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
```

4. Run IPFS server:

```
ipfs daemon
```

## Client

See the client [readme](client/README.md).
## Protocol functionality

See the description of user endpoints [here](src/Plutus/Contracts/NftMarketplace/Endpoints.hs)
Loading