Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create specification for Yalland Fund Exchange Contract #14

Open
npopeka opened this issue Apr 9, 2020 · 0 comments
Open

Create specification for Yalland Fund Exchange Contract #14

npopeka opened this issue Apr 9, 2020 · 0 comments
Assignees

Comments

@npopeka
Copy link
Member

npopeka commented Apr 9, 2020

  • The contract Yalland Fund Exchange Contract has an owner and roles;
  • The contract Yalland Fund Exchange Contract has a proxy and is updated;
  • The contract Yalland Fund Exchange Contract data on Members exchanges can be written once before the launch of the contract;
  • When starting a contract, initialTimestamp is set, according to which periods are calculated.
  • The Program Member creates an ExchangeOrder with the following fields: participant ID from the contract, order ID, YALL amount, payment amount in rubles, status, timeStamp. The amount of YALL and payout is calculated;
  • Amount YALL = total amount of claimed YALL from YallandDistribution - total amount of YALL for completed orders + total amount of annulated orders in YALL;
  • The role of Fund Manager sets the exchange rate and the total limit for the exchange per week per user and per all users;
  • The Operator role can close the order. In this case, the closeOrder () method is executed, into which the order ID and ID of the payment document are transmitted. When closing an order, YALL from the contract is displayed at the address Operator;
  • The contract fixes the total number of YALL for all closed orders of all users and each user;
  • The role of Operator can cancel a non-closed order. In this case, YALL are returned to the current user address by ID.
  • There is a method of “Order Cancellation”. It can perform the role of Super Operator. The method is used to refund after closing the order. The order ID is passed to the method. Applies to completed order. Order changes status to canceled. The user is paid the amount of the YALL order to the current address, the caching of the total payments is changed. Super Operator pays YALL for the contract Yalland Fund Exchange Contract;
  • The role of Fund Manager can withdraw YALL, transferred by mistake to the address of the contract.

  • Контракт Yalland Fund Exchange Contract имеет владельца и роли;
  • Контракт Yalland Fund Exchange Contract имеет прокси и обновляется;
  • Контракт Yalland Fund Exchange Contract данные по выплатам пользователям можно однократно записать перед запуском контракта;
  • При запуске контракта устанавливается initialTimestamp, по которому считаются периоды.
  • Program Member создает ExchangeOrder со следующими полями: ID участника из контракта, ID заказа, сумма YALL, сумма выплаты в рублях, статус, timeStamp. Сумма YALL и выплаты рассчитывается;
  • Сумма YALL= общая сумма начислений из YallandDistribution - общая сумма YALL по выполненным заказам + общая сумма аннулированных заказов в YALL;
  • Роль Fund Manager устанавливает курс обмена и общий лимит на обмен в неделю на каждого пользователя и на всех пользователей;
  • Роль Operator может закрыть заказ. При этом выполняется метод closeOrder(), в который передаётся ID заказа и ID платежного документа. При закрытии заказа YALL с контракта выводятся на адрес Operator;
  • В контракте фиксируется общее количество YALL по всем закрытым заказам всех пользователей и каждого пользователя по отдельности;
  • Роль Operator может отменить не закрытый заказ. При этом YALL возвращаются на текущий адрес пользователя по ID.
  • Есть метод “Аннулирование заказа”. Ее может выполнить роль Super Operator. Метод применяется для возврата средств после закрытия заказа. В метод передается ID заказа. Применяется к выполненному заказу. Заказ меняет статус на аннулирован. Пользователю на текущий адрес выплачивается сумма YALL заказа, кеширование общих выплат изменяется. Super Operator оплачивает YALL на контракт Yalland Fund Exchange Contract при вызове метода;
  • Роль Fund Manager может вывести YALL, переведенные по ошибке на адрес контракта.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants