Commit graph

31 commits

Author SHA1 Message Date
Alex Vanin
df27e859c9 [#18] Move neofs contract to separate dir
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-27 17:33:56 +03:00
Alex Vanin
6a881a2baa Set max amount for Withdraw and Deposit methods
These methods initiate `transfer` call on internal
balance method that have Fixed12 precision. With this
limit it will not overflow JSON integer bound 2**53-1

Actual limit is 9007, but it was floored.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-26 18:26:04 +03:00
Alex Vanin
332e1ceca9 [#16] Verify initial inner ring size and keys
closes #16

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-17 19:09:50 +03:00
Alex Vanin
33802137ee [#15] Specify type of interface typed arguments
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
Alex Vanin
47eb73ad67 [#15] Update native gas script hash
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
Alex Vanin
ff83e7fe78 [#15] Fix AppCall invocations
There is no need in single array for all arguments now.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
Alex Vanin
9041bb77d4 [#15] Update inline docs
Since all contract methods have separated function,
method descriptions were moved from global comment
section to the function definitions (go-way).

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
Alex Vanin
d75c11c897 [#15] Check amount value in withdraw method
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
Alex Vanin
7a275a3c4b [#15] Refactor contract body for neo-go v0.91
In neo-go v0.91.0 manifest file should contain info
about all contract methods. To do that neo-go compiler
uses public function defined in contract file. This
commit splits entire Main function into smaller
independent contract methods.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
Alex Vanin
da3c75465b [#15] Update neo-go to v0.91.0
Neo-go v0.91.0 supports neo3-preview-3.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-28 09:55:02 +03:00
alexvanin
013a70f3bf Remove unused functions and fix lint errors 2020-07-21 12:42:14 +03:00
alexvanin
8c7bcea436 Add system config methods
NeoFS contract will contain installation parameters
for storage network such as max object size, epoch
duration, etc.
2020-07-21 12:39:22 +03:00
alexvanin
7a806bd550 Update "InnerRingUpdate" method 2020-07-16 17:54:06 +03:00
alexvanin
abdbe6b9dc Update methods for inner ring candidate managing
This commit:
- increases default candidate fee,
- adds function to list inner ring candidates,
- updates add and remove candidate methods.
2020-07-16 15:09:54 +03:00
alexvanin
8ef70e70d7 Add "Bind" and "Unbind" methods
New methods allow to bind and unbind public keys
with the owner, therefore the user can store and
access data with the key, that does not related
to the wallet.
2020-07-16 12:50:24 +03:00
alexvanin
6797c7c1a7 Update "Cheque" method 2020-07-16 10:49:41 +03:00
alexvanin
62d5d863f4 Rename "Deploy" method to "Init"
There was a bit of confusion between contract deploying
and calling "Deploy" method. Also new "Init" method
uses generic setter to initialize contract storage.
2020-07-15 20:00:05 +03:00
alexvanin
209740f060 Use generic setter and type defined getters
With NEO3.0 there is a null pointers in VM, so we
can use it to check if value was stored in cotnract
storage or not.
2020-07-15 19:58:31 +03:00
alexvanin
2f86e8f5d0 Rename check structure to cheque
Cheque is widely used in neofs as a definition
of structure that connected with configuration
changing or asset withdraw. This name is used
to avoid confusion with 'check' with
verification meaning.
2020-07-15 19:57:14 +03:00
alexvanin
bf8b6f91d7 Fix withdraw log message 2020-07-15 19:55:10 +03:00
alexvanin
ca54f71d30 Update "Deposit" method
Deposit method now takes script hashes instead of public keys and
uses native gas token.
2020-07-15 19:02:40 +03:00
alexvanin
b9ca56d891 Update neo-go to v0.90.0-pre and fix smart-contract
Neo-go v0.90.0-pre implements neo3 features.
2020-07-09 16:38:53 +03:00
alexvanin
f10d346925 Fix tests for unique inner ring invoke checker 2020-06-19 13:40:09 +03:00
alexvanin
dc84dde87b Limit ballot lifetime and store unique inner ring invocations 2020-06-15 18:54:24 +03:00
alexvanin
19db32b654 Add tx hash for "Deposit" and "Withdraw" notifications
As the user can invoke several deposit or withdraw calls
inner ring nodes should be able to differ them even if they
have the same arguments. To do that neofs-contract notifies
about tx hash, which can be used as unique identifier of
withdraw or deposit operation.
2020-06-15 13:32:13 +03:00
alexvanin
cb00b6133e Update withdraw mechanism
Withdraw operation works a bit different with neo:morph.
User calls "Deposit" and "Withdraw" methods that produce
notifications for the inner ring nodes.

"Deposit" method does not produce feedback, but "Withdraw"
does. Inner ring nodes check if user eligible to withdraw
assets. If so, nodes invoke "Cheque" method. This method
collects invocations from inner ring nods. When there are
2/3n + 1 invocations, smart-contract transfers assets back
to the user and produces notifications.
2020-06-15 13:32:13 +03:00
alexvanin
4fbfa1bc98 Collect "InnerRingUpdate" calls from inner ring nodes
Inner ring nodes do not collect signatures for the cheque now.
Instead they invoke "InnerRingUpdate" method and smart-contract
checks if method was called from inner ring node. Then it
accepts cheque if there were 2/3n+1 invokes.
2020-06-15 13:32:13 +03:00
alexvanin
78b8af8f83 Do not store multiaddress of inner ring nodes
With neo:morph environment, there will be no direct communication
between inner ring nodes and storage nodes. neo:morph smart-contracts
will identify inner ring nodes by their signatures.
2020-06-15 13:32:13 +03:00
alexvanin
9f33939dee Add "IsInnerRing" method
Inner ring nodes check their presence in inner ring list during
startup. "IsInnerRing" method allows to check presence efficiently
by calling this method.
2020-06-15 13:32:13 +03:00
Leonard Lyubich
9a51b508e8 Use loop label in InnerRingUpdate call handler 2020-05-20 12:38:11 +03:00
alexvanin
859c29c8df init commit 2020-04-01 19:27:29 +03:00