You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
Currently for compiler bring-up/debug, we only support a single entry point specified as the script main.
In Move, however, any module function can be an entry point. This is specified via the entry keyword on the function definition, and this is the common way things are done in Move-based chains such as Aptos.
Moreover, client-callable entry functions can take any argument the user wishes, making for a natural programming model. Consider the Aptos coin module:
/// This module provides the foundation for typesafe Coins.
module aptos_framework::coin {
...
/// Transfers `amount` of coins `CoinType` from `from` to `to`.
public entry fun transfer<CoinType>(
from: &signer,
to: address,
amount: u64,
) acquires CoinStore {
let coin = withdraw<CoinType>(from, amount);
deposit(to, coin);
}
...
There is no script-- the user client can directly invoke coin::transfer, for example:
let txn_hash = coin_client
.transfer(&mut alice, bob.address(), 1_000, None)
.await
.context("Failed to submit transaction to transfer coins")?;
The ask is to have a similarly flexible and natural programming model.
Currently for compiler bring-up/debug, we only support a single entry point specified as the script main.
In Move, however, any module function can be an entry point. This is specified via the
entry
keyword on the function definition, and this is the common way things are done in Move-based chains such as Aptos.Moreover, client-callable entry functions can take any argument the user wishes, making for a natural programming model. Consider the Aptos
coin
module:There is no script-- the user client can directly invoke
coin::transfer
, for example:The ask is to have a similarly flexible and natural programming model.
See, e.g.,
https://github.com/aptos-labs/aptos-core/tree/main/sdk/src/transaction_builder.rs and
https://github.com/aptos-labs/aptos-core/tree/main/sdk/src/coin_client.rs
for some ideas.
Aptos core: https://github.com/aptos-labs/aptos-core
The text was updated successfully, but these errors were encountered: