-
Notifications
You must be signed in to change notification settings - Fork 179
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
Cw4973 #99
base: main
Are you sure you want to change the base?
Cw4973 #99
Conversation
pub gas: String, | ||
} | ||
|
||
// TODO: the order of these fields is VERY IMPORTANT, DO NOT CHANGE IT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: the order of these fields is VERY IMPORTANT, DO NOT CHANGE IT | |
// The order of these fields is VERY IMPORTANT, DO NOT CHANGE IT |
Not a TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i love the naming of the api and signature verification. just a couple questions from a first past.
mut deps: DepsMut, | ||
env: Env, | ||
info: MessageInfo, | ||
msg: InstantiateMsg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about making the InstantiateMsg
an alias for Cw721BaseInstantiateMsg
(ex)?
type InstantiateMsg = Cw721BaseInstantiateMsg;
that would remove the need for the first line of the function and imo helps convey the intent a little better.
} | ||
|
||
// the get_hash funtion will concat the address of the sender, the address of the 'to', the uri of the nft and the hash of the string | ||
fn _get_hash(active: &str, passive: &str, uri: &str, chain_id: &str) -> Vec<u8> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you expand a little on what these function arguments are? are active, passive, and uri intended to be additional metadata? i'm curious why you include chain id?
// TODO: modify this function to specify the others fields of the signing document | ||
fn _get_sign_doc(signer: &str, message: &str) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and your types in state.rs are 🙏.
- is it possible to write an integration test for this? using cosmjs from the readme would be great.
- if you'd like, i think this signing logic would be a very helpful package to have. would you be interested in breaking it out into one?
Cw4973 - Account-bound Tokens (ABT)
Cw4973 is implemented based on the description of EIP-4973. Some requirements in the description will be changed for suitable with CosmWasm characteristics.
In the contract, I also implement the signature based on ADR 036 and signature verification based on @cosmjs/amino.
Specification
Cw4973 is extended from Cw721-base with some modifications in execution section:
metadata
structures are unchanged.query functions
andquery messages
are unchanged.execute functions
andexecute messages
are removed.execute functions
andexecute messages
to the contract:Give
Take
Unequip