2

I've broken up my code into 2 contracts. FA2 contract and other one managing its data and providing additional functionality on top. This is to not overload a single contract, however, it does introduce additional complexity. Is it worth it?

AFAIK there's 2 options:

  1. Keep all the data in one contract to avoid cross-contract calls at the expense of overloading a single contract.
  2. Use 2 contracts and do cross-contract calls to check for ownership and minting rights.

Is #2 the recommended approach and how can I make it safe? My main concern around the ownership cross-contract call is the synchronization.

My other concern is around the minting permissions. Setting that on a contract initialization and not allowing edits would be the most decentralized...

What's the recommended pattern to do this?

Architecture

1 Answer 1

3

To make the LandManager the only address with permission to do this, when creating the FA2 contract the administrator should be set to LandManager.address. (hicetnuncDAO example) This way no one can mint but the smart contract.

To require "token authentication" for the metadata change, an entrypoint could be added to the FA2 contract to verify the ownership and since we have the LandManager address set as the admin for this contract, the entrypoint can then forward the metadata update to the LandManager contract. (tzcolors auction house example)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.