-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feature: NFT permissions (#233) * Refactor NFT permissions * Listing NFTs in orderbook creates a transfer cap (#244) * Listing NFTs in orderbook creates a transfer cap * One sentence per line * Feature: Nft df domains (#245) Nft df domains * Fixing orderbook funds recipient (#247) * Feature: Limited market (#246) LimitedFixedPriceMarket * Chore: MintCap issues (#253) NFT permissions cleanup * Free for all allowlist is now deployed by default (#254) * Orderbook endpoints which minimise txs (#255) * Endpoint to cancel ask and discard the transfer cap in a single tx (#258) * TransferAllowlistDomain (#257) * Free for all allowlist (#256) * Chore: Update devnet-0.26.0 (#261) * Publish devnet-0.26.0 * Bump dependency * Chore: Release 0.23.0 (#262) Deployed v.0.23.0 --------- Co-authored-by: Nuno Boavida <[email protected]> * Adding endpoint to edit an ask (#265) Co-authored-by: porkbrain <[email protected]> * Republish (#266) --------- Co-authored-by: porkbrain <[email protected]> Co-authored-by: Nuno Boavida <[email protected]>
- Loading branch information
1 parent
69c75fc
commit 2458d4b
Showing
50 changed files
with
2,551 additions
and
807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SUI_VERSION="devnet-0.24.0" | ||
SUI_VERSION="devnet-0.26.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
[package] | ||
name = "NftProtocol" | ||
version = "0.22.0" | ||
version = "0.23.0" | ||
|
||
[dependencies.Sui] | ||
git = "https://github.com/MystenLabs/sui.git" | ||
subdir = "crates/sui-framework" | ||
# devnet-0.24.0 | ||
rev = "f911c73bb0502ebbf34720e76daa1d698e51b9f0" | ||
# devnet-0.26.0 | ||
rev = "b63532e36df5b1fcccff3893509259494c719a78" | ||
|
||
[dependencies.Originmate] | ||
git = "https://github.com/Origin-Byte/originmate.git" | ||
# devnet-0.24.0 | ||
rev = "55d0ca3a9c2dd8d9489df3dcaef1d07755c56cf9" | ||
# devnet-0.26.0 | ||
rev = "86ff9808166af83695df9cbadd9eef44ba0f4d59" | ||
|
||
[addresses] | ||
nft_protocol = "0x481c2e6a9961a67aced2f1b9d4094d4ba2badc98" | ||
nft_protocol = "0xabea22bd189925217062c5122b087df5f5745137" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,174 +1,35 @@ | ||
- Sui v0.24.0 | ||
<a href="https://originbyte.io/"> | ||
<h1><img src="./assets/logo.svg" alt="OriginByte" width="50%"></h1> | ||
</a> | ||
|
||
Checkout our: | ||
<h3>A new approach to NFTs</h3> | ||
|
||
- Devnet contract on the [Sui Explorer](https://explorer.sui.io/object/0x481c2e6a9961a67aced2f1b9d4094d4ba2badc98?network=devnet) | ||
- [Official Documentation](https://docs.originbyte.io/origin-byte/) | ||
- [Developer Documentation](https://origin-byte.github.io/) | ||
|
||
# OriginByte | ||
|
||
A new approach to NFTs. | ||
|
||
Origin-Byte is an ecosystem of tools, standards and smart contracts designed to | ||
make life easier for Web3 Game Developers and NFT creators. From simple artwork | ||
to complex gaming assets, we want to help you reach the public, and provide | ||
on-chain market infrastructure. | ||
Origin-Byte is an ecosystem of tools, standards, and smart contracts designed to make life easier for Web3 Game Developers and NFT creators. | ||
From simple artwork to complex gaming assets, we want to help you reach the public, and provide on-chain market infrastructure. | ||
|
||
The ecosystem is partitioned into three critical components: | ||
|
||
- The NFT standard, encompassing the core `Nft`, `Collection`, and `Safe` types, | ||
controlling the lifecycle and properties of each NFT. | ||
- Primary markets, encompassing `Marketplace`, `Listing`, and numerous markets which | ||
control the initial minting of NFTs. | ||
control the initial minting and sale of NFTs. | ||
- Secondary markets, encompassing principally the `Orderbook` which allows you | ||
to trade existing NFTs. | ||
|
||
## Resources | ||
|
||
- Devnet contract on the [Sui Explorer](https://explorer.sui.io/object/0xde886c0410106e811bc4a67957fed77e456831d2?network=devnet) | ||
- [Official Documentation](https://docs.originbyte.io/origin-byte/) | ||
- [Developer Documentation](https://origin-byte.github.io/) | ||
|
||
# Install | ||
|
||
This codebase requires installation of the [Sui CLI](https://docs.sui.io/build/install). | ||
|
||
If you are running on Linux you can use [suivm](https://github.com/Origin-Byte/suivm) to handle installation for you. | ||
|
||
# Built and Test | ||
|
||
1. `$ sui move build` to build the available move modules | ||
2. `$ sui move test` to run the move tests | ||
3. `./bin/publish.sh` to publish the modules on localnet or devnet | ||
|
||
# Deploy an NFT collection | ||
|
||
To deploy an NFT collection you will need to create a SUI [Move](https://docs.sui.io/build/move) contract, which plugs into our protocol. | ||
|
||
We provide an example on how to build such collection in the examples folder. Additionally below follows an example of an NFT Collection, the SUIMARINES! | ||
|
||
```move | ||
module nft_protocol::suimarines { | ||
use std::string::{Self, String}; | ||
use sui::url; | ||
use sui::balance; | ||
use sui::transfer; | ||
use sui::tx_context::{Self, TxContext}; | ||
use nft_protocol::nft; | ||
use nft_protocol::tags; | ||
use nft_protocol::royalty; | ||
use nft_protocol::display; | ||
use nft_protocol::creators; | ||
use nft_protocol::inventory::{Self, Inventory}; | ||
use nft_protocol::royalties::{Self, TradePayment}; | ||
use nft_protocol::collection::{Self, Collection, MintCap}; | ||
/// One time witness is only instantiated in the init method | ||
struct SUIMARINES has drop {} | ||
/// Can be used for authorization of other actions post-creation. It is | ||
/// vital that this struct is not freely given to any contract, because it | ||
/// serves as an auth token. | ||
struct Witness has drop {} | ||
fun init(witness: SUIMARINES, ctx: &mut TxContext) { | ||
let (mint_cap, collection) = collection::create( | ||
&witness, ctx, | ||
); | ||
collection::add_domain( | ||
&mut collection, | ||
&mut mint_cap, | ||
creators::from_address(tx_context::sender(ctx)) | ||
); | ||
// Register custom domains | ||
display::add_collection_display_domain( | ||
&mut collection, | ||
&mut mint_cap, | ||
string::utf8(b"Suimarines"), | ||
string::utf8(b"A unique NFT collection of Suimarines on Sui"), | ||
); | ||
display::add_collection_url_domain( | ||
&mut collection, | ||
&mut mint_cap, | ||
sui::url::new_unsafe_from_bytes(b"https://originbyte.io/"), | ||
); | ||
display::add_collection_symbol_domain( | ||
&mut collection, | ||
&mut mint_cap, | ||
string::utf8(b"SUIM") | ||
); | ||
let royalty = royalty::from_address(tx_context::sender(ctx), ctx); | ||
royalty::add_proportional_royalty(&mut royalty, 100); | ||
royalty::add_royalty_domain(&mut collection, &mut mint_cap, royalty); | ||
let tags = tags::empty(ctx); | ||
tags::add_tag(&mut tags, tags::art()); | ||
tags::add_collection_tag_domain(&mut collection, &mut mint_cap, tags); | ||
transfer::transfer(mint_cap, tx_context::sender(ctx)); | ||
transfer::share_object(collection); | ||
} | ||
/// Calculates and transfers royalties to the `RoyaltyDomain` | ||
public entry fun collect_royalty<FT>( | ||
payment: &mut TradePayment<SUIMARINES, FT>, | ||
collection: &mut Collection<SUIMARINES>, | ||
ctx: &mut TxContext, | ||
) { | ||
let b = royalties::balance_mut(Witness {}, payment); | ||
let domain = royalty::royalty_domain(collection); | ||
let royalty_owed = | ||
royalty::calculate_proportional_royalty(domain, balance::value(b)); | ||
royalty::collect_royalty(collection, b, royalty_owed); | ||
royalties::transfer_remaining_to_beneficiary(Witness {}, payment, ctx); | ||
} | ||
public entry fun mint_nft( | ||
name: String, | ||
description: String, | ||
url: vector<u8>, | ||
attribute_keys: vector<String>, | ||
attribute_values: vector<String>, | ||
_mint_cap: &MintCap<SUIMARINES>, | ||
inventory: &mut Inventory, | ||
ctx: &mut TxContext, | ||
) { | ||
let nft = nft::new<SUIMARINES, Witness>( | ||
&Witness {}, tx_context::sender(ctx), ctx | ||
); | ||
display::add_display_domain( | ||
&mut nft, | ||
name, | ||
description, | ||
ctx, | ||
); | ||
display::add_url_domain( | ||
&mut nft, | ||
url::new_unsafe_from_bytes(url), | ||
ctx, | ||
); | ||
display::add_attributes_domain_from_vec( | ||
&mut nft, | ||
attribute_keys, | ||
attribute_values, | ||
ctx, | ||
); | ||
inventory::deposit_nft(inventory, nft); | ||
} | ||
} | ||
``` | ||
|
||
and in your `Move.toml`, define the following dependency: | ||
|
||
```toml | ||
[dependencies.NftProtocol] | ||
git = "https://github.com/Origin-Byte/nft-protocol.git" | ||
# v0.22.0 | ||
rev = "7a19d30aa84faa335d722832f869c4f08a8c487a" | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.