Commit Graph

20 Commits (f884e3d665e53f10f9811817d4cb1b02b9077e5c)

Author SHA1 Message Date
Alex Vanin f884e3d665 [#68] Use unified format for transferX details
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>
2021-04-08 17:04:31 +03:00
Alex Vanin 23f5f1e0e7 [#63] Fix threshold number calculation
`x*2/3` is not equal to `x/3*2` with integers.
The only correct way to calculate threshold is
the first one.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-25 21:22:27 +03:00
Alex Vanin c3a7c6ad23 [#58] common: Remove unused functions
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-25 18:19:47 +03:00
Alex Vanin 4ace86e9b3 [#58] common: Add getters for alphabet and IR nodes from chain
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-25 18:19:47 +03:00
Alex Vanin 97a5e27403 [#59] Update to pre-released version of neo-go v0.94.0
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 11:23:11 +03:00
Alex Vanin 7ba5d50fd4 [#59] proxy: Check committee address in Verify function
For committee operations in side chain we can't use 5\7 multi
address, instead we should use 4\7 for this case.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 11:23:11 +03:00
Pavel Karpy 508369be75 [#25] Use go aliases
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>
2021-03-05 17:13:49 +03:00
Alex Vanin 7fbf6d73b0 [#51] proxy: Add proxy contract
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>
2021-03-04 11:26:14 +03:00
Alex Vanin 88c738b736 [#49] Support contract migration
At initialization contract saves master script hash
that allows to re-initialize or migrate contract.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-12 18:33:55 +03:00
Alex Vanin 9445c5c2fc [#47] Replace `GetHeight` with `CurrentIndex`
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:31:57 +03:00
Alex Vanin 27ca675869 [#47] Update contract.Call invocations
Now contract calls require call flags.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:31:57 +03:00
Leonard Lyubich 5d8c07b6e5 [#42] common: Replace IRNode type and InnerRingInvoker func to ir.go file
Remove empty invoke.go source file.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-04 10:31:24 +03:00
Leonard Lyubich 0541d83cf4 [#42] common: Replace InvokeID function to vote.go source file
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-04 10:31:24 +03:00
Leonard Lyubich a9e745db18 [#42] common: Replace Ballot struct's definition to vote.go src file
Remove empty ballot.go source file.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-04 10:31:24 +03:00
Leonard Lyubich 8ceba2a7c2 [#42] Share InnerRingList function between contracts
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>
2021-02-04 10:31:24 +03:00
Leonard Lyubich 68882b5b3c [#42] Share GetList function between contracts
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>
2021-02-04 10:31:24 +03:00
Leonard Lyubich 3395a886fc [#42] Share InnerRingInvoker function between contracts
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>
2021-02-04 10:31:24 +03:00
Leonard Lyubich dd0768aaeb [#42] Share InvokeID between contracts
Replace invokeID to common package and export it.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-04 10:31:24 +03:00
Leonard Lyubich c3efe152d6 [#42] Share Vote/RemoteVotes between contracts
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>
2021-02-04 10:31:24 +03:00
Leonard Lyubich f9f2a03078 [#42] Share ballot structure between contracts
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>
2021-02-04 10:31:24 +03:00