Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfer action requires authorization of collection author #42

Open
imb590 opened this issue Sep 1, 2021 · 1 comment
Open

transfer action requires authorization of collection author #42

imb590 opened this issue Sep 1, 2021 · 1 comment

Comments

@imb590
Copy link

imb590 commented Sep 1, 2021

I deployed the contract on a dev blockchain with the same code atomicassets account currently has on the WAX blockchain, set permissions for @eosio.code authorization and triggered the init action. After that most actions work as expected, but when I trigger transfer without the authorization from asset's collection's author, it fails with missing_auth_exception and demands that authorization.

What can cause such behavior?

@imb590
Copy link
Author

imb590 commented Sep 3, 2021

After a bit of digging, it turned out that the authorization is demanded on this step:

        to_assets.emplace(asset_itr->ram_payer, [&](auto &_asset) {
            _asset.asset_id = asset_itr->asset_id;
            _asset.collection_name = asset_itr->collection_name;
            _asset.schema_name = asset_itr->schema_name;
            _asset.template_id = asset_itr->template_id;
            _asset.ram_payer = asset_itr->ram_payer;
            _asset.backed_tokens = asset_itr->backed_tokens;
            _asset.immutable_serialized_data = asset_itr->immutable_serialized_data;
            _asset.mutable_serialized_data = asset_itr->mutable_serialized_data;
        });

assetitr->ram_payer is the account that minted the asset, and its authorization is required for each transfer on my local blockchain. Obviously, this does not happen on the main chain. Why? What's the difference? How to set up a local blockchain so it behaves the same as the main one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant