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

Batch minting #113

Open
wants to merge 91 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
b25553a
feat: add create tree with root instruction
n00m4d May 16, 2024
0339d56
feat: update solana versions
n00m4d May 17, 2024
403765d
feat: client update
n00m4d May 19, 2024
1e185ed
feat: add new instr to instruction name enum
n00m4d May 19, 2024
4bef5d4
feat: SOL protocol fee for rollup operation
RequescoS May 22, 2024
67fd4a3
test: update
n00m4d May 22, 2024
883f43b
feat: add temp script to prepare env to run tests
n00m4d May 22, 2024
060bd11
Merge branch 'feat/rollup' into feat/rollup-sol-fee
RequescoS May 22, 2024
771d115
tests
RequescoS May 22, 2024
06577c5
feat: change submodule for spl
n00m4d May 23, 2024
9c9f43f
comments
RequescoS May 27, 2024
323edc9
feat: add new instructions and cover it with tests
n00m4d May 27, 2024
b04e6a1
Merge branch 'feat/rollup' into feat/rollup-sol-fee
RequescoS May 28, 2024
88a955a
client: generate new sdk
n00m4d May 30, 2024
db4a868
feat: change prep tree and finalize tree instructions a little bit
n00m4d May 31, 2024
250c363
merge + tests
RequescoS Jun 4, 2024
5e28369
Merge branch 'feat/rollup' into feat/rollup-sol-fee
RequescoS Jun 4, 2024
1565158
feat: add canopy size check
n00m4d May 28, 2024
7aaf57d
rebase + git submodule update
StanChe Jun 4, 2024
c464ba3
merge + tests
RequescoS Jun 5, 2024
e039c04
fmt
RequescoS Jun 5, 2024
20478c6
Merge pull request #3 from n00m4d/feat/canopy-size-check
StanChe Jun 5, 2024
c24672f
Merge branch 'feat/rollup' into feat/rollup-sol-fee
RequescoS Jun 5, 2024
dfe9784
merge
RequescoS Jun 5, 2024
b2d39bb
[MTG-234] calculate weighted stake
StanChe Jun 5, 2024
bd1b4b3
prepare tree cleaned up
StanChe Jun 5, 2024
f9ccebb
extending a comment and reusing the existing variable
StanChe Jun 5, 2024
2c4b1ea
Merge branch 'feature/weighted-stake' into feature/cleanup
StanChe Jun 5, 2024
08e8238
finalize tree with root finalized
StanChe Jun 6, 2024
a3f2290
client lib manual update
StanChe Jun 6, 2024
05f018f
minor cleanup
StanChe Jun 6, 2024
332c895
fix: canopy size check
n00m4d Jun 20, 2024
bd42fa8
feat: finalize tree with root and collection
RequescoS Jul 5, 2024
dc409fe
updated the dependency on solana program library
StanChe Jul 5, 2024
1bcffa6
Update programs/bubblegum/program/src/utils.rs
n00m4d Jul 5, 2024
54a6a6a
Merge pull request #7 from adm-metaex/fix/canopy-check
n00m4d Jul 5, 2024
8385944
refactor: simplify tests
n00m4d Jul 7, 2024
affbb00
chore: add more comments
n00m4d Jul 8, 2024
50579ea
feat: finalize tree with collection
RequescoS Jul 9, 2024
f330635
comments
RequescoS Jul 10, 2024
7d3d637
chore: func rename and comment
n00m4d Jul 10, 2024
809fb9b
Merge pull request #9 from adm-metaex/fix/canopy-check
n00m4d Jul 11, 2024
90e3aa3
reusing the existing code for the finalize tree with collection
StanChe Jul 11, 2024
f041a3c
nit: using more of From and marking varable as used as it's passed do…
StanChe Jul 11, 2024
fc2c362
removed couple unnecessary submodules
StanChe Jul 11, 2024
463851b
Merge pull request #10 from adm-metaex/feature/finalize_tree_with_col…
StanChe Jul 16, 2024
aed0cfc
Merge remote-tracking branch 'origin/feature/cleanup' into feature/fi…
RequescoS Jul 16, 2024
b369e2f
comments
RequescoS Jul 16, 2024
9869189
Merge pull request #8 from adm-metaex/feature/finalize-tree-with-coll…
RequescoS Jul 16, 2024
a1431cf
Merge branch 'feature/cleanup' into feature/submodules_removal
n00m4d Jul 23, 2024
c4fa3c4
Merge pull request #11 from adm-metaex/feature/submodules_removal
n00m4d Jul 23, 2024
fc6b995
remove auth-rules submodule (#12)
rwwwx Jul 25, 2024
7c976dd
fixed dev-deps
rwwwx Jul 29, 2024
a275e5a
added `VOTER_DISCRIMINATOR` const, fixed fmt
rwwwx Jul 29, 2024
b41b946
updates according to spl renaming
StanChe Jul 30, 2024
a6d7447
bump version to 0.13
StanChe Jul 30, 2024
6887833
renaming rollup to batch mint
StanChe Jul 30, 2024
ddad419
using 30M weighted stake as a requirement to batch mint
StanChe Jul 30, 2024
d122281
using the delegated stake in the minimal requirement check
StanChe Aug 1, 2024
a0a6f58
typo fix
StanChe Aug 1, 2024
fdfee8a
minor lock file update
StanChe Aug 2, 2024
0e56a6c
batch operations documented + 1 argument renamed in add_canopy method
StanChe Aug 2, 2024
8202945
Merge pull request #14 from adm-metaex/feature/docs
StanChe Aug 2, 2024
bfb174f
using immutable mining account + fix for the stack overflow on the vo…
StanChe Aug 7, 2024
b4e82e5
removed a comment - already using the immutable mining
StanChe Aug 8, 2024
b81e2f8
an additional comment and removed an unnecessary box
StanChe Aug 8, 2024
5a77580
using published version of mpl-token-auth-rules
StanChe Aug 8, 2024
7ef46f1
Update programs/bubblegum/program/src/processor/finalize_tree_with_ro…
StanChe Aug 8, 2024
27fe95d
introducing a discriminator length constant instead of a magic number
StanChe Aug 8, 2024
45baca1
no need for the box
StanChe Aug 8, 2024
74d0479
simplified the work with bytes
StanChe Aug 8, 2024
6de5c68
further simplified references/dereferences
StanChe Aug 8, 2024
ec3dd4a
Merge pull request #13 from adm-metaex/feature/delegated-staking-check
StanChe Aug 8, 2024
148c0b2
feat: update client
RequescoS Aug 27, 2024
afebaf7
thiserror update
RequescoS Aug 27, 2024
5340099
thiserror update
RequescoS Aug 29, 2024
702e5cd
thiserror update
RequescoS Aug 29, 2024
2213f22
Merge pull request #16 from adm-metaex/feat/update-client
RequescoS Aug 29, 2024
0607f92
Merge commit 'cdd8fc3cde9f9f30518bb265d8fbf4be117df128' into feature/…
StanChe Sep 9, 2024
b3c48f0
using spl crate
StanChe Sep 13, 2024
aa01de9
account compression idl update, deps update and parameter names allig…
StanChe Sep 14, 2024
c187cba
fix formatting in toml
StanChe Sep 14, 2024
dc50cf2
Merge commit '42ffed35da6b2a673efacd63030a360eac3ae64e' into feature/…
StanChe Sep 19, 2024
1906a77
using devnet of solana to dump contracts as the spl account compressi…
StanChe Sep 24, 2024
d352e05
regenerated clients
StanChe Sep 24, 2024
6f9e36b
bump rust client version to 1.5.0
StanChe Sep 25, 2024
d87ede8
using a public crate for spl-account-compression
StanChe Sep 25, 2024
9a7ee42
fixed the noop version and client lock file update
StanChe Sep 25, 2024
cd5704e
updated refs to staking and rewards contracts
StanChe Sep 25, 2024
c3010c1
fix formating in cargo
StanChe Sep 25, 2024
07678e6
Use constants from external crate (#114)
n00m4d Sep 30, 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
148 changes: 148 additions & 0 deletions clients/js/src/generated/errors/mplBubblegum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,154 @@ export class InvalidCanopySizeError extends ProgramError {
codeToErrorMap.set(0x1799, InvalidCanopySizeError);
nameToErrorMap.set('InvalidCanopySize', InvalidCanopySizeError);

/** NotEnoughStakeForOperation: Not enough tokens staked to call this instruction */
export class NotEnoughStakeForOperationError extends ProgramError {
readonly name: string = 'NotEnoughStakeForOperation';

readonly code: number = 0x179a; // 6042

constructor(program: Program, cause?: Error) {
super('Not enough tokens staked to call this instruction', program, cause);
}
}
codeToErrorMap.set(0x179a, NotEnoughStakeForOperationError);
nameToErrorMap.set(
'NotEnoughStakeForOperation',
NotEnoughStakeForOperationError
);

/** StakingRegistrarMismatch: Staking registrar mismatch */
export class StakingRegistrarMismatchError extends ProgramError {
readonly name: string = 'StakingRegistrarMismatch';

readonly code: number = 0x179b; // 6043

constructor(program: Program, cause?: Error) {
super('Staking registrar mismatch', program, cause);
}
}
codeToErrorMap.set(0x179b, StakingRegistrarMismatchError);
nameToErrorMap.set('StakingRegistrarMismatch', StakingRegistrarMismatchError);

/** StakingVoterMismatch: Staking voter mismatch */
export class StakingVoterMismatchError extends ProgramError {
readonly name: string = 'StakingVoterMismatch';

readonly code: number = 0x179c; // 6044

constructor(program: Program, cause?: Error) {
super('Staking voter mismatch', program, cause);
}
}
codeToErrorMap.set(0x179c, StakingVoterMismatchError);
nameToErrorMap.set('StakingVoterMismatch', StakingVoterMismatchError);

/** FeeReceiverMismatch: Fee receiver mismatch */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It would be nice if some of these new Bubblegum errors were a bit more descriptive. For example, if this one said something more like who the fee receiver is mismatched with.

Like some of the spl-account compression ones have a bit of wording that really helps with the clarity, i.e.:
BatchNotInitializedError: Tree header was not initialized for batch processing
CanopyRootMismatchError: Canopy root does not match the root of the tree

export class FeeReceiverMismatchError extends ProgramError {
readonly name: string = 'FeeReceiverMismatch';

readonly code: number = 0x179d; // 6045

constructor(program: Program, cause?: Error) {
super('Fee receiver mismatch', program, cause);
}
}
codeToErrorMap.set(0x179d, FeeReceiverMismatchError);
nameToErrorMap.set('FeeReceiverMismatch', FeeReceiverMismatchError);

/** StakingRegistrarRealmMismatch: Staking registrar realm mismatch */
export class StakingRegistrarRealmMismatchError extends ProgramError {
readonly name: string = 'StakingRegistrarRealmMismatch';

readonly code: number = 0x179e; // 6046

constructor(program: Program, cause?: Error) {
super('Staking registrar realm mismatch', program, cause);
}
}
codeToErrorMap.set(0x179e, StakingRegistrarRealmMismatchError);
nameToErrorMap.set(
'StakingRegistrarRealmMismatch',
StakingRegistrarRealmMismatchError
);

/** StakingRegistrarDiscriminatorMismatch: Staking registrar discriminator mismatch */
export class StakingRegistrarDiscriminatorMismatchError extends ProgramError {
readonly name: string = 'StakingRegistrarDiscriminatorMismatch';

readonly code: number = 0x179f; // 6047

constructor(program: Program, cause?: Error) {
super('Staking registrar discriminator mismatch', program, cause);
}
}
codeToErrorMap.set(0x179f, StakingRegistrarDiscriminatorMismatchError);
nameToErrorMap.set(
'StakingRegistrarDiscriminatorMismatch',
StakingRegistrarDiscriminatorMismatchError
);

/** StakingVoterDiscriminatorMismatch: Staking voter discriminator mismatch */
export class StakingVoterDiscriminatorMismatchError extends ProgramError {
readonly name: string = 'StakingVoterDiscriminatorMismatch';

readonly code: number = 0x17a0; // 6048

constructor(program: Program, cause?: Error) {
super('Staking voter discriminator mismatch', program, cause);
}
}
codeToErrorMap.set(0x17a0, StakingVoterDiscriminatorMismatchError);
nameToErrorMap.set(
'StakingVoterDiscriminatorMismatch',
StakingVoterDiscriminatorMismatchError
);

/** StakingVoterRegistrarMismatch: Staking voter registrar mismatch */
export class StakingVoterRegistrarMismatchError extends ProgramError {
readonly name: string = 'StakingVoterRegistrarMismatch';

readonly code: number = 0x17a1; // 6049

constructor(program: Program, cause?: Error) {
super('Staking voter registrar mismatch', program, cause);
}
}
codeToErrorMap.set(0x17a1, StakingVoterRegistrarMismatchError);
nameToErrorMap.set(
'StakingVoterRegistrarMismatch',
StakingVoterRegistrarMismatchError
);

/** StakingVoterAuthorityMismatch: Staking voter authority mismatch */
export class StakingVoterAuthorityMismatchError extends ProgramError {
readonly name: string = 'StakingVoterAuthorityMismatch';

readonly code: number = 0x17a2; // 6050

constructor(program: Program, cause?: Error) {
super('Staking voter authority mismatch', program, cause);
}
}
codeToErrorMap.set(0x17a2, StakingVoterAuthorityMismatchError);
nameToErrorMap.set(
'StakingVoterAuthorityMismatch',
StakingVoterAuthorityMismatchError
);

/** MiningOwnerMismatch: Invalid mining owner */
export class MiningOwnerMismatchError extends ProgramError {
readonly name: string = 'MiningOwnerMismatch';

readonly code: number = 0x17a3; // 6051

constructor(program: Program, cause?: Error) {
super('Invalid mining owner', program, cause);
}
}
codeToErrorMap.set(0x17a3, MiningOwnerMismatchError);
nameToErrorMap.set('MiningOwnerMismatch', MiningOwnerMismatchError);

/**
* Attempts to resolve a custom program error from the provided error code.
* @category Errors
Expand Down
80 changes: 80 additions & 0 deletions clients/js/src/generated/errors/splAccountCompression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,86 @@ export class LeafIndexOutOfBoundsError extends ProgramError {
codeToErrorMap.set(0x1778, LeafIndexOutOfBoundsError);
nameToErrorMap.set('LeafIndexOutOfBounds', LeafIndexOutOfBoundsError);

/** CanopyNotAllocated: Tree was initialized without allocating space for the canopy */
export class CanopyNotAllocatedError extends ProgramError {
readonly name: string = 'CanopyNotAllocated';

readonly code: number = 0x1779; // 6009

constructor(program: Program, cause?: Error) {
super(
'Tree was initialized without allocating space for the canopy',
program,
cause
);
}
}
codeToErrorMap.set(0x1779, CanopyNotAllocatedError);
nameToErrorMap.set('CanopyNotAllocated', CanopyNotAllocatedError);

/** TreeAlreadyInitialized: Tree was already initialized */
export class TreeAlreadyInitializedError extends ProgramError {
readonly name: string = 'TreeAlreadyInitialized';

readonly code: number = 0x177a; // 6010

constructor(program: Program, cause?: Error) {
super('Tree was already initialized', program, cause);
}
}
codeToErrorMap.set(0x177a, TreeAlreadyInitializedError);
nameToErrorMap.set('TreeAlreadyInitialized', TreeAlreadyInitializedError);

/** BatchNotInitialized: Tree header was not initialized for batch processing */
export class BatchNotInitializedError extends ProgramError {
readonly name: string = 'BatchNotInitialized';

readonly code: number = 0x177b; // 6011

constructor(program: Program, cause?: Error) {
super(
'Tree header was not initialized for batch processing',
program,
cause
);
}
}
codeToErrorMap.set(0x177b, BatchNotInitializedError);
nameToErrorMap.set('BatchNotInitialized', BatchNotInitializedError);

/** CanopyRootMismatch: Canopy root does not match the root of the tree */
export class CanopyRootMismatchError extends ProgramError {
readonly name: string = 'CanopyRootMismatch';

readonly code: number = 0x177c; // 6012

constructor(program: Program, cause?: Error) {
super('Canopy root does not match the root of the tree', program, cause);
}
}
codeToErrorMap.set(0x177c, CanopyRootMismatchError);
nameToErrorMap.set('CanopyRootMismatch', CanopyRootMismatchError);

/** CanopyRightmostLeafMismatch: Canopy contains nodes to the right of the rightmost leaf of the tree */
export class CanopyRightmostLeafMismatchError extends ProgramError {
readonly name: string = 'CanopyRightmostLeafMismatch';

readonly code: number = 0x177d; // 6013

constructor(program: Program, cause?: Error) {
super(
'Canopy contains nodes to the right of the rightmost leaf of the tree',
program,
cause
);
}
}
codeToErrorMap.set(0x177d, CanopyRightmostLeafMismatchError);
nameToErrorMap.set(
'CanopyRightmostLeafMismatch',
CanopyRightmostLeafMismatchError
);

/**
* Attempts to resolve a custom program error from the provided error code.
* @category Errors
Expand Down
Loading
Loading