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>
Proxy contract used by notary contract as a main tx
payment provider. `Verify` function verifies if
main tx contains multisig of 5\7 inner ring
nodes. If so, then contract pays for transaction.
This is easier than support multisig wallet with
GAS assets, because inner ring can change, therefore
multisig wallet can change periodically.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This check was useful when there was a single
entry point in contract. But right now there is
no point in this.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This reverts commit 76c63b7d
It was workaround for neo-go#1725 but now it is fixed
so we don't need that anymore.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
There is an issue with native contract callback functions
and getting storage context: nspcc-dev/neo-go#1725.
This should fix it for now.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Define InnerRingList function that calls "innerRingList" method of
particular smart contract. Define InnerRingListViaStorage function
that reads address of smart contract from the storage by key, and
calls InnerRingList with the result. Reuse these functions in all
contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Replace getList function to common package and export it. Reuse the function
in Container and Reputation contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define IRNode structure in common package. Replace innerRingInvoker function
in common package and export it. Reuse this function in all contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Replace vote/remoteVotes functions from all contracts (except alphabet) to
common package. Additionally replace setSerialized and bytesEqual. Create
InitVote function and use it in NeoFS and Netmap contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Create common package. Define Ballot struct in common package. Use new type
in all contracts with ballots.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Remove old ballots first so there won't be any
interference with votes of the same tx in the
future after `blockDiff` blocks.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Basic income settlements depends on container estimation that
should be collected in P2P communication between storage nodes
and then stored in container contract. To synchronize these
actions there are two separate notification that inner ring
should produce in consensus.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
EpochProcess method should be invoked by inner ring nodes
and it removes old estimations from contract storage.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Container contract checks signature of eACL iterating through keys
from neofsid contract.
Clients often ask eACL from storage nodes, but it's kinda hard for
them to check signature since they have no direct access to neofsid
contract. So the container contract can make one more iteration
through keys from neofsid contract and return suitable one.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
There are cases when NeoFS applications need to fetch netmap
snapshot of exact epoch. This method provides convenient atomic
way to do that.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
In updated audit scheme, contract stores marshalled audit
result structure and provides interface to list them by
epoch, container or exact audit executor.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>