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

Generate proof to unlock NFT for accepted ownable #3

Open
jasny opened this issue Mar 13, 2023 · 1 comment
Open

Generate proof to unlock NFT for accepted ownable #3

jasny opened this issue Mar 13, 2023 · 1 comment

Comments

@jasny
Copy link
Member

jasny commented Mar 13, 2023

The accept method in the ownable service should return a cryptographic signature (aka proof) that can be used to unlock the NFT.

To test, mint an NFT (see #2) in the locked state.

Set the NFT information when instantiating the ownable.

{
  "@context": "instantiate_msg.json",
  "ownable_id": "...",
  "package": "...",
  "nft": {
    "network": "eip155:5",
    "address": "...",
    "id": 1
  }
},
{
  "@context": "execute_msg.json",
  "msg": {
    "lock": {}
  }
}

After applying the events, the state will include the NFT information set during instantiation. The ethers service will allow you to connect to the contract (remove eip155 from network to get the ethereum chain id). Get the challenge for the id.

Use ethers to sign the challenge, which will be the proof that should be returned.

Check (in code or via etherscan) to make sure you can unlock the NFT with that proof.

@jasny
Copy link
Member Author

jasny commented Mar 13, 2023

@bekauz Can you make sure that setting the NFT props works correctly in the car Ownable.

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