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

Feature/contract wrapper implicit operator #238

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BellringerQuinn
Copy link
Contributor

@BellringerQuinn BellringerQuinn commented Jan 24, 2025

Added a ContractWrapper class that Ownable now inherits from; this abstract class is intended to be used for any contract wrappers we create (note that erc token wrappers and sales contracts also inherit from ContractWrapper as they inherit from Ownable).

Added an implicit operator to Contract and ContractWrapper so that we can use either class, and any derived classes, as an Address directly when appropriate. For example: if we had a function foo(Address contract), we would previously have needed to do foo(myContract.GetAddress()) or foo(myContractWrapper.Contract.GetAddress()) and now we can just do foo(myContract) or foo(myContractWrapper)

Version Increment

Please ensure you have incremented the package version in the package.json as necessary.

  • I have incremented the package.json according to semantic versioning
  • No version increment is needed; the change does not impact SDK or Sample code/assets

Docs Checklist

Please ensure you have addressed documentation updates if needed as part of this PR:

  • I have created a separate PR on the sequence docs repository for documentation updates: Link to docs PR
  • No documentation update is needed for this change.

…ve from - it is intended that contract wrappers should inherit from it. Added an implicit operator to Contract and ContractWrapper such that you can use either of them as an Address directly (instead of using getters to get the associated Address)
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.

1 participant