Evgeniy Stratonikov
b38443fe20
smartcontract: add checks for onNEP*Payable methods
...
When they are present in contract, we want them
to have correct signature.
2021-02-19 17:06:07 +03:00
Evgeniy Stratonikov
9c0bbd0bfd
smartcontract: add NEP-11 standard check
...
The only method missing is name, because it is
provided in manifest.
2021-02-19 17:06:07 +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
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
Roman Khimov
211fe307ee
manifest: move ABI code into file of its own
...
Make it a little more convenient to work with it.
2021-02-08 11:55:16 +03:00
Roman Khimov
60dfffc574
manifest: remove no longer used Serializable interface
...
It was used when manifests were saved into JSON.
2021-02-08 10:52:53 +03:00
Roman Khimov
e4b5b59663
Merge pull request #1704 from nspcc-dev/binary_manifest
...
core: serialise manifest as stackitem
2021-02-05 23:58:07 +03:00
Roman Khimov
cd9b34416e
native: call onNEP11Transfer for NEP-11 transfers
...
See neo-project/neo#2287 .
2021-02-05 20:48:45 +03:00
Anna Shaleva
a2715404d0
core: serialise manifest as stackitem
2021-02-05 19:10:15 +03:00
Roman Khimov
a442e1530d
native: rename onPayment into onNEP17Payment
...
Follow neo-project/neo#2287 .
2021-02-05 16:09:51 +03:00
Evgeniy Stratonikov
73f888f02e
core: allow to overload contract methods
...
Multiple methods with different parameter count can co-exist.
2021-01-27 12:51:07 +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
Roman Khimov
34d2eaf00e
manifest: update maximum possible length
...
As per neo-project/neo#2002 .
2020-11-26 18:07:20 +03:00
Evgenii Stratonikov
279b769fa3
manifest: support interface checking
...
There are some standards (NEP5, etc.) which impose
some restrictions on what methods and events a contract
must contain and their signatures. This commit supports
checking if arbitrary manifest complies with the standard.
2020-11-26 12:50:29 +03:00
Evgenii Stratonikov
b97dfae8d8
native: replace NEP-5 with NEP-17
2020-11-24 13:08:23 +03:00
Evgenii Stratonikov
c849176be7
manifest: include contract Name
2020-11-24 11:23:44 +03:00
Roman Khimov
3cb945f022
manifest: simplify marshaling
2020-11-13 21:46:26 +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
Roman Khimov
63c7469dfd
manifest: limit its size when decoding
2020-10-07 18:29:19 +03:00
Evgenii Stratonikov
2d9ef9219a
core: call _deploy method during create/update
2020-10-06 18:03:25 +03:00
Anna Shaleva
e1a266ab86
smartcontract: increase MaxManifestSize
2020-08-27 11:50:09 +03:00
Evgenii Stratonikov
1eb9a4c6c6
core: allow to use verification contracts
...
In NEO3 we can't just appcall hash, as verification script has no access
to state. Instead we use `verify` method of an arbitrary contract.
2020-08-14 09:40:34 +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
685d44dbc1
*: support _initialize
method in contracts
...
Invoke `_initialize` method on every call if present.
In NEO3 there is no entrypoint and methods are invoked by offset,
thus `Main` function is no longer required.
We still have special `Main` method in tests to simplify them.
2020-07-27 13:00:35 +03:00
Evgenii Stratonikov
d2ddf7b7cb
*: support invoking methods by offset
...
Allow to invoke methods by offset:
1. Every invoked contract must have manifest.
2. Check arguments count on invocation.
3. Change AppCall to a regular syscall.
4. Add test suite for `System.Contract.Call`.
2020-07-27 13:00:35 +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
df958caf93
core: add Manifest to state.Contract
2020-06-11 10:45:24 +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