Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
156 changes: 147 additions & 9 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"dependencies": {
"@metaplex-foundation/js": "^0.17.8",
"@project-serum/anchor": "^0.25.0",
"@solana/spl-token": "^0.3.6"
},
Expand Down
26 changes: 26 additions & 0 deletions programs/distributions/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "distributions"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "distributions"

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []

[profile.release]
overflow-checks = true

[dependencies]
anchor-lang = { version = "0.25.0", features = ["init-if-needed"] }
anchor-spl = "0.25.0"
num = { version = "0.4.0", features = ["alloc"] }
mpl-token-metadata = { version = "1.6.2", features = ["no-entrypoint"] }
chrono = { version = "0.4.19", default-features = false, features = ["alloc"] }
7 changes: 7 additions & 0 deletions programs/distributions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Distributions

## Royalty Collected Treasury Account
Royalty Collected Treasury Accounts will control an associated token account and hold general inflows of spl-token for a given token mint. This account will be responsible for splitting the inflows of tokens into a treasury account from which profits will be withdrawn, and into a royalty escrow account that will accumulate token to be distributed to NFT owners.

## Distribution
Distribution accounts will hold token for a given distribution instance and keep track of which NFTs have received a distribution. Royalty payments (distributions) from the distribution account will be tracked with a zero-byte PDA of the distribution address and the NFT mint address.
2 changes: 2 additions & 0 deletions programs/distributions/Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
10 changes: 10 additions & 0 deletions programs/distributions/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use anchor_lang::error_code;

#[error_code]
pub enum DistributionError {
InsufficientFunds,
InvalidMetadata,
InvalidCollectionDetails,
ZeroCollectionSize,
ZeroDistribution,
}
Loading