-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5334c85
commit 5d7f12a
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
testsuite/module-publish/src/packages/framework_usecases/sources/permissioned_transfer.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
module 0xABCD::permissioned_transfer { | ||
use aptos_framework::aptos_account; | ||
use aptos_framework::permissioned_signer; | ||
use aptos_framework::primary_fungible_store; | ||
|
||
public entry fun transfer_permissioned( | ||
source: &signer, to: address, amount: u64 | ||
) { | ||
let handle = permissioned_signer::create_permissioned_handle(source); | ||
let permissioned_signer = permissioned_signer::signer_from_permissioned_handle(&handle); | ||
|
||
primary_fungible_store::grant_apt_permission(source, &permissioned_signer, amount); | ||
aptos_account::transfer(&permissioned_signer, to, amount); | ||
|
||
permissioned_signer::destroy_permissioned_handle(handle); | ||
} | ||
|
||
public entry fun transfer( | ||
source: &signer, to: address, amount: u64 | ||
) { | ||
aptos_account::transfer(source, to, amount); | ||
} | ||
} |