Skip to content

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

@ronming1303

Description

@ronming1303

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions