Commit graph

29 commits

Author SHA1 Message Date
Ekaterina Pavlova
baac738ec3 smartcontract: add test of extraToStackItem with double quotes
C# double quotes marshalling compatibility test.

Refs #3284

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
2024-01-12 11:18:24 +03:00
Anna Shaleva
910d53b27b core: do not check manifest size on deploy/update
Manifest will be a part of the state.Contract which will be checked on its
way to the storage. Tiny optimisation which allows not to serialize manifest
twice. Ref. https://github.com/nspcc-dev/neo-go/pull/3218#discussion_r1402374232.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-22 20:17:09 +03:00
Anna Shaleva
6824bd9f40 smartcontract: require manifest serialization in (*Manifest).IsValid
Port the restrictive part of https://github.com/neo-project/neo/pull/2948.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-22 19:39:03 +03:00
Anna Shaleva
fdcc369d60 manifest: add compatibility test for Permissions and Trust serialization
We already have tests for Permission deserialisation, so port the first
part of https://github.com/neo-project/neo/pull/2948.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2023-11-18 13:32:28 +03:00
Anna Shaleva
c0a2c74e0c core: maintain a set of NEP17-compliant contracts 2021-07-28 13:22:53 +03:00
Evgeniy Stratonikov
c9e6350915 manifest: fix group permission handling
We need to have at least one matching group in the manifest.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-06-30 11:02:45 +03:00
Evgeniy Stratonikov
4283e1003f manifest: fix wildcard permission handling
Wildcard contract can coexist with restricted set of methods.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-06-30 11:00:06 +03:00
Evgeniy Stratonikov
9c06ba6b07 smartcontract: marshal manifest Extra field as object, fix #2021
This is needed to strip whitespace which can be present.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-06-29 11:39:56 +03:00
Anna Shaleva
efe9bee1ff smartcontract: refactor manifest.FromStackItem test
We need a good case to ensure that error cases constructed well.
2021-05-05 18:54:42 +03:00
Anna Shaleva
50fc9bf766 smartcontract: use permission descriptors for manifest's trusts 2021-05-05 17:40:10 +03:00
Evgeniy Stratonikov
bb039ef035 manifest: add features field 2021-05-04 13:10:46 +03:00
Anna Shaleva
0f1473897b core: temp manifest.Extra marshalling fix
Manifest.Extra still serialized as JSON message with undefined  order
of items, so it affects contract states dumps.
2021-02-12 23:48:30 +03:00
Roman Khimov
dc3967ae7b manifest: add manifest validity checks
Refs. #1699.
2021-02-09 22:31:26 +03:00
Roman Khimov
284476c070 manifest: add Permission and Permissions validity checks
Refs. #1699.
2021-02-09 22:31:26 +03:00
Roman Khimov
0b2e9312af manifest: add event validity check
Refs. #1699.
2021-02-09 22:31:26 +03:00
Roman Khimov
e9ea89b4e3 manifest: add group signature length check
Refs. #1699.
2021-02-09 22:31:24 +03:00
Roman Khimov
1a4958b1d5 manifest: add ABI validity check
Some methods must be defined in a valid ABI. Refs. neo-project/neo#2263.
2021-02-08 13:27:39 +03:00
Roman Khimov
5ba074b4cf manifest: return an error from IsValid
Be more specific.
2021-02-08 12:04:57 +03:00
Anna Shaleva
a2715404d0 core: serialise manifest as stackitem 2021-02-05 19:10:15 +03:00
Evgenii Stratonikov
b7e86fa6a3 manifest: add Safe flag to method descriptor
`interop.Contex.AddMethod` sets `Safe` flag for native
contracts. This allows not to forget to change manifest
when changing call flags.
Also fixed invalid `Safe` flags for `Notary` and `Designate` contracts.
2020-12-08 13:27:43 +03:00
Roman Khimov
b92ea2a48a manifest/compiler: drop hashes from ABI and debug info
See neo-project/neo-devpack-dotnet#391 and neo-project/neo#2044.
2020-11-26 18:30:49 +03:00
Evgenii Stratonikov
c849176be7 manifest: include contract Name 2020-11-24 11:23:44 +03:00
Roman Khimov
286d9185f4 smartcontract: remove contract features
We're featureless now, all contracts have access to storage and payable status
is to be determined via new NEP. Follow neo-project/neo#2060.
2020-11-13 21:26:23 +03:00
Anna Shaleva
66ceaa6b75 smartcontract: add list of supported standards to manifest
Closes #1204
2020-08-04 17:29:44 +03:00
Evgenii Stratonikov
e52c39ae7e manifest: remove EntryPoint from manifest 2020-07-27 11:08:01 +03:00
Roman Khimov
3f2f0be2c2
Merge pull request #1187 from nspcc-dev/neo3/interop/post-preview2_adjustment
interop: post-preview2 adjustment
2020-07-17 13:33:29 +03:00
Anna Shaleva
fddad0b475 core: adjust System.Contract.Create interop
Part of #1055.

It should check given scripthash against manifest groups and return the
contract state as a struct (not interop interface).
2020-07-17 09:28:52 +03:00
Anna Shaleva
72a6740717 rpc: adjust getcontractstate RPC-call JSON fields names
Part of #1130
2020-07-09 17:34:53 +03:00
Evgenii Stratonikov
dd38e3ec3b smartcontract: add smartcontract manifest
Manifest contains all of smartcontract's metadata including
parameters, return value, permissions etc.
2020-04-16 14:05:32 +03:00