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

Add function to transfer ownership #2

Closed
arjundashrath opened this issue Feb 18, 2023 · 1 comment
Closed

Add function to transfer ownership #2

arjundashrath opened this issue Feb 18, 2023 · 1 comment

Comments

@arjundashrath
Copy link
Owner

@workwithamit add a function in the contract called transferToken. This function takes an address and tokenId as input and appends that address to the ownershipHistory array of the struct object having that tokenId

@arjundashrath
Copy link
Owner Author

@workwithamit I made a few changes to the code and added the transferToken function.

function transferToken(uint256 _tokenId, address _newOwner) public {

The way I have added the new owner to the array is more gas efficient. Now, you need to similarly update the timestamp as well in the same function, in the similar way

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