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

[MplCore] Withdraw Sell + fulfill sell + fulfill buy #94

Merged
merged 26 commits into from
May 17, 2024

Conversation

JeremyLi28
Copy link
Contributor

@JeremyLi28 JeremyLi28 commented Apr 26, 2024

all existing functionalities (reinvest, shared escrow etc) + royalty enforcement

@JeremyLi28 JeremyLi28 changed the title [MplCore] Withdraw Sell [MplCore] Withdraw Sell + fulfill see + fulfill buy May 7, 2024
@JeremyLi28 JeremyLi28 changed the title [MplCore] Withdraw Sell + fulfill see + fulfill buy [MplCore] Withdraw Sell + fulfill sell + fulfill buy May 8, 2024

pool.sellside_asset_amount = pool
.sellside_asset_amount
.checked_sub(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should also support asset_amount > 1 right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah the args passed in can be > 1 but it doesn't make sense since we only deal with 1 asset per instruction. deposit sell also did this

tests/mmm-mpl-core.spec.ts Outdated Show resolved Hide resolved
tests/mmm-mpl-core.spec.ts Outdated Show resolved Hide resolved
tests/mmm-mpl-core.spec.ts Show resolved Hide resolved
@solonk8
Copy link
Contributor

solonk8 commented May 9, 2024

lgtm

asset: &IndexableAsset,
collection: Option<&IndexableAsset>,
) -> Option<Royalties> {
let asset_royalty_plugin = asset.plugins.get(&PluginType::Royalties);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this is actually the only place that we read data from the collection. Let's make sure that the collection is actually the collection that the asset belongs to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we actually did check these in https://github.com/magicoss/mmm/blob/37d0f8378b1a0f51e9a99ea4424120e638fe8286/programs/mmm/src/instructions/mpl_core_asset/mpl_core_fulfill_buy.rs#L242

I'm hesitate add in this function because it make code a bit more complicated that has to handle the error when call this function

assetMint,
);
if (!!mintOrCoreAsset && isMplCoreAsset(mintOrCoreAsset)) {
const asset = deserializeAssetV1(
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can build this into the rpc metadata provider right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I plan to do it another PR

@JeremyLi28 JeremyLi28 merged commit 22424a2 into main May 17, 2024
1 check passed
@JeremyLi28 JeremyLi28 deleted the chen/mpl-core-withdraw-sell branch May 17, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants