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

In Aleo smart contract, is there any way to call another smart contract? #60

Open
ronming1303 opened this issue Jan 10, 2024 · 1 comment

Comments

@ronming1303
Copy link

ronming1303 commented Jan 10, 2024

Hi there, I'm learning on how to use Leo.

In solidity, in a smart contract, you can also call functions in another smart contract, e.g.

function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');}
In this example token.call, it is calling another token's transfer function.

I'm wondering whether Leo support such feature?

Thanks in advance.

@davoodshahvali
Copy link

hi aleo

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

2 participants