Skip to content

feat: basic batchTransfer function #1

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

Merged
merged 8 commits into from
Apr 21, 2025
Merged

feat: basic batchTransfer function #1

merged 8 commits into from
Apr 21, 2025

Conversation

tnkshuuhei
Copy link
Member

No description provided.

Copy link

github-actions bot commented Apr 21, 2025

Slither report

THIS CHECKLIST IS NOT COMPLETE. Use --show-ignored-findings to show all the results.
Summary

shadowing-local

Impact: Low
Confidence: High

function mintClaim(address account, uint256 units, string memory uri, TransferRestrictions restrictions) external;

calls-loop

Impact: Low
Confidence: Medium

function batchTransfer(bytes memory data) external {
require(data.length > 0, INVALID_DATA());
TransferData memory transferData = abi.decode(data, (TransferData));
require(transferData.recipients.length == transferData.fractionIds.length, INVALID_LENGTHS());
for (uint256 i = 0; i < transferData.recipients.length; i++) {
address recipient = transferData.recipients[i];
uint256 fractionId = transferData.fractionIds[i];
require(hypercertToken.ownerOf(fractionId) == msg.sender, INVALID_CALLER(msg.sender));
hypercertToken.safeTransferFrom(msg.sender, recipient, fractionId, 1, "");
}
}

function batchTransfer(bytes memory data) external {
require(data.length > 0, INVALID_DATA());
TransferData memory transferData = abi.decode(data, (TransferData));
require(transferData.recipients.length == transferData.fractionIds.length, INVALID_LENGTHS());
for (uint256 i = 0; i < transferData.recipients.length; i++) {
address recipient = transferData.recipients[i];
uint256 fractionId = transferData.fractionIds[i];
require(hypercertToken.ownerOf(fractionId) == msg.sender, INVALID_CALLER(msg.sender));
hypercertToken.safeTransferFrom(msg.sender, recipient, fractionId, 1, "");
}
}

unused-state

Impact: Informational
Confidence: High

uint256 internal constant FRACTION_LIMIT = 253;

immutable-states

Impact: Optimization
Confidence: High

IHypercertToken public hypercertToken;

Copy link

Coverage after merging feat/batchTransfer into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   BatchTransferFraction.sol100%100%100%100%

@tnkshuuhei tnkshuuhei changed the title test CI feat: basic batchTransfer function Apr 21, 2025
@tnkshuuhei tnkshuuhei merged commit f2aecd5 into main Apr 21, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant