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

NFTStorefront v1 & v2 Cadence 1.0 Refactor #89

Merged
merged 49 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
14b9020
Update go lib (#76)
poiati Dec 22, 2022
fb594cd
Advise that version is no longer recommended
franklywatson Jan 25, 2023
2adb839
Move some documentation around and clear things up
franklywatson Jan 25, 2023
10d6d16
Content moved to homepage readme
franklywatson Jan 25, 2023
be8a884
Version disclaimer
franklywatson Jan 25, 2023
f7cb300
Just a brush up to prep for some broader changes
franklywatson Jan 25, 2023
b594574
Merge pull request #80 from onflow/jp-update-structure
franklywatson Jan 25, 2023
541f161
Add Ghost listing functionality (#79)
satyamakgec Feb 13, 2023
e45f660
Add documentation related to the ghost listing (#83)
satyamakgec Apr 12, 2023
5d0c203
Update the core contracts to their latest version (#84)
satyamakgec Apr 13, 2023
0885583
update .gitignore
sisyphusSmiling Sep 25, 2023
b1cd04f
update ViewResolver for Cadence 1.0
sisyphusSmiling Sep 25, 2023
f2728f3
update FungibleToken for Cadence 1.0
sisyphusSmiling Sep 25, 2023
ffd20f2
update NonFungibleToken for Cadence 1.0
sisyphusSmiling Sep 25, 2023
d604d40
update ExampleNFT for Cadence 1.0
sisyphusSmiling Sep 25, 2023
266bccf
add MultipleNFT contract
sisyphusSmiling Sep 25, 2023
5d5759a
update NFTStorefront for Cadence 1.0
sisyphusSmiling Sep 25, 2023
4647bc0
update NFTStorefront setup txn for Cadence 1.0
sisyphusSmiling Sep 25, 2023
16712da
add updated ExampleNFT txns & scripts
sisyphusSmiling Sep 25, 2023
c6abc55
update sell_item.cdc
sisyphusSmiling Sep 26, 2023
8585f7d
update mint_nft.cdc
sisyphusSmiling Sep 26, 2023
20f7471
add FlowToken aliases to flow.json
sisyphusSmiling Sep 26, 2023
b305e85
update v1 transactions & scripts
sisyphusSmiling Sep 26, 2023
f8c446f
Merge branch 'stable-cadence' into stable-cadence-refactor
sisyphusSmiling Sep 27, 2023
9b6248c
bump ci flow-cli version
sisyphusSmiling Sep 28, 2023
ff62d07
update go modules
sisyphusSmiling Sep 28, 2023
3661083
bump flow-emulator module version
sisyphusSmiling Sep 28, 2023
2fe31b2
update flow-emulator go module version
sisyphusSmiling Sep 28, 2023
ce2b575
tidy go modules
sisyphusSmiling Sep 28, 2023
a54d9d0
update emulator import in go test
sisyphusSmiling Sep 28, 2023
7ccbb0d
first pass at v2 stable cadence updates
sisyphusSmiling Sep 28, 2023
b21dbba
add stable cadence updated MetadataViews contract
sisyphusSmiling Sep 28, 2023
8fa1057
update v2 scripts for stable cadence
sisyphusSmiling Sep 28, 2023
e1d4f00
format v1 transaction and script
sisyphusSmiling Sep 28, 2023
a82f8f2
update v2 setup transaction
sisyphusSmiling Sep 28, 2023
06ad3e2
update v2 cleanup transactions
sisyphusSmiling Sep 28, 2023
21aae8d
update buy_items transactions
sisyphusSmiling Sep 29, 2023
c2ff304
update v2 remove_item transaction
sisyphusSmiling Sep 29, 2023
54d6b65
update v2 sale transactions
sisyphusSmiling Sep 29, 2023
e98b0db
new emulator api
bluesign Sep 29, 2023
26f9d7e
Use updated flow-nft and flow-ft standards, and updated cadence 1.0. …
aishairzay Mar 15, 2024
db5860c
Make all scripts for storefrontv2 work with updated cadence 1.0.
aishairzay Mar 18, 2024
bc78654
Remove previous go testing in favor of cadence testing for storefront…
aishairzay Apr 3, 2024
731b0e4
Add flow previewnet deployment for storefrontv2.
aishairzay Apr 10, 2024
c0ed2d0
Add previewnet to readme and add storefrontv1 to previewnet.
aishairzay Apr 10, 2024
51e56b2
Add script to test borrowNFT and make borrowNFT correctly check the n…
aishairzay Apr 15, 2024
46062ad
use latest contracts and consolidate flow.json
joshuahannan Apr 26, 2024
97e3cfa
update provider capabilities
joshuahannan May 1, 2024
aa171af
address PR comments, update Cadence version, and add go contracts pac…
joshuahannan May 21, 2024
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
47 changes: 20 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,32 @@ jobs:
name: NFTStorefront V2 Integration Tests
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.16"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 15.0.0
cache: 'npm'
cache-dependency-path: lib/js/test/package-lock.json
submodules: "true"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v0.33.1-sc-m5
- name: Flow cli Version
run: flow version
- name: Update PATH
run: echo "/root/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: cd lib/js/test && npm ci
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/feature/stable-cadence/install.sh)"
- name: Run tests
run: cd lib/js/test && npm run test
V1-Integration-Tests:
run: flow test -f ./flow.testing.json --cover --covercode="contracts/NFTStorefrontV2.cdc" ./test/NFTStorefrontV2_test.cdc
V2-Integration-Tests:
name: NFTStorefront V1 Integration Tests
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: make ci
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/feature/stable-cadence/install.sh)"
- name: Run tests
run: flow test -f ./flow.testing.json --cover --covercode="contracts/NFTStorefront.cdc" ./test/NFTStorefrontV1_test.cdc

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
lib/js/test/node_modules/*
lib/js/test/node_modules/*
.idea
coverage.json
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
.PHONY: test
test:
$(MAKE) test -C lib/go

.PHONY: ci
ci:
$(MAKE) ci -C lib/go

.PHONY: update-mainnet
update-mainnet:
$(MAKE) flow accounts update-contract NFTStorefrontV2 ./contracts/NFTStorefrontV2.cdc --signer mainnet-account --network mainnet -f ./flow.mainnet.json
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# NFT Storefront
# NFT Storefront Contract Standard

The NFT storefront is a general-purpose Cadence
contract for trading NFTs on Flow.
The NFT Storefront contract standard is a cornerstone of the Open Marketplace ecosystem on Flow. An open market ecosystem promotes the
free flow of NFT listings across the network, emitted as events and consumed by other marketplaces (or any other consumer). Marketplaces may filter
listings consumed based on commission rates they may receive. Listings may be created with variable commission, royalties or other fractional revenue, paying to multiple accounts. NFT listings are not NFTs, they are Resources which can be transacted with using the `purchase` [function](https://github.com/onflow/nft-storefront/blob/jp-update-structure/contracts/NFTStorefrontV2.cdc#L300) to obtain the token indicated by the listing.

`NFTStorefront` uses modern Cadence [run-time type](https://docs.onflow.org/cadence/language/run-time-types/)
facilities to implement a marketplace that can take any currency in order to vend any token in a safe and secure way.
This means that only one instance of the contract is needed (see below for its address on Testnet and Mainnet),
and its resources, transactions, and scripts can be used by any account to create any marketplace.
The NFTStorefront contract lets you create a non-custodial NFT marketplace to simplify integration with off-chain applications/UIs. The contract supports sellers who want to list and manage NFTs for sale simultaneously across any number of marketplaces. Listing expiry, orphaned and ghost listing cleanup are also of value for integrators to minimize overheads and ensure the best UX.

> **_NOTE:_** New version of NFTStorefront,i.e. `NFTStorefrontV2` contract has been developed and deployed on testnet. Whoever wants to build upon NFTStorefront, it is recommended to use latest version of it,i.e `NFTStorefrontV2` and enjoy its latest offerings.
Marketplaces and sellers also benefit from the robust security guarantees of Flow's account model when trading NFTs. Through this standard a NFT trade takes place from peer-to-peer, directly from the Storefront Resource in the sellers account to the purchasers account. At the same time, the standard ensures that marketplaces or other recipients may receive royalties, fees or commissions with no risk to the seller.

Sellers or marketplaces can optionally configure their NFTStorefront to be limited or closed. However, those wishing to participate in the Open Marketplace ecosystem on Flow are required to use the NFTStorefront standard.

Detailed docs: [docs/documentation.md](docs/documentation.md)

## Contract Addresses

|Name|Testnet|Mainnet|
|----|-------|-------|
|[NFTStorefront](contracts/NFTStorefront.cdc)|[0x94b06cfca1d8a476](https://flow-view-source.com/testnet/account/0x94b06cfca1d8a476/contract/NFTStorefront)|[0x4eb8a10cb9f87357](https://flowscan.org/contract/A.4eb8a10cb9f87357.NFTStorefront)|
|[NFTStorefrontV2](contracts/NFTStorefrontV2.cdc)|[0x2d55b98eb200daef](https://flow-view-source.com/testnet/account/0x2d55b98eb200daef/contract/NFTStorefrontV2)|[0x4eb8a10cb9f87357](https://flowscan.org/contract/A.4eb8a10cb9f87357.NFTStorefrontV2)|
|Name|Testnet|Previewnet|Mainnet|
|----|-------|------|-------|
|[NFTStorefront](contracts/NFTStorefront.cdc)|[0x94b06cfca1d8a476](https://flow-view-source.com/testnet/account/0x94b06cfca1d8a476/contract/NFTStorefront)|[0x6df5e52755433994](contracts/NFTStorefront.cdc)|[0x4eb8a10cb9f87357](https://flowscan.org/contract/A.4eb8a10cb9f87357.NFTStorefront)|
|[NFTStorefrontV2 (recommended)](contracts/NFTStorefrontV2.cdc)|[0x2d55b98eb200daef](https://flow-view-source.com/testnet/account/0x2d55b98eb200daef/contract/NFTStorefrontV2)|[0x6df5e52755433994](contracts/NFTStorefrontV2.cdc)|[0x4eb8a10cb9f87357](https://flowscan.org/contract/A.4eb8a10cb9f87357.NFTStorefrontV2)|

## Usage

Expand Down
Loading