Skip to content

Feature/contract wrapper implicit operator #238

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

Merged
merged 5 commits into from
Mar 19, 2025

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)
Copy link

cloudflare-workers-and-pages bot commented Feb 10, 2025

Deploying sequence-unity with  Cloudflare Pages  Cloudflare Pages

Latest commit: 33bc767
Status: ✅  Deploy successful!
Preview URL: https://bb276281.sequence-unity.pages.dev
Branch Preview URL: https://feature-contractwrapperimpli.sequence-unity.pages.dev

View logs

@caballoninja caballoninja merged commit 8679ecb into master Mar 19, 2025
2 checks passed
@caballoninja caballoninja deleted the Feature/contractWrapperImplicitOperator branch March 19, 2025 16:23
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.

2 participants