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

If owners balance after the transfer is 0 the contract mints amount 0. #1

Open
radicleart opened this issue Sep 7, 2022 · 0 comments

Comments

@radicleart
Copy link
Contributor

There is a bug in the SFT minting contract which makes it possible for an address to own zero quantity of a given SFT. This in turn makes it look like the address owns some SFT when calling the API methods and also causes problems with post conditions when calling transfer transactions.

The code responsible;

                 (try! (tag-nft-token-id {token-id: token-id, owner: sender}))
		(try! (tag-nft-token-id {token-id: token-id, owner: recipient}))

should read;

		(if (< amount sender-balance) 
			(try! (tag-nft-token-id {token-id: token-id, owner: sender}))
			(try! (nft-burn? artwork-token {token-id: token-id, owner: sender} sender))
		)
		(try! (tag-nft-token-id {token-id: token-id, owner: recipient}))

Ie avoid minting back to owner if balance is going to 0.

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

No branches or pull requests

1 participant