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

#86dtu8yuk - Include how to use NEP17Contract to Calling contracts do… #1266

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

jplippi
Copy link
Contributor

@jplippi jplippi commented Jun 18, 2024

Summary or solution description
Added an example utilizing the NEP17Contract interface to call a NEP17 contract in the calling-smart-contracts docuimentation.

@jplippi jplippi requested a review from meevee98 June 18, 2024 18:49
@melanke
Copy link
Contributor

melanke commented Jun 18, 2024

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.201%. remained the same
when pulling fc6fd89 on CU-86dtu8yuk
into 8c6f9ae on development.

Comment on lines 94 to 99
from boa3.sc.types import Nep17Contract


@public
def calling_other_contract(my_contract_hash: str) -> str:
nep_17_contract: Nep17Contract = ContractManagement.get_contract(my_contract_hash)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is going to throw compilation errors. get_contract argument should me UInt160 shouldn't it?
If this is the case, change the variable type

Suggested change
from boa3.sc.types import Nep17Contract
@public
def calling_other_contract(my_contract_hash: str) -> str:
nep_17_contract: Nep17Contract = ContractManagement.get_contract(my_contract_hash)
from boa3.sc.types import Nep17Contract, UInt160
@public
def calling_other_contract(my_contract_hash: UInt160) -> str:
nep_17_contract: Nep17Contract = ContractManagement.get_contract(my_contract_hash)

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.201%. remained the same
when pulling 845aa70 on CU-86dtu8yuk
into 8c6f9ae on development.

@meevee98 meevee98 merged commit d091dca into development Jun 19, 2024
4 checks passed
@meevee98 meevee98 deleted the CU-86dtu8yuk branch June 19, 2024 14:30
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.

4 participants