neo-one
neo-one copied to clipboard
Implement `trusts` in contract manifest when it's eventually integrated into Neo code (post Preview3)
The contract manifest definition includes a field called "trusts" which is not checked by the Preview3 ApplicationEngine, so for Neo3-Preview3 the NEO•ONE compiler can just set trusts
to be a wildcard ("*") since it's never checked anyway. But this will likely be changed in post-Preview3 C# spec, so implement this later.
According to Neo3 repo comment: "The trusts field is an array containing a set of contract hashes or group public keys. It can also be assigned with a wildcard *. If it is a wildcard *, then it means that it trusts any contract. If a contract is trusted, the user interface will not give any warnings when called by the contract."
It will ultimately be an array of contract hashes or "group public keys".
Look at ManifestSmartContractProcessor.ts
for how we process trusts. The way we want to implement this is probably to have documentation for a NEO•ONE smart contract that shows that the "trusts" array has to be defined in a smart contract's properties
property, which will have a member called trusts
which is an array of strings of hashes or public keys. Then the compiler will process the contract to produce a manifest and will check that array for valid hashes/public keys and then write those hashes/public keys to the manifest output. And the default will be '*'
if it's not defined and the compiler will produce a warning to the user.