Closed maorveitsman closed 7 months ago
It would make sense to have a new interface ID. Accounts could implement both versions (or just one) and dapps could be able to tell what's supported by the account. To achieve that i propose renaming the cairo methods execute_from_outside
to execute_from_outside_v2
?, And the same for the other external method
For version 2 I suggest the following:
OutsideExecution: [
{ name: "Caller", type: "ContractAddress" },
{ name: "Nonce", type: "felt" },
{ name: "Execute After", type: "u128" },
{ name: "Execute Before", type: "u128" },
{ name: "Calls", type: "Call*" },
],
Call: [
{ name: "To", type: "ContractAddress" },
{ name: "Selector", type: "selector" },
{ name: "Calldata", type: "felt*" },
]
There are two changes here:
u64
with u128
, as u64
is not supported by SNIP-12. It still can (and should) be a u64
in the cairo structexecute_after
to Execute After
)There is also an additional change that needs to be done to be compliant with SNIP-12 rev1. That's escaping the names with quotes (JSON escape) as mentioned here https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-12.md#specification That will generate different type hashes
For instance the Call will be encoded as:
starknet_keccak('Call("To":"ContractAddress","Selector":"selector","Calldata":"felt*")')
This change is