-
Notifications
You must be signed in to change notification settings - Fork 37
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
EVM documentation improvements #76
Conversation
@ARitz-Cracker please have a look. |
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 think it might be useful to be explicit on what type of address each field takes (bech32 or 0x).
Looks good though!
packages/sei-cosmwasm/src/querier.rs
Outdated
/// Query to get hex payload for the ERC-20 `transfer` function | ||
/// | ||
/// # Arguments | ||
/// * `recipient` - Sei recipient address. |
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.
Is this the cosmos or 0x address?
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.
cosmos
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.
Yeah, I guess through the docs I was referring to x0 addresses as EVM
and to bech32 as Sei
. But Sei is probably confusing as we support both.
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.
In situations like these, it is better to be more verbose than not. Perhaps "bech32-encoded 'sei*' address" would be good.
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.
Very much appreciated! Though I still wholly believe that more explicit language would benefit newcomers. Most of my comments can apply to other sections of this PR.
packages/sei-cosmwasm/src/msg.rs
Outdated
to: String, | ||
/// Base64 encoded data to pass to the contract | ||
data: String, // base64 encoded |
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 am assuming that String
is used instead Binary
in all these cases in order to prevent needless parsing and re-encoding of the base64 data?
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.
yes all bytes will be transferred in base64 format
packages/sei-cosmwasm/src/querier.rs
Outdated
/// Query to get hex payload for the ERC-20 `transfer` function | ||
/// | ||
/// # Arguments | ||
/// * `recipient` - Sei recipient address. |
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.
In situations like these, it is better to be more verbose than not. Perhaps "bech32-encoded 'sei*' address" would be good.
packages/sei-cosmwasm/src/msg.rs
Outdated
@@ -41,13 +41,25 @@ pub enum SeiMsg { | |||
SetMetadata { | |||
metadata: Metadata, | |||
}, | |||
/// Calls EVM contract deployed at `to` address with the given `data`. | |||
/// The from address is the callers address. | |||
/// Please note that the CW contract has to be in allow list in order to execute delegate call. |
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.
A link to further details regarding what this "allow list" is should be here as well as the helper function comments.
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.
it refers to any CW code hash in this list https://github.com/sei-protocol/sei-chain/blob/seiv2/x/evm/types/params.go#L142 (currently only the pointer contracts).
DelegateCallEvm { | ||
/// The address of the EVM contract to call | ||
to: 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.
Assuming this is hex-encoded, do these require the capitalization checksums?
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.
no it doesn't
/// Calls EVM contract deployed at `to` address with the given `data`. | ||
/// The from address is the callers address. | ||
/// Please note that the CW contract has to be in allow list in order to execute delegate call. | ||
/// The EVM (Solidity) contract `msg.sender` in this case will be the callers address. |
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.
Might want to link to the differences between how "sei*" and "0x*" addresses are trans-coded for humans vs contracts everywhere "the callers address" is mentioned.
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.
@besated do you know if we already have a sei doc page for address mapping? If not I can help with writing up one (not sure where the gitbook repo is)
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.
we have this section in the docs - https://v2.docs.sei.io/setting-up-a-wallet#advanced
if you want to add more details, you can create a pr in the sei-docs
repo
@ARitz-Cracker thanks for reviewing. Will be addressing most comments shortly |
@ARitz-Cracker addressed the most comments and will merge it. We can add more improvements in subsequent PRs |
Adding rust docs for EVM related stucts/functions