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

Release v24.9 #454

Merged
merged 14 commits into from
Sep 25, 2024
Merged
16 changes: 16 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set addAssignees to 'author' to set the PR creator as the assignee.
addAssignees: author

# Set to true to add assignees to pull requests
addReviewers: true

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- YoshihitoAso
- purplesmoke05

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0

runOnDraft: true
13 changes: 13 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Auto Assign
on:
pull_request:
types: [opened, ready_for_review]

jobs:
add-reviews:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/[email protected]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ibet Smart Contract

<p>
<img alt="Version" src="https://img.shields.io/badge/version-24.6-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-24.9-blue.svg?cacheSeconds=2592000" />
<img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
</p>

Expand Down
2 changes: 1 addition & 1 deletion README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ibet Smart Contract

<p>
<img alt="Version" src="https://img.shields.io/badge/version-24.6-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-24.9-blue.svg?cacheSeconds=2592000" />
<img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
</p>

Expand Down
30 changes: 30 additions & 0 deletions contracts/exchange/IbetSecurityTokenDVP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,36 @@ contract IbetSecurityTokenDVP is Ownable, IbetExchangeInterface {
return success;
}

/// @notice 部分的に残高を引き出しする
/// @dev 決済で拘束されているものは引き出しされない
/// @param _token トークンアドレス
/// @param _value 引き出し数量
/// @return 処理結果
function withdrawPartial(
address _token,
uint _value
) public returns (bool) {
uint256 balance = balanceOf(msg.sender, _token);

require(
balance >= _value,
ErrorCode.ERR_IbetSecurityTokenDVP_withdrawPartial_260601
);

// 更新処理:トークン引き出し(送信)
IbetSecurityTokenInterface(_token).transfer(msg.sender, _value);
DVPStorage(storageAddress).setBalance(
msg.sender,
_token,
balanceOf(msg.sender, _token).sub(_value)
);

// イベント登録
emit Withdrawn(_token, msg.sender);

return true;
}

/// @notice 全ての残高を引き出しする
/// @dev 決済で拘束されているものは引き出しされない
/// @param _token トークンアドレス
Expand Down
36 changes: 30 additions & 6 deletions contracts/token/IbetCoupon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ contract IbetCoupon is Ownable, IbetStandardTokenInterface {
return true;
}

/// @notice トークンの移転
/// @notice 移転
/// @param _to 宛先アドレス
/// @param _value 移転数量
/// @return success 処理結果
Expand All @@ -175,13 +175,13 @@ contract IbetCoupon is Ownable, IbetStandardTokenInterface {
}
}

/// @notice トークンの一括移転
/// @notice 移転(一括)
/// @param _toList 宛先アドレスのリスト
/// @param _valueList 移転数量のリスト
/// @return success 処理結果
function bulkTransfer(
address[] memory _toList,
uint[] memory _valueList
address[] calldata _toList,
uint[] calldata _valueList
) public override returns (bool success) {
// <CHK>
// リスト長が等しくない場合、エラーを返す
Expand Down Expand Up @@ -227,12 +227,12 @@ contract IbetCoupon is Ownable, IbetStandardTokenInterface {
/// @param _from 移転元アドレス
/// @param _to 移転先アドレス
/// @param _value 移転数量
/// @return 処理結果
/// @return success 処理結果
function transferFrom(
address _from,
address _to,
uint _value
) public override onlyOwner returns (bool) {
) public override onlyOwner returns (bool success) {
// 数量が送信元アドレス(from)の残高を超えている場合、エラーを返す
if (balanceOf(_from) < _value)
revert(ErrorCode.ERR_IbetCoupon_transferFrom_130301);
Expand All @@ -256,6 +256,30 @@ contract IbetCoupon is Ownable, IbetStandardTokenInterface {
return true;
}

/// @notice 強制移転(一括)
/// @dev オーナーのみ実行可能
/// @param _fromList 移転元アドレスのリスト
/// @param _toList 移転先アドレスのリスト
/// @param _valueList 移転数量のリスト
/// @return success 処理結果
function bulkTransferFrom(
address[] calldata _fromList,
address[] calldata _toList,
uint[] calldata _valueList
) public override onlyOwner returns (bool success) {
// <CHK>
// 全てのリスト長が等しくない場合、エラーを返す
if (
_fromList.length != _toList.length ||
_fromList.length != _valueList.length
) revert(ErrorCode.ERR_IbetCoupon_bulkTransferFrom_130601);
// 強制移転(一括)
for (uint256 i = 0; i < _fromList.length; i++) {
transferFrom(_fromList[i], _toList[i], _valueList[i]);
}
return true;
}

/// @notice クーポンの消費
/// @param _value 消費数量
function consume(uint _value) public {
Expand Down
36 changes: 30 additions & 6 deletions contracts/token/IbetMembership.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ contract IbetMembership is Ownable, IbetStandardTokenInterface {
return true;
}

/// @notice トークンの移転
/// @notice 移転
/// @param _to 宛先アドレス
/// @param _value 移転数量
/// @return 処理結果
Expand All @@ -168,13 +168,13 @@ contract IbetMembership is Ownable, IbetStandardTokenInterface {
}
}

/// @notice トークンの一括移転
/// @notice 移転(一括)
/// @param _toList 宛先アドレスのリスト
/// @param _valueList 移転数量のリスト
/// @return success 処理結果
function bulkTransfer(
address[] memory _toList,
uint[] memory _valueList
address[] calldata _toList,
uint[] calldata _valueList
) public override returns (bool success) {
// <CHK>
// リスト長が等しくない場合、エラーを返す
Expand Down Expand Up @@ -220,12 +220,12 @@ contract IbetMembership is Ownable, IbetStandardTokenInterface {
/// @param _from 移転元アドレス
/// @param _to 移転先アドレス
/// @param _value 移転数量
/// @return 処理結果
/// @return success 処理結果
function transferFrom(
address _from,
address _to,
uint _value
) public override onlyOwner returns (bool) {
) public override onlyOwner returns (bool success) {
// 数量が送信元アドレス(from)の残高を超えている場合、エラーを返す
if (balanceOf(_from) < _value)
revert(ErrorCode.ERR_IbetMembership_transferFrom_140301);
Expand All @@ -249,6 +249,30 @@ contract IbetMembership is Ownable, IbetStandardTokenInterface {
return true;
}

/// @notice 強制移転(一括)
/// @dev オーナーのみ実行可能
/// @param _fromList 移転元アドレスのリスト
/// @param _toList 移転先アドレスのリスト
/// @param _valueList 移転数量のリスト
/// @return success 処理結果
function bulkTransferFrom(
address[] calldata _fromList,
address[] calldata _toList,
uint[] calldata _valueList
) public override onlyOwner returns (bool success) {
// <CHK>
// 全てのリスト長が等しくない場合、エラーを返す
if (
_fromList.length != _toList.length ||
_fromList.length != _valueList.length
) revert(ErrorCode.ERR_IbetMembership_bulkTransferFrom_140501);
// 強制移転(一括)
for (uint256 i = 0; i < _fromList.length; i++) {
transferFrom(_fromList[i], _toList[i], _valueList[i]);
}
return true;
}

/// @notice 残高の参照
/// @param _owner 保有者のアドレス
/// @return 残高数量
Expand Down
Loading
Loading