For notary-enabled environment we expect `put` to be signed by alphabet.
Also group notary-disabled logic inside a single if and
add tests for balance checks.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Contract owner entity does exist anymore. Contract migration
now managed by side chain committee which are Alphabet nodes of
the Inner Ring.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Neo Legacy used migration mechanism to update contracts.
N3 provides update method in native management contract.
Therefore, it makes sense to rename `Migrate` to `Update`.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Balance check at container.Put command will drop some invalid
transactions from the side chain network before inner ring
approval.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
In v0.8.0:
- containers were stored as stable marshaled binary,
In v0.9.0:
- containers are stored the same way as eACL,
- eACL structure has new `token []byte field`.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
With contract migration from v0.8.0 to v0.9.0 we need to replace
structures in contract memory. This produces native contract calls
that are not available in scope of `management.Update`. Therefore
we need to apply new scope first.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
There is a number of contracts which return only `true` value.
Also handling `FAULT` on the client is easier then also checking return
value.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Container now stored the same way as ExtendedACL: with
signature and session token. This is required for signature
checks when session token presented.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Signature check may fail if container has NFT attributes.
So these checks should be done in alphabet nodes and not
inside the contract.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Unified format uses transfer type as the first byte
and extra details next. List of transfer types used in
contracts defined in `transfer.go`. It includes:
- mint,
- burn,
- lock,
- unlock,
- container fee.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Delete initializing of R/W context in `init()`
and start using readonly storage context in
methods where it is possible.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Fill in `safemethods` fields in contract config files
with methods that do not change contract storages.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Change []byte type to interop.*aliasName*
types in contracts where it is suitable to
improve the readability of the contracts.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>