Skip to content

A simple marketplace APT transfer #44

Answered by MoonShiesty
memxor asked this question in Questions
Discussion options

You must be logged in to vote

modules published under resource accounts (EOAs) can retrieve and then store their own signer_cap for use later:

// Stores permission config such as SignerCapability for controlling the resource account.
struct PermissionConfig has key {
    // Required to obtain the resource account signer.
    signer_cap: SignerCapability,
}

// Initialize PermissionConfig to establish control over the resource account.
// This function is invoked only when this package is deployed the first time.
fun init_module(account: &signer) {
    let signer_cap = resource_account::retrieve_resource_account_cap(account, @protocol_deployer);
    move_to(account, PermissionConfig {
        signer_cap,
    });
}
    …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by memxor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dapp Questions related to Dapp development fungible-assets Questions related to the fungible asset standard
3 participants