-
Notifications
You must be signed in to change notification settings - Fork 1k
[N4] Whitelist of Free Contracts #4348
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
Conversation
Co-authored-by: Erik Zhang <[email protected]>
|
Coflicts |
|
I will change the StorageKey Logic |
|
|
||
| var keyData = key.ToArray().AsSpan(); | ||
| // TODO: Require a unwrap | ||
| (var method, var argCount) = StorageKey.ReadMethodAndArgCount(key.ToArray().AsSpan()); |
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.
@erikzhang We need a method for unwrap a StorageKey
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 have an idea. Instead of storing the methodName and argCount directly, we can read the contract's ABI and find the method's offset.
neo/src/Neo/SmartContract/Manifest/ContractMethodDescriptor.cs
Lines 22 to 32 in c104d63
| public class ContractMethodDescriptor : ContractEventDescriptor, IEquatable<ContractMethodDescriptor> | |
| { | |
| /// <summary> | |
| /// Indicates the return type of the method. It can be any value of <see cref="ContractParameterType"/>. | |
| /// </summary> | |
| public ContractParameterType ReturnType { get; set; } | |
| /// <summary> | |
| /// The position of the method in the contract script. | |
| /// </summary> | |
| public int Offset { get; set; } |
Once the contract is updated, all of its whitelists will become invalid. Therefore, storing only the Offset is safe.
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 will safe storage, it's a good idea
|
UT Failed. |
Co-authored-by: Alvaro <[email protected]>
Description
Port #4201 to N4
Type of change
How Has This Been Tested?
Checklist: