workshop icon indicating copy to clipboard operation
workshop copied to clipboard

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

Open ronming1303 opened this issue 1 year ago • 1 comments

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.

ronming1303 avatar Jan 10 '24 17:01 ronming1303

hi aleo

davoodshahvali avatar Jan 25 '24 11:01 davoodshahvali