|
1 | 1 | # defi-helper-waves
|
2 | 2 |
|
3 |
| -automate.ride, balance.ride и oracle.ride -- dApp-ы defi-helper |
4 |
| -swop_governance.ride -- обрезанный по функционалу контракт экоситсемы SWOP |
5 |
| -test_defihelper.py -- файл, который позволяет в скриптовом стиле посмотреть бизнес логику и проверить работоспособность контратков |
| 3 | +automate.ride, balance.ride and oracle.ride — defi-helper dApp-s |
6 | 4 |
|
7 |
| -#### Общая информация |
8 |
| -Все действия, требующие 2/3 подтверждений от админов, осуществляются через добавление в стейт аккаунта админов информации о транзакции |
| 5 | +swop_governance.ride — feature-reduced SWOP ecosystem contract |
| 6 | + |
| 7 | +test_defihelper.py — script that allows glance at business logic and checks the functionality |
| 8 | + |
| 9 | +#### General info |
| 10 | +All actions requiring 3/5 confirmation from admins are performed by adding data about the transaction to the admins' account state |
9 | 11 | ```
|
10 | 12 | {
|
11 | 13 | 'type':'boolean',
|
12 |
| - 'key': _txid_ # ключ с id транзакции в base58 |
| 14 | + 'key': _txid_ # key with base58 transaction id |
13 | 15 | 'value': True
|
14 | 16 | }
|
15 | 17 | ```
|
16 | 18 |
|
17 | 19 | ##### oracle.ride
|
18 |
| -В этотом контракте хранится все осоновные переменные |
| 20 | +This contract stores all the main variables |
19 | 21 | ```
|
20 |
| -balance_address, type:string - base58 адрес balance контракта |
21 |
| -swop_governance, type:string - base58 адрес swop_governance контракта |
22 |
| -SWOP, type:string - base58 id токена SWOP |
23 |
| -WAVES_USDN_pool, type:string - base58 адрес контракта экосистемы SWOP |
24 |
| -consumers, type:string - через запятую base58 адреса контрактов, обладающих правом взаимоедйтсвововать с автомейтами |
25 |
| -admin_1, type:string - base58 адрес админа |
26 |
| -admin_2, type:string - base58 адрес админа |
27 |
| -admin_3, type:string - base58 адрес админа |
28 |
| -protocol_fee_in_usdn, type:integer - комиссия протокола в копейках USDN |
29 |
| -is_protocol_active, type:boolean - если не true, методы контрактов экосистемы defi-helper |
| 22 | +balance_address, type:string - base58 balance contract |
| 23 | +swop_governance, type:string - base58 swop_governance contract |
| 24 | +SWOP, type:string - base58 SWOP token id |
| 25 | +WAVES_USDN_pool, type:string - base58 SWOP ecosystem contract address |
| 26 | +consumers, type:string - comma-separated base58 addresses that have the right to interact with automates |
| 27 | +admin_1, type:string - base58 admin1 |
| 28 | +admin_2, type:string - base58 admin2 |
| 29 | +admin_3, type:string - base58 admin3 |
| 30 | +admin_4, type:string - base58 admin4 |
| 31 | +admin_5, type:string - base58 admin5 |
| 32 | +protocol_fee_in_usdn, type:integer - USDN protocol commission |
| 33 | +is_protocol_active, type:boolean - if not true, defi-helper ecosystem contract methods are inactive |
30 | 34 | ```
|
31 |
| -Пример можно увидеть в test_defihelper.py |
| 35 | +You can see an example in test_defihelper.py |
32 | 36 |
|
33 | 37 | ##### balance.ride
|
34 | 38 |
|
35 |
| -Вызываемые методы: |
| 39 | +Called methods: |
36 | 40 |
|
37 |
| -- init() -- вызывается один раз. Создаёт запись для общего баланса и активирует is_dapp_active == true |
38 |
| -- updateAutomateStatus(automate: String, status: Boolean) -- добавление automate в whitelist. Необходимо, чтобы автомейт самостоятельно списывал комиссию с balance |
39 |
| -- extractFee(user: String, isFeeExtract: Boolean) -- метод, вызываемый automate-ом, при списываении комиссии |
40 |
| -- replenishBalance(userToReplenish: String) -- пополнение баланса в WAVES для userToReplenish |
41 |
| -- withdraw(withdrawAmt: Int) -- вывод средств пользователем с баланса |
42 |
| -- incomeProtocolWithdraw(addresForSendingIncome : String) -- вывод дохода протокола. Требует 2/3 одобрения от админов |
43 |
| -- shutdownDapp() -- остановка контракта. Доступно consumer, admins |
44 |
| -- @Verifier(tx) -- все отправляемые транзакции требут 2/3 одобрения от админов |
| 41 | +- init() - сalled once. Creates an entry for total balance and activates is_dapp_active == true |
| 42 | +- updateAutomateStatus(automate: String, status: Boolean) - adding automate to the whitelist. It is necessary for the automate to deduct the commission from the balance |
| 43 | +- extractFee(user: String, isFeeExtract: Boolean) - method called by automate for debiting the commission |
| 44 | +- replenishBalance(userToReplenish: String) - balance replenishment in WAVES for userToReplenish |
| 45 | +- withdraw(withdrawAmt: Int) - user withdrawal from the balance |
| 46 | +- incomeProtocolWithdraw(addresForSendingIncome : String) - protocol income output. Requires 3/5 approval from admins |
| 47 | +- shutdownDapp() - contract stop. Available for consumers and admins |
| 48 | +- @Verifier(tx) - all transactions sent from contract require 3/5 approval from admins |
45 | 49 |
|
46 | 50 | ##### automate.ride
|
47 | 51 |
|
48 |
| -Вызываемые методы: |
| 52 | +Called methods: |
49 | 53 |
|
50 |
| -- init() -- вызывается пользователем. Записывает в стейт адрес владельца и активирует is_dapp_active == true |
51 |
| -- governanceLockSWOP() -- принимает платёж в SWOP. Вызывает lockSWOP() на governance контракте экосистемы Swop |
52 |
| -- governanceClaimAndStake(minSWOPreward: Int) -- Клейм и рестейк средств. Возможен вызов consumer и пользователем. При вызове от имени consumer взымается комиссия протокола protocol_fee_in_usdn и 0.005 WAVES с баланса пользователя в balance |
53 |
| -- governanceWithdraw(amtToWithdraw:Int) -- вывод SWOP из экоситсемы Swop. Доступно толко пользователю |
54 |
| -- shutdownDapp() -- остановка контракта. Доступно consumer, admins и owner(пользователь) |
55 |
| -- @Verifier(tx) -- все отправляемые транзакции требут 2/3 одобрения от админов |
| 54 | +- init() - called by user. Writes owner's address to the state and activates is_dapp_active == true |
| 55 | +- governanceLockSWOP() - accepts payment in SWOP. Calls lockSWOP() on the Swop ecosystem contract |
| 56 | +- governanceClaimAndStake(minSWOPreward: Int) - Claim and restake SWOP. It is possible to call for consumer and user. When calling by consumer, protocol_fee_in_usdn and 0.005 WAVES are charged from user in balance dApp |
| 57 | +- governanceWithdraw(amtToWithdraw:Int) - output SWOP from the Swop ecosystem. Available only to the user |
| 58 | +- shutdownDapp() - contract stop. Available for consumer, admins and owner(user) |
| 59 | +- @Verifier(tx) - all transactions sent from contract require 3/5 approval from admins |
56 | 60 |
|
0 commit comments