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

intents: add new contractCall transaction type #157

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

pkieltyka
Copy link
Member

  • deprecate "delayedEncode" transaction type as its a confusing name, but we leave it to maintain backwards compat
  • introduce name "contractCall" transaction type
  • new "contractCall" has a bit of sugar so you don't have to pass "func" name if the "abi" field is just a function
  • we remove named args support, as it feels unnecessary and confusing
  • "value" is optional, and will default to "0"

@pkieltyka pkieltyka requested a review from patrislav September 26, 2024 22:46
intents/intent.ridl Show resolved Hide resolved
intents/intent.ridl Show resolved Hide resolved
intents/intent_data_transaction_contract_abi.go Outdated Show resolved Hide resolved
// And it must always return it encoded, like this:
// - transferFrom(address,address,uint256)
// making sure that the method matches the returned one
func getMethodFromAbi(abi string, method string) (string, []string, error) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code was moved, its still used

"1000000000000000000",
"[\"0x8541D65829f98f7D71A4655cCD7B2bB8494673bF\"]",
{
"abi": "notExpired(uint256,string)",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nested encoding is cool.. but what is very confusing, and maybe is actually completely invalid, is the "notExpired(uint256,string)" function name..? the encoder will actually include the "notExpired" name, is that intended..? or do we just want "(uint256,string)" for the encoding without including the method selector into the encoding..?

Copy link
Member

@patrislav patrislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Just small comments

intents/intent.ridl Outdated Show resolved Hide resolved
intents/intent_data_transaction_delayed_abi.go Outdated Show resolved Hide resolved
@pkieltyka pkieltyka merged commit 1d7a58d into master Sep 27, 2024
1 check passed
@pkieltyka pkieltyka deleted the intents-contract-call-type branch September 27, 2024 12:56
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

Successfully merging this pull request may close these issues.

2 participants