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

Change shop information to be created by shop owners themselves #142

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/contracts-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dms-osx-lib",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"main": "dist/bundle-cjs.js",
"module": "dist/bundle-esm.js",
Expand Down
34 changes: 12 additions & 22 deletions packages/contracts/contracts/Ledger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract Ledger {
uint256 timestamp;
uint256 amount;
string currency;
string shopId;
bytes32 shopId;
uint32 method;
address account;
bytes32 phone;
Expand All @@ -43,7 +43,7 @@ contract Ledger {
string purchaseId;
uint256 amount;
string currency;
string shopId;
bytes32 shopId;
address account;
bytes signature;
}
Expand Down Expand Up @@ -73,7 +73,7 @@ contract Ledger {
uint256 timestamp,
uint256 amount,
string currency,
string shopId,
bytes32 shopId,
uint32 method,
address account,
bytes32 phone
Expand All @@ -85,7 +85,7 @@ contract Ledger {
uint256 value,
uint256 balancePoint,
string purchaseId,
string shopId
bytes32 shopId
);
/// @notice 포인트가 지급될 때 발생되는 이벤트
event ProvidedUnPayablePoint(
Expand All @@ -94,7 +94,7 @@ contract Ledger {
uint256 value,
uint256 balancePoint,
string purchaseId,
string shopId
bytes32 shopId
);
/// @notice 사용가능한 포인트로 변환될 때 발생되는 이벤트
event ChangedToPayablePoint(
Expand All @@ -107,7 +107,7 @@ contract Ledger {
/// @notice 포인트가 정산될 때 발생되는 이벤트
event ProvidedTokenForSettlement(
address account,
string shopId,
bytes32 shopId,
uint256 providedAmountPoint,
uint256 providedAmountToken,
uint256 value,
Expand All @@ -121,7 +121,7 @@ contract Ledger {
uint256 value,
uint256 balanceToken,
string purchaseId,
string shopId
bytes32 shopId
);
/// @notice 포인트로 지불을 완료했을 때 발생하는 이벤트
event PaidPoint(
Expand All @@ -133,7 +133,7 @@ contract Ledger {
uint256 balancePoint,
string purchaseId,
uint256 purchaseAmount,
string shopId
bytes32 shopId
);
/// @notice 토큰으로 지불을 완료했을 때 발생하는 이벤트
event PaidToken(
Expand All @@ -145,7 +145,7 @@ contract Ledger {
uint256 balanceToken,
string purchaseId,
uint256 purchaseAmount,
string shopId
bytes32 shopId
);
/// @notice 토큰을 예치했을 때 발생하는 이벤트
event Deposited(address account, uint256 depositAmount, uint256 value, uint256 balanceToken);
Expand Down Expand Up @@ -247,12 +247,7 @@ contract Ledger {
/// @param _amount 지급할 포인트
/// @param _purchaseId 구매 아이디
/// @param _shopId 구매한 가맹점 아이디
function providePoint(
address _account,
uint256 _amount,
string calldata _purchaseId,
string calldata _shopId
) internal {
function providePoint(address _account, uint256 _amount, string calldata _purchaseId, bytes32 _shopId) internal {
pointBalances[_account] += _amount;
emit ProvidedPoint(_account, _amount, _amount, pointBalances[_account], _purchaseId, _shopId);
}
Expand All @@ -267,7 +262,7 @@ contract Ledger {
bytes32 _phone,
uint256 _amount,
string calldata _purchaseId,
string calldata _shopId
bytes32 _shopId
) internal {
unPayablePointBalances[_phone] += _amount;
emit ProvidedUnPayablePoint(_phone, _amount, _amount, unPayablePointBalances[_phone], _purchaseId, _shopId);
Expand All @@ -279,12 +274,7 @@ contract Ledger {
/// @param _amount 지급할 토큰
/// @param _purchaseId 구매 아이디
/// @param _shopId 구매한 가맹점 아이디
function provideToken(
address _account,
uint256 _amount,
string calldata _purchaseId,
string calldata _shopId
) internal {
function provideToken(address _account, uint256 _amount, string calldata _purchaseId, bytes32 _shopId) internal {
uint256 amountToken = convertPointToToken(_amount);

require(tokenBalances[foundationAccount] >= amountToken, "Insufficient foundation balance");
Expand Down
Loading
Loading