0

I have an ERC-721 token manager contract and an ERC-721 token contract. The manager contract is responsible for creating new ERC-721 contracts and minting new tokens within those contracts, as well as keeping track of wallets that have tokens and which tokens they own. Just realized a potentially fatal flaw - since I am keeping track of wallets that own tokens IF a token is traded outside of my platform the token manager contract will be out of sync. Anyone have any thoughts or ideas about how I can make this work, or a better solution to track which wallets have tokens in which ERC-721 contracts.

1

Your token contract needs to directly notify the token manager contract whenever a token is transferred by a third party.

Store the address of the token manager contract in the token contract

address private token_manager_address = 0xabcd;

and in your transferFrom and safeTransferFrom functions, have a check which says

if(msg.sender != token_manager_address){
    //do something to notify the token manager contract
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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