Skip to content

fix: reject zero address in owner and transfer fields (#140)#173

Merged
1nonlypiece merged 24 commits intoCommitlabs-Org:masterfrom
edehvictor:fix/issue-140-zero-address-tests
Feb 26, 2026
Merged

fix: reject zero address in owner and transfer fields (#140)#173
1nonlypiece merged 24 commits intoCommitlabs-Org:masterfrom
edehvictor:fix/issue-140-zero-address-tests

Conversation

@edehvictor
Copy link
Contributor

Overview

This PR addresses Issue #140 by implementing simulated "Zero Address" rejection. It explicitly checks for the Stellar null address (GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF) and prevents it from being used as an owner or transfer recipient.

Changes Made

commitment_core

  • Added is_zero_address helper function.
  • Updated create_commitment to reject zero addresses as the owner.
  • Added ZeroAddress variant to the CommitmentError enum.
  • Added test_create_commitment_zero_address_fails unit test.

commitment_nft

  • Added is_zero_address helper function.
  • Updated mint function to reject zero addresses as the owner.
  • Updated transfer function to reject zero addresses as the recipient (to).
  • Added test_mint_to_zero_address_fails and test_transfer_to_zero_address_fails unit tests using should_panic with the TransferToZeroAddress (error code 18).

Closes #140

@edehvictor
Copy link
Contributor Author

@1nonlypiece, please review and merge

@1nonlypiece
Copy link
Contributor

@edehvictor resolve the conflicts

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

Fix the compile error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

fix is_zero_address function error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

Fix the compile error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

Fix compile error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

fixing the compile error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

fixing the compile error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

fixed error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

fix error

Copy link
Contributor Author

@edehvictor edehvictor left a comment

Choose a reason for hiding this comment

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

fix test.rs file

@1nonlypiece
Copy link
Contributor

@edehvictor resolve the conflicts & fix the pipeline

@1nonlypiece
Copy link
Contributor

@edehvictor

@edehvictor
Copy link
Contributor Author

edehvictor commented Feb 25, 2026

@1nonlypiece, I have merge conflict. kindly review

@1nonlypiece
Copy link
Contributor

please resolve the conflicts

@edehvictor
Copy link
Contributor Author

Gm @1nonlypiece, I have resolved conflict. Kindly merge

@edehvictor
Copy link
Contributor Author

edehvictor commented Feb 26, 2026

@1nonlypiece, please kindly review. We're less than two hours to the end of Wave 2

I have resolved conflict

@1nonlypiece 1nonlypiece merged commit ee19e62 into Commitlabs-Org:master Feb 26, 2026
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.

Add tests for zero/invalid address in transfer and owner

2 participants