2021-07-06 15:55:04 +00:00
|
|
|
/*
|
2022-04-14 11:56:51 +00:00
|
|
|
Balance contract is a contract deployed in NeoFS sidechain.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
Balance contract stores all NeoFS account balances. It is a NEP-17 compatible
|
|
|
|
contract, so it can be tracked and controlled by N3 compatible network
|
2021-07-06 15:55:04 +00:00
|
|
|
monitors and wallet software.
|
|
|
|
|
|
|
|
This contract is used to store all micro transactions in the sidechain, such as
|
|
|
|
data audit settlements or container fee payments. It is inefficient to make such
|
2022-04-14 11:56:51 +00:00
|
|
|
small payment transactions in the mainchain. To process small transfers, balance
|
2021-07-06 15:55:04 +00:00
|
|
|
contract has higher (12) decimal precision than native GAS contract.
|
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
NeoFS balances are synchronized with mainchain operations. Deposit produces
|
2021-07-06 15:55:04 +00:00
|
|
|
minting of NEOFS tokens in Balance contract. Withdraw locks some NEOFS tokens
|
2022-04-14 11:56:51 +00:00
|
|
|
in a special lock account. When NeoFS contract transfers GAS assets back to the
|
|
|
|
user, the lock account is destroyed with burn operation.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
# Contract notifications
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
Transfer notification. This is a NEP-17 standard notification.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
Transfer:
|
|
|
|
- name: from
|
|
|
|
type: Hash160
|
|
|
|
- name: to
|
|
|
|
type: Hash160
|
|
|
|
- name: amount
|
|
|
|
type: Integer
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
TransferX notification. This is an enhanced transfer notification with details.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
TransferX:
|
|
|
|
- name: from
|
|
|
|
type: Hash160
|
|
|
|
- name: to
|
|
|
|
type: Hash160
|
|
|
|
- name: amount
|
|
|
|
type: Integer
|
|
|
|
- name: details
|
|
|
|
type: ByteArray
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
Lock notification. This notification is produced when a lock account is
|
|
|
|
created. It contains information about the mainchain transaction that has produced
|
|
|
|
the asset lock, the address of the lock account and the NeoFS epoch number until which the
|
|
|
|
lock account is valid. Alphabet nodes of the Inner Ring catch notification and initialize
|
|
|
|
Cheque method invocation of NeoFS contract.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
Lock:
|
|
|
|
- name: txID
|
|
|
|
type: ByteArray
|
|
|
|
- name: from
|
|
|
|
type: Hash160
|
|
|
|
- name: to
|
|
|
|
type: Hash160
|
|
|
|
- name: amount
|
|
|
|
type: Integer
|
|
|
|
- name: until
|
|
|
|
type: Integer
|
2021-07-06 15:55:04 +00:00
|
|
|
|
|
|
|
Mint notification. This notification is produced when user balance is
|
2022-04-14 11:56:51 +00:00
|
|
|
replenished from deposit in the mainchain.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
Mint:
|
|
|
|
- name: to
|
|
|
|
type: Hash160
|
|
|
|
- name: amount
|
|
|
|
type: Integer
|
2021-07-06 15:55:04 +00:00
|
|
|
|
|
|
|
Burn notification. This notification is produced after user balance is reduced
|
2022-04-14 11:56:51 +00:00
|
|
|
when NeoFS contract has transferred GAS assets back to the user.
|
2021-07-06 15:55:04 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
Burn:
|
|
|
|
- name: from
|
|
|
|
type: Hash160
|
|
|
|
- name: amount
|
|
|
|
type: Integer
|
2021-07-06 15:55:04 +00:00
|
|
|
*/
|
2021-07-04 11:08:37 +00:00
|
|
|
package balance
|