Skip to content

Commit

Permalink
Merge branch 'dev-net' into 'main'
Browse files Browse the repository at this point in the history
Synch Dev-net  > main

See merge request adnan/omniflix-launchpad!19
  • Loading branch information
Adnan Deniz committed Feb 26, 2024
2 parents b18ee69 + 4142cb3 commit 98b19bf
Show file tree
Hide file tree
Showing 193 changed files with 20,433 additions and 3,154 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ tarpaulin-report.html
# Text file backups
**/*.rs.bk

# macOS
.DS_Store

# IDEs
*.iml
.idea

/ts/node_modules
66 changes: 55 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ repository = ""
license = "Apache-2.0"

[workspace.dependencies]
cosmwasm-schema = "1.5.0"
cosmwasm-schema = "1.5.3"
cosmwasm-std = "1.2.1"
omniflix-std = "0.0.2"
omniflix-std = "0.1.3"
cw-controllers = "1.1.0"
cw2 = "1.1.0"
cw4 = "1.1.0"
Expand All @@ -33,6 +33,7 @@ semver = "1"
cw-ownable = "0.5.1"
cosmwasm-storage = "1.5.0"
serde = { version = "1.0.145", default-features = false, features = ["derive"] }
whitelist-types = { version = "0.0.1", path = "packages/whitelist-types" }
minter-types = { version = "0.0.1", path = "packages/minter-types" }
open-edition-minter-types = { version = "0.0.1", path = "packages/open-edition-minter-types" }
whitelist-types = { path = "packages/whitelist-types" }
minter-types = { path = "packages/minter-types" }
factory-types = { path = "packages/factory-types" }
pauser = { path = "packages/pauser" }
106 changes: 5 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,14 @@
# Omniflix Launchpad Readme
# Omniflix Launchpad

## Omniflix Launchpad Contracts

This repository contains the smart contracts for the Omniflix Launchpad platform. These contracts are responsible for launching an NFT collection.

## Contracts
## Factories

- Omniflix-whitelist
- Omniflix-minter
Launchpad utilizes a singleton structure for each collection that is released through this launchpad. The purpose of the factories is to create an instance of minters and whitelist contracts.

## Contract Overview
## Design
<img src="launchpad-design.png" align="center" height="300" width="1000"/>

### Minter

The Minter contract is the primary component of the launchpad.

#### Instantiate

- During instantiation, the creator should send Collection details along with trading information such as price, denomination, and trading start time.
- The creator also has the option to send `Rounds`.
- Currently, there are two types of rounds.
- During instantiation, one of these types should be included inside an array.
- The creator can add as many rounds as desired, but overlapping rounds are not permitted and will cause an error.

#### WhitelistAddress
```
{
address: Addr,
start_time: Option<Timestamp>,
end_time: Option<Timestamp>,
mint_price: Uint128,
round_limit: u32,
}
```

#### WhitelistCollection
```
{
collection_id: String,
start_time: Timestamp,
end_time: Timestamp,
mint_price: Uint128,
round_limit: u32,
}
```

- `Whitelist address`
- This whitelist type refers to the whitelist contract in our launchpad. To use it, you need to instantiate it and send its address to the minter along with the other parameters.
- The optional parts do not need to be sent. When instantiating, the minter contract ignores these parameters and queries the corresponding whitelist contract.
- `Whitelist collection`
- This whitelist is used to allow specific collections that are already created and have token holders. The contract checks the specified collection to determine if the round is active and if the buyer actually possesses at least one of those tokens. If these conditions are met, the user will be granted permission for private minting.

#### Mint

- There are two types of minting: `Mint{}` and `AdminMint{}`
- `Mint{}`: This option is for users who want to own the NFT, and they need to pay the active price at that time.
- `AdminMint{}`: As the name suggests, this option is specifically for admin to mint a token. Admins have the ability to determine the recipient and specify the token ID. If the ID is available, it will be minted. Admins are not subject to address limits or private mint checks, and this action does not require a payment.

#### RemoveRound

#### AddRound

- Creator has the ability to add or remove rounds as they please. When adding overlapping rounds are still not permitted and rounds that already started cannot be added nor removed.

#### UpdateCollectionRound
- Creator has the ability to update the collection round. This is useful when the creator wants to change the collection ID, start time, end time, or mint price. This function is only available for collection rounds.

#### UpdateWhitelistRound
- This function is can not be used by the creator. It is only available for the whitelist contract to update the whitelist round. This is useful when the creator wants to change the start time, end time, or mint price. This changes happen on the whitelist contract. But the whitelist contract updates this round on the minter contract.

#### BurnRemainingTokens

- We cannot technically burn tokens because burnable ones are the ones that are not minted yet. If executed by the creator, this minter will not mint any other token.

#### UpdateRoyaltyRatio
- This function allows the creator to change the royalty ratio for the NFTs minted through the launchpad. The royalty ratio determines the percentage of each subsequent resale of an NFT that is paid to the original creator as royalties.

#### UpdateMintPrice
- This function permits the creator to modify the mint price. This only affects the price of the public mint.

#### RandomizeList

- Creator has the ability to randomize token list. It's only gated by the creator because this operation is costly. In the future, a small fee could be collected from whoever wants to randomize the list.

### Whitelist

The Whitelist contract maintains a list of addresses that are eligible to participate in the token sale.

#### Instantiate

- Upon instantiation, the creator should send the start and end time of this whitelist along with the mint price and an array of valid addresses.

#### Execute

- `UpdateEndTime`: This message is used to update the end time of the whitelist. The `end_time` parameter should be provided along with an optional `minter_address` parameter.
- `UpdateMintPrice`: This message is used to update the mint price of the whitelist. The `mint_price` parameter should be provided along with an optional `minter_address` parameter.
- `UpdatePerAddressLimit`: This message is used to update the per-address limit of the whitelist. The `amount` parameter should be the new limit, and an optional `minter_address` parameter can be provided.
- `UpdateStartTime`: This message is used to change the start time of the whitelist. The `start_time` parameter should be provided along with an optional `minter_address` parameter.
- If the creator has a specific minter contract that is already using this contract as one of its rounds, they are expected to provide the minter address.
- In such cases, the parameters for each contract will be different, which may cause overlap. Therefore, if the minter address is provided, the whitelist contract will attempt to update the parameter on the minter contract. (Note: On the minter contract, the whitelist round can only be updated from the whitelist address.)
- `AddMembers`: This message is used to add new addresses to the whitelist. The `addresses` parameter should be an array of valid addresses.
- `RemoveMembers`: This message is used to remove addresses from the whitelist. The `addresses` parameter should be an array of valid addresses.
- `IncreaseMemberLimit`: This message is used to increase the member limit of the whitelist by a specified amount.
- `UpdateAdmin`: This message is used to update the admin of the whitelist. The `admin` parameter should be the new admin address.
- `Freeze`: This message is used to freeze the whitelist, preventing any further changes.

## Contributing

If you would like to contribute to the Omniflix Launchpad contracts, please follow the guidelines outlined in [CONTRIBUTING.md](http://contributing.md/). We welcome all contributions, from bug fixes to feature enhancements.
12 changes: 8 additions & 4 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
b7c2653138a5890ed7b6156e86ac69814659d337afbc82cedfa674bc645a6127 omniflix_minter.wasm
aee5e28735bf9f1be6fd58ec8cbe808318ed7c2bd0ab4466286aa2ad05644530 omniflix_minter_factory.wasm
1fa98bb2fafdca70bbb9d2b88cefe5d3d2329abab38ea3a8f58c4293dfcd5bab omniflix_round_whitelist_factory.wasm
5e0f8ff75a4cd213193d110ca67a9bdf41a6939d88437a0643debc068c4d9361 round_whitelist.wasm
433cd724fa9863f244b4dcfcf8dd63b8925e9c812ad7f8693cf1f4742918316d omniflix_minter.wasm
6d9047339a8289cf0a353d06ea7317472d421a1e92548c128629699a384301dd omniflix_minter_factory.wasm
582f94b015f272ba75fe5a6414929411aa82eac2a082738f4933201e6918fb63 omniflix_multi_mint_open_edition_minter.wasm
96649782494a4fa73fb3154dc3af0f87759865790caae82be9c33870cd4117a9 omniflix_open_edition_minter.wasm
ca1121e0137961ae9a7838413b5b0cda4fc800ed50cc717cc3c1796bdbe9e4e2 omniflix_open_edition_minter_copy.wasm
dc6fcb2312463c61966b2b660c8626c1139aac09052cf71d3dcffdb0bcbc25cf omniflix_open_edition_minter_factory.wasm
6857583230ddcec6d9fefb3e648a9a0a179d821fa7a7f96efda3d6a4186f5d77 omniflix_round_whitelist.wasm
6cd989d33877aa51a89069aa33d2b50ed9b1b64be390dd45a1cb09ff4a1dfd92 omniflix_round_whitelist_factory.wasm
12 changes: 8 additions & 4 deletions artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
055f4e6ac28e088bcca646193b22a2b8d2aa22daad1ea7734f6ab7f59c6c0ad1 target/wasm32-unknown-unknown/release/omniflix_whitelist.wasm
4e63872e680b28c46e3b82add56b88487513cc2eea8813ba32b4a8d9b4af723c target/wasm32-unknown-unknown/release/omniflix_minter.wasm
dfaec6ddcd3d5d19bb8e57576d3f523e34f0803bc8101336c70d4ca686d42d89 target/wasm32-unknown-unknown/release/omniflix_minter_factory.wasm
f4ab42064635ede862c4741aca77c3f3471dd5a0a4177ee8be8af21a25b6dc59 target/wasm32-unknown-unknown/release/round_whitelist.wasm
0ff723cd6bcf7c3067ff0df7d9bf1f227efe4fff2b0c2324bc84b95216eb2e72 target/wasm32-unknown-unknown/release/omniflix_minter.wasm
2ce6b8be1a56977db759b79ce638db6d70cf655d477ece99d1b52be4a37035af target/wasm32-unknown-unknown/release/omniflix_minter_factory.wasm
fab80e19deab3b947612593c762e04817dbf07b0445d88e95fbdae2c16d26efa target/wasm32-unknown-unknown/release/omniflix_multi_mint_open_edition_minter.wasm
55b6dd86e2cd23a6643ec812ec709ce81ea990a360ab6b4ebb4bd14776495133 target/wasm32-unknown-unknown/release/omniflix_open_edition_minter.wasm
c20531d46d46c57955320f9e1464a4a4cc87fd0aa6c139355b6b866735125ee0 target/wasm32-unknown-unknown/release/omniflix_open_edition_minter_copy.wasm
3ddff97914a8380acea013271838754552904e07d58a9e4d8d6e2d08756cefb8 target/wasm32-unknown-unknown/release/omniflix_open_edition_minter_factory.wasm
d1ea2c4ac7e9bebd4a4ebd70d8f0ce6436979c7f5e9bcbbdaf255ab79e9f38b6 target/wasm32-unknown-unknown/release/omniflix_round_whitelist.wasm
36dd84428a9c11c9b2ae07be2f02def5b1a7b3a78bfb2093ed76f90b1fee3643 target/wasm32-unknown-unknown/release/omniflix_round_whitelist_factory.wasm
Binary file modified artifacts/omniflix_minter.wasm
Binary file not shown.
Binary file modified artifacts/omniflix_minter_factory.wasm
Binary file not shown.
Binary file not shown.
Binary file added artifacts/omniflix_open_edition_minter.wasm
Binary file not shown.
Binary file added artifacts/omniflix_open_edition_minter_copy.wasm
Binary file not shown.
Binary file not shown.
Binary file added artifacts/omniflix_round_whitelist.wasm
Binary file not shown.
Binary file modified artifacts/omniflix_round_whitelist_factory.wasm
Binary file not shown.
Binary file removed artifacts/round_whitelist.wasm
Binary file not shown.
Binary file added contracts/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --bin schema"
schema = "run schema"
3 changes: 2 additions & 1 deletion contracts/factories/minter-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ library = []
cosmwasm-storage = { workspace = true }
omniflix-std = { workspace = true }
thiserror = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-controllers = { workspace = true }
cw2 = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
serde = { workspace = true }
minter-types = {workspace = true}
factory-types = {workspace = true}

Loading

0 comments on commit 98b19bf

Please sign in to comment.